fsprojects / IfSharp

F# for Jupyter Notebooks
Other
442 stars 71 forks source link

WIP Initial support for .NET Core #197

Closed cgravill closed 5 years ago

cgravill commented 5 years ago

Inspired by discussion on #185 I've tried to add a side-by-side .NET Core and .NET Framework projects. This lets us work on the .NET Core while keeping the existing one working.

cgravill commented 5 years ago

I think this is working correctly but Travis fails with: dpkg-deb: error: archive '/var/cache/apt/archives/aspnetcore-runtime-2.2_2.2.2-1_amd64.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up

I'm going to try splitting up the build to run different parts on different providers but it may take a while.

cgravill commented 5 years ago

I've tracked through the error. On Ubuntu and macOS it fails with:

/usr/share/dotnet/sdk/2.2.104/FSharp/Microsoft.FSharp.Targets(265,9): error MSB6003: The specified task executable "fsc.exe" could not be run. Permission denied [/home/vsts/work/1/s/src/IfSharp.Kernel/IfSharp.Kernel.fsproj]

I found that if I manually edit Paket's Paket.Restore.targets and comment out these parts:

<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
  <Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
  <PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
  <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
  <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
  <Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
  <AllowExplicitVersion>true</AllowExplicitVersion>
</PackageReference>

then it avoid the error. The error only occurs with a command-line dotnet call. The projects builds on Visual Studio for Mac.

Anyone with any clues on this one? I'll need to try to determine the root cause of this or a minimal reproduction.

cgravill commented 5 years ago

So after a lot of experiments with local and build agent I've concluded that mixing:

all at once has issues. Elsewhere I'll try to isolate an and report the actual problem.

The good news is that I've separated out the dependencies and this now builds for me locally on Windows and macOS. We also have the .NET Core builds going on Ubuntu and macOS agents. The original .NET Framework builds still work correctly on Travis.

I'll let this cool off for a little while but if anyone could give it a go that would be a really good validation. To set expectation the .NET Core version can only do very simple things, this is just a foundational bit of work.