-
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
Add error for incorrect aot publish #46070
Conversation
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.
Where do you see the north star with the native AOT runtime packs? Do we expect PublishAotUsingRuntimePack
is here to stay? Do we expect dotnet publish
to be the only way to trigger a publish (this would be problematic for e.g. WinAppSDK that just runs the Publish target).
Just wondering if it's worth it to build experiences around it and use up an error code for this (the only people who would find out about PublishAotUsingRuntimePack
are iDevice/Bionic targeting users since we don't document it anywhere else).
LGTM modulo this question.
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.
The error LGTM, thanks!
Regarding:
Where do you see the north star with the native AOT runtime packs? Do we expect PublishAotUsingRuntimePack is here to stay? Do we expect dotnet publish to be the only way to trigger a publish (this would be problematic for e.g. WinAppSDK that just runs the Publish target).
I think the north star is resolving: dotnet/runtime#87060 and removing the need for setting PublishAotUsingRuntimePack
where supported ways of publishing are:
dotnet publish
ordotnet build /p:_IsPublishing=true ...
We had discussions before on this topic in: #37872
Agreed, I would like to move towards using runtime packs everywhere, make |
It's not very desirable to make I asked about the north star and alignment of this with that because translating this message to a dozen languages and documenting it at https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/ only to have to redo it felt like just extra work. |
Agreed, I think having a public |
…ublishing. .NET now shows an error if PublishAotUsingRuntimePack=true and PublishAot=true, but we're not actually publishing: > Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(231): error NETSDK1225: Native compilation is not supported when invoking the Publish target directly. Try running dotnet publish. Ref: dotnet/sdk#46070
…ublishing. .NET now shows an error if PublishAotUsingRuntimePack=true and PublishAot=true, but we're not actually publishing: > Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(231): error NETSDK1225: Native compilation is not supported when invoking the Publish target directly. Try running dotnet publish. Ref: dotnet/sdk#46070
For the following project (note it uses the nativeaot runtime pack):
This command produces an error:
This is due to ILC being passed assemblies from the coreclr runtime pack (which doesn't include S.P.StackTraceMetadata) instead of the nativeaot framework assemblies.
This adds a better error message for this unsupported scenario.