Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help building .NET6 on Oracle Linux 9 #3455

Closed
leocb opened this issue May 12, 2023 · 7 comments
Closed

Help building .NET6 on Oracle Linux 9 #3455

leocb opened this issue May 12, 2023 · 7 comments

Comments

@leocb
Copy link

leocb commented May 12, 2023

Context

The problem

Unrelated to this repo: I am able to compile the .NET runtime and ASP.NET repositories separately and gather the artifacts and deploy them, however when I try to execute the solution on a docker container I get an error with libc (see this issue: dotnet/runtime/issues/85330), If I use the official binaries, it works fine in the container, so my best guess is that I can't simply do that and have compile things properly.

The nice folks on that issue pointed me to this repo, which now I'm trying to build. But I still don't know if this is the correct repo since I actually only need the runtimes, not the whole SDK, but I digress.

I'm encountering problems with the build and don't know why (see below for logs). I'm currently trying to build with the commit/tag v6.0.408

note: As a sanity check I tried build this on Ubuntu 22 LTS and got the same errors. Am I missing something obvious here?

Please help me fix the errors I'm encountering during the build. This will quite possibly also mean that Oracle Linux gets an officially maintained version of .NET - since this will fall under the libraries we have to maintain up to date. - please note that I do NOT speak on behalf of the Oracle company and this is my sole opinion.

Build

Pre-requisites:

# Install the runtime dependencies
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y cmake llvm lld clang gcc gcc-c++ make python3 curl lldb openssl-devel libicu-devel openssl-devel lttng-ust numactl-devel krb5-server krb5-libs krb5-devel zlib-devel 
sudo dnf --enablerepo=ol9_codeready_builder install lttng-ust-devel

# Install the aspnet dependencies
sudo dnf config-manager --set-enabled ol9_appstream -y
sudo dnf install nodejs -y
sudo yum install -y npm java-17-openjdk numactl
sudo npm install -g yarn

These are the step I follow to build:

# Enables SHA1 on the OpenSSL library, building without this flag fails
export OPENSSL_ENABLE_SHA1_SIGNATURES=1

git clone https://github.com/dotnet/installer.git
cd installer/
git checkout v6.0.408
./build.sh /p:ArcadeBuildTarball=true /p:TarballDir=/home/lbottaro/dotnetsource

I get some errors in the beginning of this script (see logs) on Oracle Linux, but the amount of items in the folders matches with Ubuntu, so I guess it's ok? unless the file is there but empty.

Left: Oracle Linux 9, Right: Ubuntu 22
image

Then:

cd /home/lbottaro/dotnetsource
./prep.sh

# wait for prep to finish ...

./build.sh

#fails

build logs

installer.build.log
source.prep.log
source.build.log

@omajid
Copy link
Member

omajid commented May 16, 2023

Can someone please move this issue to the dotnet/source-build repo?

@omajid
Copy link
Member

omajid commented May 16, 2023

Hey @leocb !

Thanks for filing this issue.

I work at Oracle, due to some restrictions on the company's distribution an licensing policies, we can't use pre-built binaries and I have to compile the .NET runtime 6 by myself (with support for ASP.NET).

A similar restriction affects many other users (including packagers packaging .NET for Linux distributions such as Fedora, RHEL and Ubuntu), so you should be in good company!

when I try to execute the solution on a docker container I get an error with libc

More details on this would be nice. I suppose you are building on Oracle Linux 9 and then trying to run on a different (older) distro such as Oracle Linux 7? That's expected to not work. When you build .NET in a Linux distro, the glibc version of that distro (say, version $X) becomes the minimum runtime requirement. So when you take the .NET runtime and try to run it elsewhere, it needs a glibc version at $X or higher. This isn't .NET quirk, but more of a C design limitation in terms of how C compilers add a requirement onto glibc.

The nice folks on that issue pointed me to this repo, which now I'm trying to build. But I still don't know if this is the correct repo since I actually only need the runtimes, not the whole SDK, but I digress.

There's no current way to just build the runtime completely from source, so it's easier to build the entire SDK and pull the runtime bits out of it.

I'm currently trying to build with the commit/tag v6.0.408

This is the problem. If you are trying to build .NET 6, only the 6.0.100-series is supported. The latest version is https://github.com/dotnet/installer/releases/tag/v6.0.116, try that.

This will quite possibly also mean that Oracle Linux gets an officially maintained version of .NET

Isn't that already the case? AFAIK Oracle Linux rebuilds the sources of RHEL and RHEL already ships .NET (I am one of the maintainers for RHEL) . In fact, .NET 6 seems to be available for all of:

AFAIK, to install .NET 6 on Oracle 7, you need to run a command like yum install rh-dotnet60-dotnet. For 8 and 9, something like yum install dotnet-sdk-6.0 should do the trick.

cc @Mr-Tao who I thought was the .NET maintainer for Oracle Linux

@leocb
Copy link
Author

leocb commented May 16, 2023

Hi! Thanks for the all the great info!

In the case of libc, you're most correct! I did in fact build the runtime on OL9 and tried to execute in a OL7 container by accident, I'll try that again while building under the correct OL version.

I'll try building it from the v6.0.116 tag, maybe that's it! Just out of curiosity, what are the other tags for anyway if the 1xx are the only ones supported?

We just recently found out about the official builds (after this issue was created) - There's little documentation as to where to find those versions - still, I need to build my own runtime for the particular project I'm working on.

I'll try again tomorrow and get back to you, many thanks! 😊

@omajid
Copy link
Member

omajid commented May 17, 2023

Just out of curiosity, what are the other tags for anyway if the 1xx are the only ones supported?

They are supported for end-users. You can use the 6.0.400-series SDKs to build and run your applications. Those tags/releases are just not supported for build-the-.NET-SDK-itself-from-source scenario. (It's a question of manpower: maintaining it is quite a bit of effort and there's not enough demand for it).

There's little documentation as to where to find those versions

Should we augment https://learn.microsoft.com/en-us/dotnet/core/install/linux-rhel to include RHEL rebuilds?

@Mr-Tao
Copy link

Mr-Tao commented May 17, 2023

A pull request dotnet/runtime#81115 for dotnet build support on Oracle Linux has been open for some time. Do you think that there’s anything I can do to make it merged?

@marcpopMSFT
Copy link
Member

@MichaelSimons I believe this should be moved to the source-build repo but I don't appear to have permissions.

@MichaelSimons MichaelSimons transferred this issue from dotnet/installer May 17, 2023
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet dotnet locked and limited conversation to collaborators May 17, 2023
@MichaelSimons MichaelSimons converted this issue into discussion #3456 May 17, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

4 participants