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

adding RuntimeIdentifiers to the fsproj breaks the build #2964

Open
coolya opened this Issue Jan 5, 2018 · 14 comments

Comments

Projects
None yet
7 participants
@coolya

coolya commented Jan 5, 2018

Description

I came across some really strange behaviour when using paket and dotnet core together with RuntimeIdentifiers.

Repro steps

Please provide the steps required to reproduce the problem

  1. Create a new hello world fsproj

  2. add a RuntimeIdentifiers section to the file:

    <RuntimeIdentifiers>ubuntu.16.04-arm;ubuntu.14.04-arm</RuntimeIdentifiers>

  1. run paket install

  2. run dotnet build

Expected behavior

build is successful.

Actual behavior

build fails with error message:

/Users/kdummann/source/rubecula/frontend/backend/backend.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-arm'.
/Users/kdummann/source/rubecula/frontend/backend/backend.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetHostPolicy (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-arm'.
/Users/kdummann/source/rubecula/frontend/backend/backend.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetHostResolver (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-arm'.
/Users/kdummann/source/rubecula/frontend/backend/backend.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetAppHost (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-arm'.
/Users/kdummann/source/rubecula/frontend/backend/backend.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-arm'.
/Users/kdummann/source/rubecula/frontend/backend/backend.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetHostPolicy (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-arm'.
/Users/kdummann/source/rubecula/frontend/backend/backend.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetHostResolver (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-arm'.
/Users/kdummann/source/rubecula/frontend/backend/backend.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetAppHost (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-arm'.

The behaviour is not arm specific it also happens for x64 and x86.

Known workarounds

do not use paket to do nuget handling. Simply removing the restore targets file from the fsproj file is enough. Run dotnet restore or dotnet build. Then add the paket restore targets again and everything works. This seems to fix it for the whole machine. The problem is more in CI where we run each build in a new container and as a workaround have to run dotnet restore in a dummy project to get the code building.

@forki

This comment has been minimized.

Member

forki commented Jan 5, 2018

@matthid

This comment has been minimized.

Member

matthid commented Jan 5, 2018

Can you just for fun try with setting the environment variable PAKET_DISABLE_RUNTIME_RESOLUTION to false? I guess (I have honestly no idea) this is because of those magic runtime dependencies, because: We don't know about them by default + We prevent NuGet to download stuff (ie everything going to the internet is done by paket).

@coolya

This comment has been minimized.

coolya commented Jan 6, 2018

I tried it but seems to have no effect:

root@6e8f0348d91b:/build# export PAKET_DISABLE_RUNTIME_RESOLUTION=false
root@6e8f0348d91b:/build# echo $PAKET_DISABLE_RUNTIME_RESOLUTION
false
root@6e8f0348d91b:/build# dotnet build
Microsoft (R) Build Engine version 15.5.179.9764 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

perl : warning : Setting locale failed. [/build/fsharp.fsproj]
perl : warning : Please check that your locale settings: [/build/fsharp.fsproj]
  	LANGUAGE = (unset),
  	LC_ALL = "en_US.UTF-8",
  	LANG = "en_US.UTF-8"
      are supported and installed on your system.
perl : warning : Falling back to the standard locale ("C"). [/build/fsharp.fsproj]
  adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
perl : warning : Setting locale failed. [/build/fsharp.fsproj]
perl : warning : Please check that your locale settings: [/build/fsharp.fsproj]
  	LANGUAGE = (unset),
  	LC_ALL = "en_US.UTF-8",
  	LANG = "en_US.UTF-8"
      are supported and installed on your system.
perl : warning : Falling back to the standard locale ("C"). [/build/fsharp.fsproj]
  adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
perl : warning : Setting locale failed. [/build/fsharp.fsproj]
perl : warning : Please check that your locale settings: [/build/fsharp.fsproj]
  	LANGUAGE = (unset),
  	LC_ALL = "en_US.UTF-8",
  	LANG = "en_US.UTF-8"
      are supported and installed on your system.
perl : warning : Falling back to the standard locale ("C"). [/build/fsharp.fsproj]
  adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
perl : warning : Setting locale failed. [/build/fsharp.fsproj]
perl : warning : Please check that your locale settings: [/build/fsharp.fsproj]
  	LANGUAGE = (unset),
  	LC_ALL = "en_US.UTF-8",
  	LANG = "en_US.UTF-8"
      are supported and installed on your system.
perl : warning : Falling back to the standard locale ("C"). [/build/fsharp.fsproj]
  adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
  Restoring packages for /build/fsharp.fsproj...
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-arm'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetHostPolicy (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-arm'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetHostResolver (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-arm'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetAppHost (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-arm'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-x64.Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-x64'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-x64.Microsoft.NETCore.DotNetHostPolicy (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-x64'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-x64'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-x64.Microsoft.NETCore.DotNetAppHost (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.14.04-x64'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-arm'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetHostPolicy (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-arm'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetHostResolver (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-arm'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-arm.Microsoft.NETCore.DotNetAppHost (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-arm'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-x64.Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-x64'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-x64.Microsoft.NETCore.DotNetHostPolicy (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-x64'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-x64'.
/build/fsharp.fsproj : error NU1100: Unable to resolve 'runtime.linux-x64.Microsoft.NETCore.DotNetAppHost (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/ubuntu.16.04-x64'.
  Restore failed in 153.31 ms for /build/fsharp.fsproj.

@forki

This comment has been minimized.

Member

forki commented Jan 11, 2018

do you have a minimal repro?

@coolya

This comment has been minimized.

coolya commented Jan 11, 2018

will create sample on the weekend, this week is quite busy.

@EelcoMulder

This comment has been minimized.

EelcoMulder commented Jan 13, 2018

I have the same issue, only not local but building on VSTS, so I can provide a build log if you want. It does download some runtime files but fails on the same files mentioned above but for win-x64.

2018-01-12T09:05:17.5158152Z d:\a\1\s\Wotzj.Api\Wotzj.Api.fsproj : error NU1100: Unable to resolve 'runtime.win-x64.Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/win-x64'. 2018-01-12T09:05:17.5159868Z d:\a\1\s\Wotzj.Api\Wotzj.Api.fsproj : error NU1100: Unable to resolve 'runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/win-x64'. 2018-01-12T09:05:17.5160835Z d:\a\1\s\Wotzj.Api\Wotzj.Api.fsproj : error NU1100: Unable to resolve 'runtime.win-x64.Microsoft.NETCore.DotNetHostResolver (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/win-x64'. 2018-01-12T09:05:17.5162812Z d:\a\1\s\Wotzj.Api\Wotzj.Api.fsproj : error NU1100: Unable to resolve 'runtime.win-x64.Microsoft.NETCore.DotNetAppHost (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/win-x64'.

@coolya

This comment has been minimized.

coolya commented Jan 13, 2018

I have create a repo to reproduce. I also added a workaround to the readme file:

https://github.com/coolya/paket-problem

@coolya

This comment has been minimized.

coolya commented Jan 14, 2018

I investigated a bit more and it seems that it works with sdk 2.0.0 but fails with the latest SDK.

@forki

This comment has been minimized.

Member

forki commented Jan 14, 2018

@cartermp

This comment has been minimized.

cartermp commented Jan 14, 2018

Do you see this same issue with no paket as well?

@coolya

This comment has been minimized.

coolya commented Jan 14, 2018

Nope, then it works fine. It also works once a projects that doesn't use paket has done a dotnet restore. There must be some machine wide cache or something where it looks up these runtime dependencies.

@granttrevor

This comment has been minimized.

granttrevor commented Jan 18, 2018

Just struck and thankfully found this Issue log using paket with in a csproj.

dotnet restore was throwing errors like:

error NU1100: Unable to resolve 'runtime.linux-x64.Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0/linux-x64'

Removing the paket target, restoring and then adding the paket target back in has gotten past it for now.

@forki

This comment has been minimized.

Member

forki commented Jan 18, 2018

I added a workaround in the Paket.Restore.targets file until we have a proper solution. Please retry with that

@matthid

This comment has been minimized.

Member

matthid commented Jan 27, 2018

Yes I see this as well in Fake after updating .net SDK and the sln file (which visual studio did automatically) https://travis-ci.org/fsharp/FAKE/builds/334104618?utm_source=github_status&utm_medium=notification

So in particular after fsharp/FAKE@56c07fc and fsharp/FAKE@080e274

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