Skip to content
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

Closed
NicolasDorier opened this issue May 8, 2018 · 5 comments
Closed

Unable to find resolved path for 'coreclr' #314

NicolasDorier opened this issue May 8, 2018 · 5 comments

Comments

@NicolasDorier
Copy link

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
Copy link
Contributor

/cc @sbomer

@msvaillant
Copy link

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
Copy link

shanselman commented Aug 29, 2018

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

@sbomer
Copy link
Member

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: https://github.com/dotnet/cli/issues/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.

@marek-safar
Copy link
Contributor

Proper cross-gen support was added in dotnet/cli (closing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants