fsprojects / fsprojects/Paket

Restore during build with beta 8 on macOS is not stable

Open
#3,989 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

I don't know how to collect diagnostics for this yet, so bear with me :)

I observed this in two repos, but I'll link the one I maintain since I can make changes to it directly: https://github.com/fslaborg/xplot

Running the following will cause a system exception on my mac (latest macOS):

dotnet tool restore
dotnet paket restore
dotnet build

The first two succeed, but the second one fails and I get the dreaded system dialog on macOS saying dotnet has crashed. The only log that I get is this:

Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Paket version 6.0.0-beta8
  The last restore is still up to date. Nothing left to do.
  Total time taken: 0 milliseconds
  Paket version 6.0.0-beta8
  Starting restore process.
  Total time taken: 5 milliseconds
/usr/local/share/dotnet/sdk/5.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(195,5): error NETSDK1004: Assets file '/Users/phillip/repos/XPlot/src/XPlot.GoogleCharts/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/Users/phillip/repos/XPlot/src/XPlot.GoogleCharts/XPlot.GoogleCharts.fsproj]

There is one project in the repo that does not use paket, and it builds.

If I run the following (note that I shouldn't need to run install I think, since I have already installed dependencies):

dotnet paket install
dotnet build

Then I get the following large error:

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.BackEnd.NodeFailedToLaunchException: Could not load file or assembly 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. A device attached to the system is not functioning.
 (0x8007001F)
 ---> System.IO.FileLoadException: Could not load file or assembly 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. A device attached to the system is not functioning.
 (0x8007001F)
File name: 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Net.Sockets.SafeSocketHandle..ctor(IntPtr preexistingHandle, Boolean ownsHandle)
   at System.Diagnostics.Process.OpenStream(Int32 fd, FileAccess access)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   --- End of inner exception stack trace ---
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.GetNode(String msbuildLocation, String commandLineArgs, Int32 nodeId, INodePacketFactory factory, Handshake hostHandshake, NodeContextTerminateDelegate terminateNode)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNode(Int32 nodeId, INodePacketFactory factory, NodeConfiguration configuration)
   at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)
   at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)
   at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
   at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
   at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet)
   at Microsoft.Build.Execution.BuildManager.<>c__DisplayClass70_0.<Microsoft.Build.BackEnd.INodePacketHandler.PacketReceived>b__0()
   at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action)
--- End of stack trace from previous location ---
   at Microsoft.Build.Execution.BuildManager.EndBuild()
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.BackEnd.NodeFailedToLaunchException: Could not load file or assembly 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. A device attached to the system is not functioning.
 (0x8007001F)
 ---> System.IO.FileLoadException: Could not load file or assembly 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. A device attached to the system is not functioning.
 (0x8007001F)
File name: 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Net.Sockets.SafeSocketHandle..ctor(IntPtr preexistingHandle, Boolean ownsHandle)
   at System.Diagnostics.Process.OpenStream(Int32 fd, FileAccess access)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   --- End of inner exception stack trace ---
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Unhandled exception. Microsoft.Build.BackEnd.NodeFailedToLaunchException: Could not load file or assembly 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. A device attached to the system is not functioning.
 (0x8007001F)
 ---> System.IO.FileLoadException: Could not load file or assembly 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. A device attached to the system is not functioning.
 (0x8007001F)
File name: 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Net.Sockets.SafeSocketHandle..ctor(IntPtr preexistingHandle, Boolean ownsHandle)
   at System.Diagnostics.Process.OpenStream(Int32 fd, FileAccess access)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   --- End of inner exception stack trace ---
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)

But then if I run dotnet build again, it succeeds!

This dance between catastrophic errors and everything working fine seems to happen with some degree of frequency.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce this in the linked xplot repository with dotnet tool restore, dotnet paket restore, and dotnet build, then compare the failing and succeeding runs. Inspect src/XPlot.GoogleCharts/XPlot.GoogleCharts.fsproj, the missing obj/project.assets.json path, and the reported MSBuild node-launch errors; done means the Paket restore and build complete reliably without the macOS crash or intermittent failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp, macos
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.