Skip to content

Need help replicating the official build #85330

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

Closed
leocb opened this issue Apr 25, 2023 · 2 comments
Closed

Need help replicating the official build #85330

leocb opened this issue Apr 25, 2023 · 2 comments
Labels
question Answer questions and provide assistance, not an issue with source code or documentation.

Comments

@leocb
Copy link

leocb commented Apr 25, 2023

Hi, Due to my company's Safety & Distribution policies, I cannot simply use the pre-compiled runtimes from Microsoft, I have to compile my own version. So I'm looking for how I can replicate the official linux build; my goal is to have a redistributable package that is equivalent to what I'd download from Microsoft website.

I followed the docs on how to build the runtime, with some changes because I'm on Oracle Linux 9 (UEK, RHEL compatible), these are the steps:

dotnet runtime build instructions for Oracle Linux 9 (click to expand)

Clone .NET runtime Git repo

cd ~/git
git clone --recursive https://github.com/dotnet/runtime.git
cd runtime
git checkout v6.0.14

Build requirements for .NET Runtime

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

Build .NET Runtime

# Enables SHA1 on the OpenSSL library, building without this flag fails (!)
export OPENSSL_ENABLE_SHA1_SIGNATURES=1
# Build the runtime:
./build.sh -c release -lc release -rc release -a x64 -os linux -s clr+libs -v n

This builds successfully without any errors or warnings. Then I copy the contents from /artifacts/bin/testhost/net6.0-Linux-Release-x64/dotnet because that's the only folder that has the same structure as the pre-compiled download. However, when I try to run it later inside a docker container, my version throws an error that it could not find libc.dll, while the version from microsoft does not throw this error.

Also the file versions are all 42.42.42424 - which points to me that I'm missing some steps or parameters for the "correct" output.

bottom line is: how do I compile the runtime to be the same-ish as microsoft's redistributable?

Thanks!

@ghost ghost added needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners untriaged New issue has not been triaged by the area owner labels Apr 25, 2023
@huoyaoyuan
Copy link
Member

You can look for instructions at https://github.com/dotnet/source-build, which is used for certain Linux distros like Ubuntu and RHEL to build dotnet from source.

@leocb
Copy link
Author

leocb commented Apr 25, 2023

I didn't know about the existence of that repo, thank you, I'll take a look at it, seems like it solves a lot of issues I'm having. If I need anything else I'll reopen this issue

@leocb leocb closed this as completed Apr 25, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Apr 25, 2023
@teo-tsirpanis teo-tsirpanis added question Answer questions and provide assistance, not an issue with source code or documentation. and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 30, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Answer questions and provide assistance, not an issue with source code or documentation.
Projects
None yet
Development

No branches or pull requests

3 participants