-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use the Implicit SDK RID for RID-Specific Apps by Default #26143
Use the Implicit SDK RID for RID-Specific Apps by Default #26143
Conversation
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets
Outdated
Show resolved
Hide resolved
src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs
Outdated
Show resolved
Hide resolved
So Rid Agnostic projects are a whole other thing to consider. Working on that right now |
src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASelfContainedApp.cs
Outdated
Show resolved
Hide resolved
Note on that one failing test: |
Can you document a set of CLI commands that would have had an error previously that now work because of this work? That would help a lot in reviewing your work. I'm not really the one to review all the code. |
EDIT 2: This info is stale now, check the top comment. EDIT: Copied this to the top for better visibility, should make reviewing easier. The following worked before w/ Sarah's change but doesn't require extra computation in the CLI anymore:
The following would cause an error before:
The following did not mean anything before and now causes the correct behavior, validating it works it on publish scenarios through the CLI (and the CLI only ftr):
~~- Publishing a rid agnostic library. ~~ What didn't change:
|
Retargeting to 7.0.100. |
Marking as |
I am going to try to get the implicit RID in for RC2 by removing PublishSelfContained. For |
d3ff1d4
to
ae1c82c
Compare
@dotnet/domestic-cat May someone please take a quick look at this? Hoping to get it in for RC2. |
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.
I'm happy with the change.
My only concern would be to maybe reword some of the errors. Right now it reads as A runtime identifier for the property 'PublishAot' couldn't be inferred.
and I wonder whether 'PublishAot' property
reads better.
Awesome, thanks @joeloff for your review. Remaining work is looking into one test which appears to fail flakily on helix. |
Initial Feature was added in 2020 but not documented here: dotnet/sdk#10449 We've added implicit RIDs here: dotnet/sdk#26143 And we've added interaction to toggle implicit RIDs off with UCR here: dotnet/sdk#28628 And we added the shorthand for ucr here: dotnet/sdk#27971 Needs to be duplicated for `dotnet publish` as well.
Part 1 of 4 for #26503
Resolves #23539
Resolves #26028
The implicit RID is now inferred under the following options:
SelfContained=true,
PublishReadyToRun=true,
PublishSingleFile=true
PublishAot=true
PublishSelfContained=true.PublishSelfContained can be added to make a project publish self-contained by default.Removed code from before where RID is injected in the CLI and moved it into the MS Build target.
Some changes to how self-contained is inferred as well.
To observe changes:
The following worked before w/ Sarah's change but doesn't require extra computation in the CLI anymore:
The following would cause an error before:
dotnet publish -p:PublishSingleFile=true
dotnet publish -p:PublishReadyToRun=true
dotnet publish -p:SelfContained=true
dotnet publish -p:PublishAot=true
dotnet build -p:SelfContained=true (Note this also works if set in csproj unlike before, like others)
The following did not mean anything before and now causes the correct behavior, validating it works it on publish scenarios through the CLI (and the CLI only ftr):- dotnet publish -p:PublishSelfContained=trueBroken by this PR Until Daniel's PR is merged into MSBuild fixing the bug which causes this to break:Publishing a rid agnostic library.What didn't change:
TODO: