Skip to content

Need help replicating the official build #85330

@leocb

Description

@leocb

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions