question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[release/7.0.2xx] Runtime fails to generate native System.Private.CoreLib in source-build bootstrap

See original GitHub issue

I have been looking at this issue for a little bit and can’t seem to make any progress, so I’m hoping someone here can point me in the right direction.

The runtime-portable build is failing in the 7.0.2xx source build bootstrap scenario only with the following error:

      Generating native image of System.Private.CoreLib for Linux.x64.Release. Logging to 
      /tarball/src/runtime/artifacts/source-build/self/src/dotnet.sh /tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/crossgen2/crossgen2.dll -o:/tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/System.Private.CoreLib.dll -r:/tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/IL/*.dll --targetarch:x64 -O /tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/IL/System.Private.CoreLib.dll --perfmap-format-version:1 --perfmap --perfmap-path:/tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/
      Specify which project file to use because this '/tarball/src/runtime/artifacts/source-build/self/src/src/coreclr' contains more than one project file.
    /tarball/src/runtime/artifacts/source-build/self/src/src/coreclr/crossgen-corelib.proj(104,5): error MSB3073: The command "/tarball/src/runtime/artifacts/source-build/self/src/dotnet.sh /tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/crossgen2/crossgen2.dll -o:/tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/System.Private.CoreLib.dll -r:/tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/IL/*.dll --targetarch:x64 -O /tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/IL/System.Private.CoreLib.dll --perfmap-format-version:1 --perfmap --perfmap-path:/tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/" exited with code 1.
    
    Build FAILED.
    
    /tarball/src/runtime/artifacts/source-build/self/src/src/coreclr/crossgen-corelib.proj(104,5): error MSB3073: The command "/tarball/src/runtime/artifacts/source-build/self/src/dotnet.sh /tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/crossgen2/crossgen2.dll -o:/tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/System.Private.CoreLib.dll -r:/tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/IL/*.dll --targetarch:x64 -O /tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/IL/System.Private.CoreLib.dll --perfmap-format-version:1 --perfmap --perfmap-path:/tarball/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/Linux.x64.Release/" exited with code 1.
        0 Warning(s)
        1 Error(s)

Inside src/coreclr are multiple project files, crossgen-corelib.proj, runtime.proj, and runtime-prereqs.proj. I checked that these are also present in the runtime that’s in .NET 7.0.1xx. I also checked that the error from the .NET CLI isn’t new to .NET 7.0.2xx. I’m not sure where else to look. Maybe @ViktorHofer knows who to tag?

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
akoeplingercommented, Nov 24, 2022

it sets RuntimeIdentifiers but no RuntimeIdentifier? And do you use one of the following SelfContained or Publish* properties?

This is also the default setup for Android/iOS builds, see e.g.:

https://github.com/xamarin/xamarin-android/blob/ac643dddb5e9ef968fa758a6bc77a084242780e7/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets#L71-L73

1reaction
jkotascommented, Nov 22, 2022

it sets RuntimeIdentifiers but no RuntimeIdentifier? And do you use one of the following SelfContained or Publish* properties?

Yes, crossgen project does exactly that: https://github.com/dotnet/runtime/tree/main/src/coreclr/tools/aot/crossgen2

Another option may be: AppendRuntimeIdentifierToOutputPath = false

This sounds like the most appropriate fix. Submitted https://github.com/dotnet/runtime/pull/78733 (verified locally that it fixes the build break)

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found