-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Allow TargetOS and TargetRid to be overridden in DotNetBuild.props #113765
base: main
Are you sure you want to change the base?
Conversation
This is needed to fix the linux-bionic builds in the VMR
There was a problem hiding this 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 (1)
- eng/DotNetBuild.props: Language not supported
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this imply that due to L18, the passed in TargetOS value will never be used?
Yes. The problem is that the runtime's build scripts process and change the passed in TargetOS when determining the RID. Because of our "nested inner build" logic, we effectively were stripping the "-bionic" part of "linux-bionic" from the inner build invocation and building the product in a weird blend of linux, linux-bionic, and android. By letting this calculation happen again and overwriting the TargetOS based on the RID, we can restore the calculation of the TargetOS to the correct value by re-extracting it from the RID (which we calculate based on the originally-passed-in TargetOS). |
My 2 cents: it may be interesting to globally introduce a property that is the "portable rid OS corresponding to the target". That one would be |
It sounds like we are missing handling of linux-bionic somewhere next to the existing handling of linux-musl which should have the same behavior but doesn't (e.g. alpine distro packages use source-build without issues). If we can find and fix that problem, I think that would be better targeted fix rather than exposing these props. Ideally, |
Alpine doesn't have a problem because musl and glibc builds are more similar. |
Coming back to this, here's the flow of what's happening in main and why musl doesn't have a problem here:
This change lets the logic at step 4 correct the adjustment in step 2 using the RID that's passed in by the orchestrator. I'd like to get in this change as-is. After we switch to flat code-flow to the VMR, we can revisit how we handle RIDs and platform specification and simplify it from the VMR where we can do all the changes in one PR. |
Note that in the first step, |
This is needed to fix the linux-bionic builds in the VMR.
Contributes to dotnet/source-build#4955