-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
dotnet/sdk
#37407Labels
Description
Source build has a required scenario that involves building the VMR once to produce the .NET SDK. And then rebuilding the VMR again using the VMR that was just built. That scenario fails during the build of the runtime repo with the following error:
EXEC error message: An attempt was made to load a program with an incorrect format. [/repos/dotnet/src/runtime/artifacts/source-build/self/src/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj]
The full context of that MSBuild call is here:
Exec
Assembly = Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Parameters
Command = /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/bin/crossgen2_publish/x64/Release/fedora.38-x64/publish/crossgen2 /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/linux.x64.Release/IL/System.Private.CoreLib.dll --out /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/obj/Microsoft.NETCore.App.Crossgen2/Release/net9.0/fedora.38-x64/S.P.C.tmp
CommandLineArguments = /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/bin/crossgen2_publish/x64/Release/fedora.38-x64/publish/crossgen2 /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/linux.x64.Release/IL/System.Private.CoreLib.dll --out /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/obj/Microsoft.NETCore.App.Crossgen2/Release/net9.0/fedora.38-x64/S.P.C.tmp
Failed to load System.Private.CoreLib.dll (error code 0x8007000B)
Path: /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/bin/crossgen2_publish/x64/Release/fedora.38-x64/publish/System.Private.CoreLib.dll
Errors
EXEC error message: An attempt was made to load a program with an incorrect format. [/repos/dotnet/src/runtime/artifacts/source-build/self/src/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj]
/repos/dotnet/src/runtime/artifacts/source-build/self/src/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj(67,5): error MSB3073: The command "/repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/bin/crossgen2_publish/x64/Release/fedora.38-x64/publish/crossgen2 /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/linux.x64.Release/IL/System.Private.CoreLib.dll --out /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/obj/Microsoft.NETCore.App.Crossgen2/Release/net9.0/fedora.38-x64/S.P.C.tmp" exited with code 137. [/repos/dotnet/src/runtime/artifacts/source-build/self/src/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj]
(0x8007000B)
Failed to create CoreCLR, HRESULT: 0x8007000B
OutputProperties
CrossgenExitCode = 137
Note that the output mentions this path, which does not exist on disk: /repos/dotnet/src/runtime/artifacts/source-build/self/src/artifacts/bin/crossgen2_publish/x64/Release/fedora.38-x64/publish/System.Private.CoreLib.dll
This seems to be related to the changes in #92677. /cc @jkoritzinsky
This does require the changes in dotnet/installer#17929 in order to reach this point of the VMR build.
Repro Steps
- Check out the main branch of the VMR
- Manually apply the changes from Add runtime patch to use net9.0 TFM installer#17929 if they don't already exist.
git add .mkdir /repos/bootstrap./prep.sh./build.sh --clean-while-building --onlinecp artifacts/x64/Release/dotnet-sdk-*.tar.gz /repos/bootstrapcp artifacts/x64/Release/Private.SourceBuilt.*.tar.gz /repos/bootstrapgit clean -fdxgit checkout -- .mkdir .dotnettar -xzf /repos/bootstrap/dotnet-sdk-*.tar.gz -C .dotnet./prep.sh --no-artifacts --no-bootstrap --no-sdktar -xzf prereqs/packages/archive/Private.SourceBuilt.Prebuilts.*.tar.gz -C prereqs/packages/archivetar -xzf /repos/bootstrap/Private.SourceBuilt.Artifacts.*.tar.gz -C prereqs/packages/archive./build.sh --with-packages prereqs/packages/archive --with-sdk .dotnet --online