Skip to content

Commit

Permalink
Update Ubuntu 16.04 images (#3336)
Browse files Browse the repository at this point in the history
* Update Ubuntu 16.04 images

* Simplify documentation

* Address CR feedback
  • Loading branch information
am11 committed Aug 31, 2022
1 parent 14020ac commit b5bca68
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 272 deletions.
14 changes: 7 additions & 7 deletions diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ stages:
parameters:
name: Linux_cross
osGroup: Linux
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-20210719121212-8a8d3be
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm-20220831130722-70ed2e8
crossrootfsDir: '/crossrootfs/arm'
buildAndSkipTest: true
strategy:
Expand All @@ -207,7 +207,7 @@ stages:
parameters:
name: Linux_cross64
osGroup: Linux
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-20210719121212-8a8d3be
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm64-20220831130722-70ed2e8
crossrootfsDir: '/crossrootfs/arm64'
buildAndSkipTest: true
strategy:
Expand All @@ -221,7 +221,7 @@ stages:
parameters:
name: Alpine_cross64
osGroup: Linux
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-20210923140502-78f7860
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm64-alpine-20220831130722-70ed2e8
crossrootfsDir: '/crossrootfs/arm64'
artifactsTargetPath: bin/Linux-musl.arm64.Release
buildAndSkipTest: true
Expand Down Expand Up @@ -281,9 +281,9 @@ stages:

- template: /eng/build.yml
parameters:
name: Ubuntu_16_04
name: Ubuntu_18_04
osGroup: Linux
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-09ca40b-20190520220842
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-3e800f1-20190508143252
dependsOn: CentOS_7
testOnly: true
strategy:
Expand All @@ -294,9 +294,9 @@ stages:

- template: /eng/build.yml
parameters:
name: Ubuntu_18_04
name: Ubuntu_22_04
osGroup: Linux
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-3e800f1-20190508143252
dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-20220831130452-94fc78a
dependsOn: CentOS_7
testOnly: true
strategy:
Expand Down
216 changes: 32 additions & 184 deletions documentation/building/linux-instructions.md
Original file line number Diff line number Diff line change
@@ -1,210 +1,58 @@
Linux Prerequisites
Linux Prerequisites
===================

These instructions will lead you through preparing to build and test the diagnostics repo on Linux. We'll start by showing how to set up your environment from scratch. In some cases, a version lldb/llvm that works the best on the distro will have to be built and installed.

Toolchain Setup
---------------

The following instructions will install the required packages. This only needs to be done once per machine. These instructions assume that you already have "sudo" installed. It is also recommended to create a github fork of the diagnostics repo and cloning that instead of https://github.com/dotnet/diagnostics.git directly.
SOS plugin requires lldb v3.9 and above. It is recommended to use latest version of llvm toolchain, but any version >= 3.9 should work.

To build or cross build for ARM on Windows or Linux see the instructions [here](https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/cross-building.md#generating-the-rootfs) in the runtime repo. You will need to clone the runtime [repo](https://github.com/dotnet/runtime.git) and build the appropriate "rootfs" for arm or arm64 using these instructions. You only need to do this once.

#### Ubuntu 14.04 ####
Other prerequisites are:

In order to get clang-3.9, llvm-3.9 and lldb-3.9, we need to add additional package sources (see [http://llvm.org/apt/](http://llvm.org/apt/) for the other Ubuntu versions not listed here):
* cmake
* python
* icu

sudo apt-get update
sudo apt-get install wget
echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.9 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
Examples
--------

Then install the required packages:
Debian/Ubuntu:

sudo apt-get install cmake clang-3.9 gdb gettext git libicu-dev lldb-3.9 liblldb-3.9-dev libunwind8 llvm-3.9 make python python-lldb-3.9 tar zip
```sh
sudo apt install cmake clang curl gdb gettext git libicu-dev lldb liblldb-dev libunwind8 llvm make python python-lldb tar wget zip
```

The lldb 3.9 package needs a lib file symbolic link fixed:
Alpine:

cd /usr/lib/llvm-3.9/lib
sudo ln -s ../../x86_64-linux-gnu/liblldb-3.9.so.1 liblldb-3.9.so.1
```sh
sudo apk add autoconf bash clang clang-dev cmake coreutils curl gcc gettext-dev git icu-dev krb5-dev libunwind-dev llvm make openssl openssl-dev python which
```

See the section below on how to clone, build and test the repo.
CentOS/Fedora/RHEL:

#### Ubuntu 16.04 ####
```sh
# on older OS versions, replace `dnf` with `yum`
sudo dnf install clang cmake openssl findutils gdb git libicu libunwind lldb-devel llvm-devel make python python2-lldb tar wget which zip
```

Add the additional package sources:
OpenSuse:

sudo apt-get update
sudo apt-get install wget
echo "deb http://llvm.org/apt/xenial/ llvm-toolchain-xenial main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb http://llvm.org/apt/xenial/ llvm-toolchain-xenial-3.9 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update

Then install the required packages:

sudo apt-get install cmake clang-3.9 gdb gettext git libicu-dev lldb-3.9 liblldb-3.9-dev libunwind8 llvm-3.9 make python python-lldb-3.9 tar zip

The lldb 3.9 package needs a lib file symbolic link fixed:

cd /usr/lib/llvm-3.9/lib
sudo ln -s ../../x86_64-linux-gnu/liblldb-3.9.so.1 liblldb-3.9.so.1

See the section below on how to clone, build and test the repo.

#### Ubuntu 17.10 ####

Add the additional package sources:

sudo apt-get update
sudo apt-get install wget
echo "deb http://llvm.org/apt/artful/ llvm-toolchain-artful main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb http://llvm.org/apt/artful/ llvm-toolchain-artful-3.9 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update

Then install the required packages:

sudo apt-get install cmake clang-3.9 gdb gettext git libicu-dev lldb-3.9 liblldb-3.9-dev libunwind8 llvm-3.9 make python python-lldb-3.9 tar zip

#### Ubuntu 18.04 ####

Install the required packages:

sudo apt-get update
sudo apt-get install cmake clang-3.9 curl gdb gettext git libicu-dev libssl1.0-dev lldb-3.9 liblldb-3.9-dev libunwind8 llvm-3.9 make python-lldb-3.9 tar wget zip

See the section below on how to clone, build and test the repo.

#### Ubuntu 20.04 ####

Install the required packages:

sudo apt update
sudo apt install cmake clang curl gdb gettext git libicu-dev lldb liblldb-dev libunwind8 llvm make python python-lldb tar wget zip

See the section below on how to clone, build and test the repo.
#### Alpine 3.8/3.9 ####

Install the required packages:

sudo apk add autoconf bash clang clang-dev cmake coreutils curl gcc gettext-dev git icu-dev krb5-dev libunwind-dev llvm make openssl openssl-dev python which

#### CentOS 6 ####

[TBD]

#### CentOS 7 ####

llvm, clang and lldb 3.9 will have to be built for this distro.

First the prerequisites:

sudo yum install centos-release-SCL epel-release
sudo yum install cmake cmake3 gcc gcc-c++ gdb git libicu libunwind make python27 tar wget which zip

Now build and install llvm/lldb 3.9 using the script provided here: [build-install-lldb.sh](../lldb/centos7/build-install-lldb.sh).

WARNING: this script installs llvm and lldb and may overwrite any previously installed versions.

cd $HOME
git clone https://github.com/dotnet/diagnostics.git
$HOME/diagnostics/documentation/lldb/centos7/build-install-lldb.sh

This will take some time to complete, but after it is finished all the required components will be built and installed. To build and test the repo:

cd diagnostics
./build.sh
./test.sh

#### Debian 8.2/8.7 ####

In order to get lldb-5.0 (3.9 doesn't seem to work that well on 8.x), we need to add additional package sources:

sudo apt-get update
sudo apt-get install wget
echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-5.0 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update

Then install the packages you need:

sudo apt-get install cmake clang-5.0 gdb gettext git libicu-dev liblldb-5.0-dev libunwind8 lldb-5.0 llvm make python-lldb-5.0 tar wget zip

See the section below on how to clone, build and test the repo. Add "--clang5.0" to the ./build.sh command.

#### Debian 9 (Stretch) ####

sudo apt-get install cmake clang-3.9 gdb gettext git libicu-dev liblldb-3.9-dev libunwind8 lldb-3.9 llvm make python-lldb-3.9 tar wget zip

See the section below on how to clone, build and test the repo.

#### Fedora 24 ####

sudo dnf install clang cmake findutils gdb git libicu libunwind make python tar wget which zip

Now build and install llvm/lldb 3.9 using the script provided here: [build-install-lldb.sh](../lldb/fedora24/build-install-lldb.sh).

WARNING: this script installs llvm and lldb and may overwrite any previously installed versions.

cd $HOME
git clone https://github.com/dotnet/diagnostics.git
$HOME/diagnostics/documentation/lldb/fedora24/build-install-lldb.sh

This will take some time to complete, but after it is finished all the required components will be built and installed. To build and test the repo:

cd diagnostics
./build.sh
./test.sh

#### Fedora 27, 28, 29 ####

sudo dnf install clang cmake compat-openssl10 findutils gdb git libicu libunwind lldb-devel llvm-devel make python python2-lldb tar wget which zip

See the section below on how to clone, build and test the repo.

#### OpenSuse 42.1, 42.3 ####

sudo zypper install cmake gcc-c++ gdb git hostname libicu libunwind lldb-devel llvm-clang llvm-devel make python python-xml tar wget which zip
ln -s /usr/bin/clang++ /usr/bin/clang++-3.5

Now build and install llvm/lldb 3.9 using the script provided here: [build-install-lldb.sh](../lldb/opensuse/build-install-lldb.sh).

WARNING: this script installs llvm and lldb and may overwrite any previously installed versions.

cd $HOME
git clone https://github.com/dotnet/diagnostics.git
$HOME/diagnostics/documentation/lldb/opensuse/build-install-lldb.sh

This will take some time to complete, but after it is finished all the required components will be built and installed. To build and test the repo:

cd diagnostics
./build.sh
./test.sh

#### RHEL 7.5 ####

[TBD]

#### SLES ####

[TBD]

Set the maximum number of file-handles
--------------------------------------

To ensure that your system can allocate enough file-handles for the build run `sysctl fs.file-max`. If it is less than 100000, add `fs.file-max = 100000` to `/etc/sysctl.conf`, and then run `sudo sysctl -p`.
```sh
sudo zypper install cmake gcc-c++ gdb git hostname libicu libunwind lldb-devel llvm-clang llvm-devel make python python-xml tar wget which zip
```

Clone, build and test the repo
------------------------------

You now have all the required components. To clone, build and test the repo:

cd $HOME
git clone https://github.com/dotnet/diagnostics.git
cd diagnostics
./build.sh
./test.sh
```sh
cd $HOME
git clone https://github.com/dotnet/diagnostics.git
cd diagnostics
./build.sh
./test.sh
```
30 changes: 0 additions & 30 deletions documentation/lldb/centos7/build-install-lldb.sh

This file was deleted.

23 changes: 0 additions & 23 deletions documentation/lldb/fedora24/build-install-lldb.sh

This file was deleted.

28 changes: 0 additions & 28 deletions documentation/lldb/opensuse/build-install-lldb.sh

This file was deleted.

0 comments on commit b5bca68

Please sign in to comment.