Build/Test Issues

Grid node can't build with RuntimeIdentifier specified

Started by davetorutek on 2,704 views

As of the latest ncrunch we get failure to build projects on the grid node if their csproj contains:

    <PublishSingleFile>true</PublishSingleFile>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <PublishReadyToRun>true</PublishReadyToRun>


If we remove the runtime identifier it builds.

You can reproduce this by creating a new xunit test project in VS2022 and copying those lines in to the first <PropertyGroup> in the csproj.

Logs from ncrunch:

NCrunch: The build results for this project are not consistent across all computers within the grid.

This project was successfully built on computers: (local)
This project failed to build on computers: NCRUNCHER1

Associated tests will continue to run on computers that are able to build this project successfully. Please ensure all computers within the grid are configured correctly with all required SDKs installed.

****************** BUILD OUTPUT FROM '(local)' ******************


****************** BUILD OUTPUT FROM 'NCRUNCHER1' ******************

..\..\..\..\..\WINDOWS\system32\Program Files\dotnet\sdk\8.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets (491, 5): The runtime pack for Microsoft.NETCore.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'.

NCrunch: The following files were used when building this project locally but do not seem to exist on the remote grid node responsible for building this project:
c:\program files\microsoft visual studio\2022\professional\MSBuild\Current\Microsoft.Common.props
... lots more ...


Often this can be caused by configuration differences between your client machine and the grid node, in which case the installed SDK directories may be different between machines. If you are experiencing consistent problems when building this project on the grid node, the missing files listed above are worth investigating as they may highlight SDKs required on the grid node that have not yet been installed. Please note that this is not necessarily an error case as projects very often build successfully on grid nodes with only a subset of the client machine's installed SDKs.


Thanks!
Thanks for sharing this issue.

Just looking at the log - can you confirm whether this issue happens only when you use distributed processing? (i.e. is everything fine if you don't connect to your nodes?)
Yep, works fine locally, only issues on grid nodes.
Ok, I have some theories about this issue.

My first theory is that the grid node is missing a package that exists on the client machine. NCrunch generally transfers packages over from the client to the node, but the installation paths and manner of certain system-level packages can be quite varied between versions of .NET, so its quite possible this system doesn't handle some of the built-in ones. Something worth trying is to manually copy the project over to the grid node, then perform a package restore on it from there. This will cause the node to download the required packages and make sure they are installed.

My second theory is an SDK inconsistency between the client and the node. Check to make sure you have the same versions of the .NET SDK installed between your client and node. The older versions shouldn't matter much, but the newest version does. If the node is running a different build of .NET 8 to your client, this can cause problems.

My third theory is that the MSBuild SDK change we introduced in 4.19 has triggered an issue between your client and node, such that the node is running a whole different version of MSBuild to your client machine. This can be resolved by setting your Build Sdk NCrunch project-level config setting to a value that is sensible for your environment. Note that the chosen SDK must be present on both machines with the exact same version.
2 - VS 2022 is installed on both my machine and the grid node and they are both up to date.

3 - I've tried setting this to 8.0.101 or VS2022, same issue remains.

1 - I tried this last, I copied the project (Test project with the csproj changes made as in my opening post) to the grid node and ran dotnet restore, this has resolved the issue.

Post a reply

Log in to reply.