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

BundledVersions: update portable rid logic. #14647

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

tmds
Copy link
Member

@tmds tmds commented Oct 4, 2022

Defaults the portable rid to match the rid.
This works for portable builds.

For non-portable builds, the portable rid can be
controlled using PortableOSName.

For source-build, we set PortableOSName based
on the bootstrap SDK's portable rid.

@tmds tmds requested a review from a team as a code owner October 4, 2022 07:03
@tmds
Copy link
Member Author

tmds commented Oct 4, 2022

@am11 @crummel @MichaelSimons @ayakael ptal.

This is an alternative to #14637 which also covers source-build.

@am11
Copy link
Member

am11 commented Oct 4, 2022

LGTM.

I was targeting release/7.0.1xx branch, which flows to main branch via automation in installer and sdk repos (runtime's merge flow has opposite direction). Can you update the base branch?

@am11
Copy link
Member

am11 commented Oct 4, 2022

Also a candidate of 6.0 backport. The first few versions of .NET 6 were shipped with dotnet/sdk#14093 but it didn't had non-portable fix. Then in 6.0.2xx we got the non-portable fix dotnet/sdk#22373 but it introduced regression for linux-musl-{non x64 arch} in portable builds which #14637 and this PR are trying to fix.

@tmds tmds changed the base branch from main to release/7.0.1xx October 4, 2022 07:37
@tmds tmds requested a review from rbhanda as a code owner October 4, 2022 07:37
Defaults the portable rid to match the rid.
This works for portable builds.

For non-portable builds, the portable rid can be
controlled using PortableOSName.

For source-build, we set PortableOSName based
on the bootstrap SDK's portable rid.
@tmds tmds force-pushed the bundled_portable_rid branch from 108511b to faa8ecb Compare October 4, 2022 07:39
@MichaelSimons MichaelSimons requested a review from crummel October 6, 2022 18:22
@crummel
Copy link

crummel commented Oct 19, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ayakael
Copy link

ayakael commented Nov 5, 2022

I've backported this fix to release/6.0.1xx and included it with #14816

@ayakael
Copy link

ayakael commented Nov 5, 2022

The SDK side of the fix is backported to release/6.0.1xx in dotnet/sdk#27849.

@@ -10,6 +10,10 @@
<OverrideTargetRid Condition="'$(TargetOS)' == 'OSX'">osx-x64</OverrideTargetRid>
<OSNameOverride>$(OverrideTargetRid.Substring(0, $(OverrideTargetRid.IndexOf("-"))))</OSNameOverride>

<!-- Determine target portable rid based on bootstrap SDK's portable rid -->
<_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))</_platformIndex>
<PortableOS>$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))</PortableOS>
Copy link

Choose a reason for hiding this comment

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

It'd be nice if <PortableOS> could be set only if it is empty. Thus:
<PortableOS Condition="'$(PortableOS)' == ''">

This ensures that we can override the PortableOS if, for example, it was previously the wrong one.

Copy link
Member Author

Choose a reason for hiding this comment

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

This ensures that we can override the PortableOS if, for example, it was previously the wrong one.

Do you know can override it if by setting /p:PortableOS, for example in SourceBuild.props, even when the Condition is not present?

Copy link

@ayakael ayakael Nov 9, 2022

Choose a reason for hiding this comment

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

In depends where that override flows down. I suspect that in SourceBuild.props, any non-conditionnal setting of PortableOS would override what's in installer.proj. For Alpine, our version 6.0.110 of the SDK regressed in that --use-current-runtime came out as alpine-3.17-x64. Thus, we had to override whatever would come out of $(NETCoreSdkPortableRuntimeIdentifier), as it wouldn't be linux-musl-x64. For building 6.0.111, we set /p:PortableOS=linux-musl as an argument to build.sh, including the conditional setting of PortableOS.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ayakael is it good for you as is, or do you still want me to add the Condition?

Copy link

Choose a reason for hiding this comment

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

It'd be more prudent, but it's fine as-is. Once the new Portable rid flows down the condition isn't necessary anyways.

ayakael added a commit to ayakael/installer that referenced this pull request Nov 9, 2022
ayakael added a commit to ayakael/installer that referenced this pull request Nov 9, 2022
ayakael added a commit to ayakael/installer that referenced this pull request Nov 10, 2022
@nagilson
Copy link
Member

Thank you for making this fix; I think it's quite important and FYI that there are only a few days left to get this in for the 7.0.100 servicing December patch. cc @marcpopMSFT. I think we should mark this as servicing-consider if this is ready @tmds ?

@marcpopMSFT
Copy link
Member

My understanding is this and the related PRs were done for source build so I usually leave it to the source build team to review and bring up to tactics. @MichaelSimons?

@MichaelSimons
Copy link
Member

@crummel - Can you prepare for and present this issue to tactics? TIA

@crummel crummel merged commit 46a7f72 into dotnet:release/7.0.1xx Nov 15, 2022
crummel pushed a commit to ayakael/installer that referenced this pull request Nov 15, 2022
ayakael added a commit to ayakael/installer that referenced this pull request Nov 15, 2022
ayakael added a commit to ayakael/installer that referenced this pull request Nov 16, 2022
ayakael added a commit to ayakael/installer that referenced this pull request Dec 16, 2022
ayakael added a commit to ayakael/installer that referenced this pull request Jan 10, 2023
ayakael added a commit to ayakael/installer that referenced this pull request Jan 11, 2023
ayakael added a commit to ayakael/installer that referenced this pull request Jan 13, 2023
ayakael added a commit to ayakael/installer that referenced this pull request Jan 13, 2023
crummel pushed a commit to ayakael/installer that referenced this pull request Jan 24, 2023
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.

7 participants