dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.87k stars 781 forks source link

F# 5.0.100 sdk broken for Linux Arm32 build #10454

Closed eiriktsarpalis closed 3 years ago

eiriktsarpalis commented 3 years ago

Seen when attempting to install .NET 5 on my raspberry pi.

Repro steps

  1. Download & extract the Linux Arm32 sdk v5.0.100.
  2. Create and build a new F# project: dotnet new console --language F# && dotnet build

Expected behavior

Should compile without issue.

Actual behavior

Errors with the following message:

FSC : error FS0229: Error opening binary file '/home/eirik/.nuget/packages/fsharp.core/5.0.0/lib/netstandard2.0/FSharp.Core.dll': Error reading/writing metadata for the F# compiled DLL '/home/eirik/.nuget/packages/fsharp.core/5.0.0/lib/netstandard2.0/FSharp.Core.dll'. Was the DLL compiled with an earlier version of the F# compiler? (error: 'lookup_uniq in table istrings out of range, n = 16548, sizeof(tab) = 4565'). [/home/eirik/devel/test/test.fsproj]
FSC : error FS3160: Problem reading assembly '/home/eirik/.nuget/packages/fsharp.core/5.0.0/lib/netstandard2.0/FSharp.Core.dll': The exception has been reported. This internal exception should now be caught at an error recovery point on the stack. Original message: Error opening binary file '/home/eirik/.nuget/packages/fsharp.core/5.0.0/lib/netstandard2.0/FSharp.Core.dll': Error reading/writing metadata for the F# compiled DLL '/home/eirik/.nuget/packages/fsharp.core/5.0.0/lib/netstandard2.0/FSharp.Core.dll'. Was the DLL compiled with an earlier version of the F# compiler? (error: 'lookup_uniq in table istrings out of range, n = 16548, sizeof(tab) = 4565').) [/home/eirik/devel/test/test.fsproj]
error FS0073 : internal error : BuildFrameworkTcImports: no successful import of /home/eirik/.nuget/packages/fsharp.core/5.0.0/lib/netstandard2.0/FSharp.Core.dll [/home/eirik/devel/test/test.fsproj]

I get the same error when I try to run dotnet fsi.

Known workarounds

None known.

Related information

KevinRansom commented 3 years ago

I've ordered a pi, I will take a look tomorrow when I pick it up. If I can figure out how to work it :-)

cartermp commented 3 years ago

Make sure to get some marionberry pie with it too, they're really good this time of year.

KevinRansom commented 3 years ago

@cartermp , I doubt this is actually us, it's more like a Jit thing I expect, however ... we will need to prove it first.

KevinRansom commented 3 years ago

Okay ...

I ordered my Raspberry pi from Amazon and conveniently I picked it up from WholeFoods, along with @cartermp 's recommended marionberry pie, which went down great with a cup of Tea.

I was able to repro this easily. Basically FSharp.Core assembly loading and reading doesn't work. I suspect the runtime given that FSharp.Core runtime loading is sort of a minimum bar for us but I will be in a position to start looking at this seriously tomorrow. I suppose we also need to figure out how ci arm emulation, I guess the runtime can point us towards that.

/cc @brettfo

eiriktsarpalis commented 3 years ago

FWIW the issue does not reproduce with the arm64 build.

KevinRansom commented 3 years ago

This is a bug on arm32, here is the issue on the runtime repo: https://github.com/dotnet/runtime/issues/45250