Skip to content
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

[release/6.0.1xx] Fix aspnetcore build on musl-libc platforms #17324

Merged
merged 3 commits into from Sep 13, 2023

Conversation

ayakael
Copy link
Contributor

@ayakael ayakael commented Sep 9, 2023

Commit fe99f8e is a workaround for dotnet/aspnetcore#39822. This issue only occurs when building using linux-musl-$arch. Non-portable builds are not affected. This is why this occurs on 6.0, but not on 7.0, as the latter removed the necessity to build portable builds. On Alpine's dotnet6 package, we backported the patches for eliminating runtime-portable, thus the issue does not occur. For .net 8.0, this issue expresses itself once-more. A fix for 8.0 should be implemented.

Commit 41b975c is a backport of #14938 (@tmds), which renames "MicrosoftAspNetCoreAppRuntimePackageVersion so existing Artifacts tarballs don't override it, and stop adding it to the PackageVersions.props in new Artifacts tarballs." Without this commit, installer fails to build on Alpine Linux.

Commit d695d21 is a backport of a small change that was part of #14549 (@tmds). It uses SharedFrameworkRid to set RuntimeNETCrossgenPackageName when building from source. Without this change, installer still tries to use linux-x64 version of CrossGen rather than linux-musl-x64.

These changes should finally unblock #13074

@ayakael
Copy link
Contributor Author

ayakael commented Sep 9, 2023

I've added a few more changes that were necessary for me to build dotnet6 on Alpine Linux without eliminating runtime-portable.

@mthalman mthalman requested a review from a team September 11, 2023 14:41
@mthalman mthalman requested a review from a team September 13, 2023 14:17
Copy link
Member

@dsplaisted dsplaisted left a comment

Choose a reason for hiding this comment

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

I don't understand all of the source-build changes, but this looks good to me.

@mthalman mthalman merged commit b5fbd1b into dotnet:release/6.0.1xx Sep 13, 2023
31 checks passed
@mthalman
Copy link
Member

mthalman commented Nov 3, 2023

This change hasn't made its way to release/7.0.1xx. It was included in #17493 but that got closed and, for whatever reason, never made it's way into a PR that did get merged.

@mthalman
Copy link
Member

mthalman commented Nov 3, 2023

/backport to release/7.0.1xx

Copy link
Contributor

github-actions bot commented Nov 3, 2023

Started backporting to release/7.0.1xx: https://github.com/dotnet/installer/actions/runs/6746319375

Copy link
Contributor

github-actions bot commented Nov 3, 2023

@mthalman backporting to release/7.0.1xx failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix build of Aspnetcore on libc-musl platforms
Using index info to reconstruct a base tree...
M	src/SourceBuild/tarball/content/Directory.Build.props
M	src/SourceBuild/tarball/content/repos/aspnetcore.proj
M	src/SourceBuild/tarball/content/repos/installer.proj
Falling back to patching base and 3-way merge...
Auto-merging src/SourceBuild/tarball/content/repos/installer.proj
CONFLICT (content): Merge conflict in src/SourceBuild/tarball/content/repos/installer.proj
Auto-merging src/SourceBuild/tarball/content/repos/aspnetcore.proj
CONFLICT (content): Merge conflict in src/SourceBuild/tarball/content/repos/aspnetcore.proj
Auto-merging src/SourceBuild/tarball/content/Directory.Build.props
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix build of Aspnetcore on libc-musl platforms
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

github-actions bot commented Nov 3, 2023

@mthalman an error occurred while backporting to release/7.0.1xx, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@mthalman
Copy link
Member

mthalman commented Nov 3, 2023

Commit fe99f8e is a workaround for dotnet/aspnetcore#39822. This issue only occurs when building using linux-musl-$arch. Non-portable builds are not affected. This is why this occurs on 6.0, but not on 7.0, as the latter removed the necessity to build portable builds.

Based on the above comments, it seems this isn't needed for 7.0. @ayakael, can you confirm? But we do need the change to set the PortableRid to linux-musl-$(Platform); I'll get that done.

@ayakael
Copy link
Contributor Author

ayakael commented Nov 3, 2023

These changes should not be backported to 7.0, as 7.0 already has its own implementation of these fixes. This PR was to address the closing of #14816 which was going to fix these issues on musl. Due to the risk of those changes, it was rejected. This was a lower risk fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants