dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.23k stars 4.45k forks source link

Add more complete linux build instructions #101631

Open agocke opened 2 weeks ago

agocke commented 2 weeks ago

I'm trying to make it slightly easier to install the needed requirements, and add some validation if a user hasn't installed the requirements.

Also, I validated that these instructions still work for Ubuntu 24.04 and have noted that other installs are only community-supported.

am11 commented 2 weeks ago

I'm using eng/install-native-dependencies.sh in Debian/Ubuntu, Alpine and macOS. It works well. Do we need another mechanism; another list to maintain?

dotnet-policy-service[bot] commented 2 weeks ago

Tagging subscribers to this area: @dotnet/runtime-infrastructure See info in area-owners.md if you want to be subscribed.

agocke commented 2 weeks ago

I'm using eng/install-native-dependencies.sh in Debian/Ubuntu, Alpine and macOS. It works well. Do we need another mechanism; another list to maintain?

I didn't know about that entry point. I'm happy to integrate with that.

am11 commented 2 weeks ago

I'm happy to integrate with that.

I think it would be good to just point to the (self-documenting) helper script. On fresh machine (baremetal, cloud VM, CI, container) it installs the prereqs in a few second enough to build all default subsets.

# replace 'ubuntu' with 'alpine' without changing the steps
$ docker run --rm -v$(pwd):/runtime -w /runtime --platform linux/arm64/v8 ubuntu sh -c '
    eng/install-native-dependencies.sh;
    ./build.sh -c Release'
agocke commented 2 weeks ago

I think it would be good to just point to the (self-documenting) helper script

I'm fine with this but the lists are currently inconsistent.

Our docs:

build-essential
clang
cmake
curl
git
libicu-dev
libkrb5-dev
liblttng-ust-dev
libssl-dev
lld
lldb
llvm
ninja-build
python-is-python3
zlib1g-dev

Script

build-essential
clang
cmake
gettext
libicu-dev
libkrb5-dev
liblldb-dev
liblttng-ust-dev
libssl-dev
libunwind8-dev
lldb
llvm
locales
zlib1g-dev

Diff:

build-essential
clang
cmake
-curl
-git
+gettext
libicu-dev
libkrb5-dev
+liblldb-dev
liblttng-ust-dev
libssl-dev
-lld
+libunwind8-dev
lldb
llvm
-ninja-build
-python-is-python3
+locales
zlib1g-dev

Thoughts? I personally think ninja-build should be in there even if it's not strictly necessary.

am11 commented 2 weeks ago

Yup, agreed.

agocke commented 1 week ago

OK, I took the most conservative approach of just taking the union, since I'm not sure what's actually necessary.

Also, docs have been updated to point to the shell script.