Skip to content

Fix Unable to load shared library 'jitinterface_x64' build error on linux/mac #114012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 3, 2025

Conversation

steveisok
Copy link
Member

@steveisok steveisok commented Mar 28, 2025

When crossgen is first built, it writes the executable and shared lib artifacts to artifacts/bin/coreclr/<os>.<arch>.<config>/<arch>/crossgen2. On subsequent builds the native libs are cleaned and never copied back (by the SDK) even though they are included as items in crossgen.props. This can cause the build to fail later on down the line when we attempt to use the in build crossgen on different assemblies as it won't find the native libs it depends on.

We need to set ExcludeFromSingleFile=true so that the publishing logic knows that we want to not include these files in the singlefile bundle.

See https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design_3_0.md

Fixes #111731

…inux/mac

When crossgen is first built, it writes the executable and shared lib artifacts to
`artifacts/bin/coreclr/<os>.<arch>.<config>/<arch>/crossgen2`. On subsequent builds,
the native libs are cleaned and never copied back even though they are included as
<Content> items in crossgen.props. This can cause the build to fail later on down the
line when we attempt to use the in build crossgen on different assemblies as it won't find
the native libs it depends on.

To work around the issue, this change adds a target that runs after publish and copies
the content items to $(PublishDir). It's not clear if this is a bug in the SDK or something
we're not doing correctly. More investigation is suggested.

Fixes dotnet#111731
@Copilot Copilot AI review requested due to automatic review settings March 28, 2025 15:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (4)
  • src/coreclr/tools/aot/crossgen2/crossgen2.props: Language not supported
  • src/coreclr/tools/aot/crossgen2/crossgen2.targets: Language not supported
  • src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj: Language not supported
  • src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj: Language not supported

@steveisok steveisok requested a review from a team March 28, 2025 15:32
@steveisok
Copy link
Member Author

Thanks @akoeplinger !

@steveisok
Copy link
Member Author

/ba-g Networking failures

@steveisok steveisok merged commit 1abd812 into dotnet:main Apr 3, 2025
94 of 96 checks passed
@steveisok steveisok deleted the fix-crossgen-inbuild branch April 3, 2025 12:15
@github-actions github-actions bot locked and limited conversation to collaborators May 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux build fails randomly with "Unable to load shared library 'jitinterface_x64'" error in crossgen
3 participants