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

Unable to find resolved path for 'coreclr' #314

Open
NicolasDorier opened this Issue May 8, 2018 · 4 comments

Comments

Projects
None yet
5 participants
@NicolasDorier

NicolasDorier commented May 8, 2018

Description

NBxplorer is a netcoreapp2.1 referencing NBXplorer.Client, a library in the same project targetting netcoreapp2.1.

Compiling NBXplorer with ILLink gives Unable to find resolved path for 'coreclr' error.

Note: If NBXplorer.Client is targetting netstandard2.0, it does not work either. If I target netstandard2.0 I get NBXplorer.Client depends on Microsoft.AspNetCore.App (>= 2.1.0-rc1) but Microsoft.AspNetCore.App 2.1.0-rc1 was not found.

Despite the fact NBXplorer.Client does not depend on it.

Repro

git clone https://github.com/dgarage/NBXplorer
cd NBXplorer
git checkout smalldocker
docker build -t nicolasdorier/nbxplorer .

For convenience, here is the dockerfile

FROM microsoft/dotnet:2.1.300-rc1-sdk-alpine3.7 AS builder
WORKDIR /source
COPY NBXplorer/NBXplorer.csproj NBXplorer/NBXplorer.csproj
# Cache some dependencies
RUN cd NBXplorer && dotnet restore && cd ..
COPY . .
RUN cd NBXplorer && \
    dotnet add package ILLink.Tasks --version 0.1.5-preview-1461378 --source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json && \
    dotnet publish --output /app/ --configuration Release -r linux-musl-x64

FROM microsoft/dotnet:2.1.0-rc1-runtime-deps-alpine3.7
WORKDIR /app

RUN mkdir /datadir
ENV NBXPLORER_DATADIR=/datadir
VOLUME /datadir

COPY --from=builder "/app" .
ENTRYPOINT ["./NBXplorer"]

Building without ILLink works fine.

@marek-safar

This comment has been minimized.

Member

marek-safar commented May 10, 2018

/cc @sbomer

@msvaillant

This comment has been minimized.

msvaillant commented Jun 8, 2018

I have the same issue. And the most strange thing - it worked for me with preview of dotnet core 2.1, but fails after release

it looks like some reference to coreclr got broken for ILLink after release

@shanselman

This comment has been minimized.

shanselman commented Aug 29, 2018

Hitting this as well. Repro at https://github.com/shanselman/superzeit Just git clone and docker build.

@sbomer

This comment has been minimized.

Collaborator

sbomer commented Aug 29, 2018

The full error is:

/usr/share/dotnet/sdk/2.1.401/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(48,5): error NETSDK1016: Unable to find resolved path for 'coreclr'.

There seems to be an issue finding crossgen dependencies in some cases with new SDKs. I'm hoping we'll be able to fix this when/if we add proper crossgen support outside of the linker: dotnet/cli#1437.

Workaround
In the meantime, you can work around this by setting the property CrossGenDuringPublish to false. The option is documented here if you want to know more: https://github.com/mono/linker/blob/master/corebuild/README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment