dotnet/buildtools

Can crossgen.sh be made to accept RID as argument?

Closed this issue · 3 comments

am11 commented

It seems like the calling script of https://github.com/dotnet/buildtools/blob/d9ae0d7/src/Microsoft.DotNet.Build.Tasks/PackageFiles/crossgen.sh is always aware of the RID under question. Yet this script once again try to resolve RID and does not provide all variants of supported RIDs.

When building CoreRT on Alpine Linux, where RID is linux-musl-x64, it throws lots of errors of the following form:

Unable to successfully compile /corert/Tools/csc.dll
Unable to successfully compile /corert/Tools/project.dll
Tools/crossgen.sh: line 56: /corert/Tools/../packages/runtime.linux-x64.microsoft.netcore.app/2.1.0-rc1/tools/crossgen: No such file or directory

Can RID be passed to crossgen.sh instead of (or in addition to) recalculating it from the call site?

am11 commented

@weshaggard, @janvorli, this is my steps to repro docker which results in the above error:

FROM alpine
RUN cat /etc/*-release

RUN apk update
RUN apk add --no-cache \
        autoconf bash build-base clang clang-dev \
        cmake curl-dev gcc gettext-dev git icu-dev libtool \
        linux-headers libunwind-dev llvm make openssl zlib-dev \
        util-linux-dev

# note that the testing URL will be changed once lldb-dev is moved to
# aports' (more prominent) "main" repo.
# See https://github.com/alpinelinux/aports/pull/2342#issuecomment-330894890
RUN apk add --no-cache \
       -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
        lldb-dev

RUN rm /usr/bin/c++ /usr/bin/g++   # quick hack to select clang++ instead of g++

RUN git clone https://github.com/dotnet/corert -b master --single-branch \
    && cd corert && ./build.sh

I'd be fine with crossgen.sh taking in a rid option or updating to logic to detect the rid better. @am11 are you interested in submitting a PR?

Fixed with #2051.