Skip to content

Commit

Permalink
Revert "Add more complete linux build instructions (dotnet#101631)" (d…
Browse files Browse the repository at this point in the history
…otnet#104581)

This reverts commit 55747a5.
  • Loading branch information
agocke authored Jul 8, 2024
1 parent 55747a5 commit f0ff6d6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 36 deletions.
26 changes: 17 additions & 9 deletions docs/workflow/requirements/linux-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,23 @@ Minimum RAM required to build is 1GB. The build is known to fail on 512 MB VMs (

### Toolchain Setup

Install the packages listed in [debian-reqs.txt](/eng/debian-reqs.txt).

You can install all the above dependencies by running

```bash
sudo ./eng/install-native-dependencies.sh
```

### Community-supported environments
Install the following packages for the toolchain:

* CMake 3.20 or newer
* llvm
* lld
* clang
* build-essential
* python-is-python3
* curl
* git
* lldb
* libicu-dev
* liblttng-ust-dev
* libssl-dev
* libkrb5-dev
* zlib1g-dev
* ninja-build (optional, enables building native code with ninja instead of make)

**NOTE**: If you have an Ubuntu version older than 22.04 LTS, or Debian version older than 12, don't install `cmake` using `apt` directly. Follow the note written down below.

Expand Down
19 changes: 0 additions & 19 deletions eng/debian-reqs.txt

This file was deleted.

8 changes: 3 additions & 5 deletions eng/install-native-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,22 @@ set -e
# ./install-native-dependencies.sh <OS>

os="$(echo "$1" | tr "[:upper:]" "[:lower:]")"
scriptroot="$(dirname "$0")"

if [ -z "$os" ]; then
# shellcheck source-path=SCRIPTDIR
. "$(dirname "$0")"/common/native/init-os-and-arch.sh
fi

case "$os" in
linux)
if [ -e /etc/os-release ]; then
# shellcheck source=/dev/null
. /etc/os-release
fi

if [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; then
apt update

xargs apt-get install -y < "$scriptroot/debian-reqs.txt"
apt install -y build-essential gettext locales cmake llvm clang lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \
libssl-dev libkrb5-dev zlib1g-dev

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
elif [ "$ID" = "alpine" ]; then
Expand All @@ -44,7 +42,7 @@ case "$os" in
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
# Skip brew update for now, see https://github.com/actions/setup-python/issues/577
# brew update --preinstall
brew bundle --no-upgrade --no-lock --file "$scriptroot/Brewfile"
brew bundle --no-upgrade --no-lock --file "$(dirname "$0")/Brewfile"
;;

*)
Expand Down
3 changes: 0 additions & 3 deletions eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ check_prereqs()
# We try again with the PKG_CONFIG_PATH in place, if pkg-config still can't find OpenSSL, exit with an error, cmake won't find OpenSSL either
pkg-config openssl || { echo >&2 "Please install openssl before running this script, see https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/macos-requirements.md"; exit 1; }
fi
else
# Check presence of cmake on the path
command -v cmake 2>/dev/null || { echo >&2 "Please install cmake before running this script, see https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/linux-requirements.md"; exit 1; }
fi

if [[ "$__UseNinja" == 1 ]]; then
Expand Down
5 changes: 5 additions & 0 deletions eng/native/gen-buildsys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ if [[ "$host_arch" == "armel" ]]; then
cmake_extra_defines="$cmake_extra_defines -DARM_SOFTFP=1"
fi

if ! cmake_command=$(command -v cmake); then
echo "CMake was not found in PATH."
exit 1
fi

if [[ "$scan_build" == "ON" && -n "$SCAN_BUILD_COMMAND" ]]; then
cmake_command="$SCAN_BUILD_COMMAND $cmake_command"
fi
Expand Down

0 comments on commit f0ff6d6

Please sign in to comment.