dotnet / netcorecli-fsc

[DEPRECATED] F# and .NET Core SDK working together

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build when referencing 'FSharp.Data' in Arch Linux

mniak opened this issue · comments

commented

How to reproduce:

Prepare

 dotnet new console -lang F#
 dotnet add package FSharp.Data -v 3.0.0

Command that causes the problem

dotnet build

Expected behavior

Build successfully

What happens

Microsoft (R) Build Engine version 15.8.169.62826 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for /home/andre/Documents/Projects/MyProject/MyProject.fsproj...
  Restore completed in 201.84 ms for /home/andre/Documents/Projects/MyProject/MyProject.fsproj.
error FS3031 : The type provider '/home/andre/.nuget/packages/fsharp.data/3.0.0/lib/netstandard2.0/FSharp.Data.dll' reported an error : Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer assembly 'FSharp.Data.DesignTime' which cannot be loaded or doesn't exist. Could not load file or assembly 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. [/home/andre/Documents/Projects/MyProject/MyProject.fsproj]
FSC : warning FS3005: Referenced assembly '/home/andre/.nuget/packages/fsharp.data/3.0.0/lib/netstandard2.0/FSharp.Data.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found [/home/andre/Documents/Projects/MyProject/MyProject.fsproj]

Build FAILED.

FSC : warning FS3005: Referenced assembly '/home/andre/.nuget/packages/fsharp.data/3.0.0/lib/netstandard2.0/FSharp.Data.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found [/home/andre/Documents/Projects/MyProject/MyProject.fsproj]
error FS3031 : The type provider '/home/andre/.nuget/packages/fsharp.data/3.0.0/lib/netstandard2.0/FSharp.Data.dll' reported an error : Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer assembly 'FSharp.Data.DesignTime' which cannot be loaded or doesn't exist. Could not load file or assembly 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. [/home/andre/Documents/Projects/MyProject/MyProject.fsproj]
    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.68

Environment

$ uname -a
Linux AndreBook 4.18.9-arch1-1-ARCH #1 SMP PREEMPT Wed Sep 19 21:19:17 UTC 2018 x86_64 GNU/Linux

$ dotnet --list-sdks
2.1.403 [/opt/dotnet/sdk]

$ dotnet --list-runtimes
Microsoft.NETCore.App 2.1.5 [/opt/dotnet/shared/Microsoft.NETCore.App]

Additional comments

I've found some related issues in dotnet/cli#3776 and netcorecli-fsc/#16, both created by @svick. It seems it should be working by now.

Yes this should be working and is under CI test in the FSharp.Data repository. Very odd

I checked and it is working on Windows with this:

C:\misc\t> dotnet new console -lang F#

Welcome to .NET Core!
---------------------
Learn more about .NET Core: https://aka.ms/dotnet-docs
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs

Telemetry
---------
The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). For establishing trust on other platforms refer to the platform specific documentation.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
Getting ready...
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on C:\misc\t\t.fsproj...
  Restoring packages for C:\misc\t\t.fsproj...
  Generating MSBuild file C:\misc\t\obj\t.fsproj.nuget.g.props.
  Generating MSBuild file C:\misc\t\obj\t.fsproj.nuget.g.targets.
  Restore completed in 296.18 ms for C:\misc\t\t.fsproj.

Restore succeeded.

C:\misc\t> dotnet add package FSharp.Data -v 3.0.0
  Writing C:\Users\dsyme\AppData\Local\Temp\tmpC732.tmp
info : Adding PackageReference for package 'FSharp.Data' into project 'C:\misc\t\t.fsproj'.
log  : Restoring packages for C:\misc\t\t.fsproj...
info :   GET https://www.myget.org/F/oxyplot/FindPackagesById()?id='FSharp.Data'&semVerLevel=2.0.0
info :   GET https://api.nuget.org/v3-flatcontainer/fsharp.data/index.json
info :   OK https://www.myget.org/F/oxyplot/FindPackagesById()?id='FSharp.Data'&semVerLevel=2.0.0 550ms
info :   OK https://api.nuget.org/v3-flatcontainer/fsharp.data/index.json 450ms
info :   GET https://api.nuget.org/v3-flatcontainer/fsharp.data/3.0.0/fsharp.data.3.0.0.nupkg
info :   OK https://api.nuget.org/v3-flatcontainer/fsharp.data/3.0.0/fsharp.data.3.0.0.nupkg 204ms
log  : Installing FSharp.Data 3.0.0.
info : Package 'FSharp.Data' is compatible with all the specified frameworks in project 'C:\misc\t\t.fsproj'.
info : PackageReference for package 'FSharp.Data' version '3.0.0' added to file 'C:\misc\t\t.fsproj'.

C:\misc\t>dotnet build
Microsoft (R) Build Engine version 15.8.169+g1ccb72aefa for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for C:\misc\t\t.fsproj...
  Restore completed in 162.78 ms for C:\misc\t\t.fsproj.
  t -> C:\misc\t\bin\Debug\netcoreapp2.1\t.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:08.63

C:\misc\t>dotnet --version
2.1.403

C:\misc\t>dotnet --list-sdks
1.0.4 [C:\Program Files\dotnet\sdk]
1.1.0 [C:\Program Files\dotnet\sdk]
2.0.0-preview2-006470 [C:\Program Files\dotnet\sdk]
2.0.0-preview2-006497 [C:\Program Files\dotnet\sdk]
2.0.0 [C:\Program Files\dotnet\sdk]
2.0.2 [C:\Program Files\dotnet\sdk]
2.1.2 [C:\Program Files\dotnet\sdk]
2.1.4 [C:\Program Files\dotnet\sdk]
2.1.100-preview-007363 [C:\Program Files\dotnet\sdk]
2.1.100 [C:\Program Files\dotnet\sdk]
2.1.102 [C:\Program Files\dotnet\sdk]
2.1.103 [C:\Program Files\dotnet\sdk]
2.1.104 [C:\Program Files\dotnet\sdk]
2.1.200 [C:\Program Files\dotnet\sdk]
2.1.201 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.401 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]

C:\misc\t>dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.0-preview2-25407-01 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3-servicing-26724-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Just to say I don't repro this on Ubuntu 16.04 running on Bash Ubuntu for Windows

Will try on another linux distribution

Hmmm I tested this on an Azure Linux VM and it worked there too

dsyme@donlinux2:~/test$ uname -a
Linux donlinux2 4.15.0-1023-azure #24-Ubuntu SMP Tue Aug 28 17:35:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
dsyme@donlinux2:~/test$ dotnet --list-sdks
2.1.403 [/usr/share/dotnet/sdk]
dsyme@donlinux2:~/test$ dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
dsyme@donlinux2:~/test$

I'm not sure what to do to repro this. More complete log below

dsyme@donlinux2:~$ mkdir test
dsyme@donlinux2:~$ cd test
dsyme@donlinux2:~/test$  dotnet new console -lang F#

Welcome to .NET Core!
---------------------
Learn more about .NET Core: https://aka.ms/dotnet-docs
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs

Telemetry
---------
The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). For establishing trust on other platforms refer to the platform specific documentation.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
Getting ready...
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /home/dsyme/test/test.fsproj...
  Restoring packages for /home/dsyme/test/test.fsproj...
  Installing FSharp.Core 4.5.2.
  Generating MSBuild file /home/dsyme/test/obj/test.fsproj.nuget.g.props.
  Generating MSBuild file /home/dsyme/test/obj/test.fsproj.nuget.g.targets.
  Restore completed in 1.21 sec for /home/dsyme/test/test.fsproj.

Restore succeeded.

dsyme@donlinux2:~/test$  dotnet add package FSharp.Data -v 3.0.0
  Writing /tmp/tmpjW1RXu.tmp
info : Adding PackageReference for package 'FSharp.Data' into project '/home/dsyme/test/test.fsproj'.
log  : Restoring packages for /home/dsyme/test/test.fsproj...
info :   GET https://api.nuget.org/v3-flatcontainer/fsharp.data/index.json
info :   OK https://api.nuget.org/v3-flatcontainer/fsharp.data/index.json 443ms
info :   GET https://api.nuget.org/v3-flatcontainer/fsharp.data/3.0.0/fsharp.data.3.0.0.nupkg
info :   OK https://api.nuget.org/v3-flatcontainer/fsharp.data/3.0.0/fsharp.data.3.0.0.nupkg 110ms
log  : Installing FSharp.Data 3.0.0.
info : Package 'FSharp.Data' is compatible with all the specified frameworks in project '/home/dsyme/test/test.fsproj'.
info : PackageReference for package 'FSharp.Data' version '3.0.0' added to file '/home/dsyme/test/test.fsproj'.
dsyme@donlinux2:~/test$ dotnet build
Microsoft (R) Build Engine version 15.8.169+g1ccb72aefa for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for /home/dsyme/test/test.fsproj...
  Restore completed in 176.15 ms for /home/dsyme/test/test.fsproj.
  test -> /home/dsyme/test/bin/Debug/netcoreapp2.1/test.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)
commented

I will try to find steps that are more reproducible

I can reproduce this on Arch Linux. And in fsprojects/FSharp.Data#1220 there is another Arch user affected by it. It looks like the issue appears on Arch Linux only, therefore I opened a bug report there.

I can also reproduce this issue on Arch Linux. If anyone finds a workaround I'm listening. :)