Skip to content

runtime depends on extremely recent verisons of cmake, blocking adoption on Linux #38755

@omajid

Description

@omajid

Description

In order to help make .NET ubiquitous, I am working on packaging and including .NET (Core) into as many Linux distributions as I can. Some of these Linux distributions are included in the official support matrix of .NET:

https://github.com/dotnet/core/blob/master/release-notes/5.0/5.0-supported-os.md

May of the Linux distributions listed in the matrix above include much older versions of cmake than what dotnet/runtime requires to build. For example:

Because of this, it becomes almost impossible to build or package .NET in those distributions :( That prevents us from easily including the upcoming .NET 5 in these distributions.

To work around this, we would have to revert a long series of non-trivial commits: like dotnet/coreclr#26980

If it matters, for packaging on Linux, we are consuming dotnet/runtime indirectly via dotnet/source-build.

Configuration

Here's a dockerfile that reproduces the problem:

FROM docker.io/centos:8

RUN dnf install --setopt tsflags=nodocs --refresh -y \
        dnf-plugins-core &&  \
    dnf config-manager --set-enabled PowerTools  && \
    dnf install --setopt tsflags=nodocs --refresh -y \
        automake \
        clang \
        cmake \
        curl-devel \
        findutils \
        git \
        glibc-langpack-en \
        hostname \
        krb5-devel \
        libicu-devel \
        libtool \
        lldb-devel \
        llvm \
        lttng-ust-devel \
        make \
        openssl-devel \
        python3 \
        tar \
        wget \
        which \
        zlib-devel && \
    dnf upgrade -y && \
    dnf clean all -y

CMD git clone https://github.com/dotnet/runtime && \
        cd runtime && \
        git submodule update --init --recursive && \
        ./build.sh clr
$ podman build -t d -f Dockerfile .
$ podman run -it d
Cloning into 'runtime'...                                                                                                                                                                                                                     
remote: Enumerating objects: 32, done.                                                                                                                                                                                                        
...
  Setting up directories for build                                                                                                                                                                                                            
  Checking prerequisites...                                                                                                                                                                                                                   
  Please install cmake v3.14.5 or newer from https://www.cmake.org/download/.                                                                                                                                                                 
/runtime/src/coreclr/runtime.proj(32,5): error MSB3073: The command ""/runtime/src/coreclr/build-runtime.sh" -x64 -debug -os Linux" exited with code 1.
....
    0 Warning(s)
    13 Error(s)

Time Elapsed 00:03:53.27
Build failed (exit code '1').

Regression?

This is a build-time regression.

The situation was not so bad in the 3.1 timeframe where the minimum version required was much lower.

The situation seems to have gotten much worse with .NET 5: RHEL 8, Debian 9 and Ubuntu 18.04 all have incompatible versions of cmake.

Other information

  • Do you know of any workarounds?

One possible option would be to upgrade or package up alternate versions of cmake in those Linux distributions. That becomes more challenging the older the Linux distribution we are looking at is. It's harder both technically (compatibility impact, more recent versions of cmake require a more recent version of other dependencies) and process-wise (how do you convince others that adding new packages to a X year old distribution is a good idea now?)

Some distributions, like RHEL 7 use "alternate" packaging mechanisms (such as software collections) that allow using a custom cmake for building .NET 5, but have a significant usability impact for the end-user.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions