-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ILCompiler.pkgproj: remove 'runtime.json' when DotNetBuildSourceOnly. #102908
Conversation
To work around these errors we remove the 'runtime.json' file completely on the source-built SDK. | ||
'ProcessFrameworkReferences' is responsible for either picking up the bundled pack (when targetting the source-built rid) | ||
or to add a 'runtime.<rid>.Microsoft.DotNet.ILCompiler' package for download. --> | ||
<IncludeRuntimeJson Condition="'$(DotNetBuildSourceOnly)' == 'true'">false</IncludeRuntimeJson> |
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.
This depends on dotnet/arcade#14805.
@ericstj can you please take a look? (This is about pkgproj infra) |
Can we just remove this completely? We shouldn't be relying on runtime.json anywhere anymore. We removed that from the product in 2.0. Anything that needs support like this should have an SDK doing the package selection. |
Per conversation in dotnet/source-build#1215, it sounds like using a |
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
We need a simple way to override the default version of Can we make it work equally well without runtime.json? |
Rather than a
I think this would work with an ILCompiler package without the runtime.json and the logic we already have in the SDK today. |
I dislike that we would be moving from PackageReference to SDK magic. I think PackageReferences are much cleaner and easier to understand from user point of view. If we agree that the SDK magic is right way to go, I guess it can work. @agocke @MichalStrehovsky Do you see any problems with it? We would have to update the docs and chase down all places that depend on the current behavior. It may be best to do it separately from enabling source build for native AOT toolchain.
|
I don't see an issue other than what Jan already wrote. If we do this change, we'll need to consider KnownILCompilerPack and ILCompilerPackVersion basically a "public API" so that we don't have to redo chasing down all places that depend on this or mention this next time it changes. If we're doing a break, it would be ideal if this mechanism is standardized with other tools that ship in NuGets - ILLink and crossgen off the top of my head, so that we know what we have is going to last. @sbomer is there an existing mechanism when a user needs to pick up a new/specific version of ILLink if they need a different one from the one that ships with the SDK? |
There are number of other tools. For example, you can reference a specific Roslyn version too - via a package reference. I think the only meaningful standard are package references. Everything else are bespoke solutions that won't ever be consistent across the ecosystem. |
We should be careful with this - it updates the ILC version used for all TFMs. To update it for just one TFM you'd have to do something like this:
It's the same as for ILCompiler: the user can add a PackageReference, which works but produces a warning:
The same trick (updating I don't think updating the Known*Packs is a good user experience. It works in a pinch, but if we care about the user experience in this scenario I would not recommend relying on this mechanism. |
I also think it would be best to treat these two things as separate - ie enabling native AOT on source-built SDKs, and removing the runtime.json from Microsoft.DotNet.ILCompiler (and other similar packages, if there are any). |
Contributes to dotnet/source-build#1215
@dsplaisted @baronfel @ViktorHofer @jkotas ptal
cc @omajid