Add netcoreappaot target group#30980
Conversation
src/shims/ApiCompat.proj
Outdated
| <_RunApiCompat>true</_RunApiCompat> | ||
| <!-- Disable running apicompat for uap scenarios because the RuntimePath is not correctly setup in BuildAllConfigurations mode --> | ||
| <_RunApiCompat Condition="'$(BuildAllConfigurations)' == 'true' and $(TargetGroup.StartsWith('uap'))">false</_RunApiCompat> | ||
| <_RunApiCompat Condition="'$(BuildAllConfigurations)' == 'true' and ($(TargetGroup.StartsWith('uap') or $(PackageTargetRuntimeSuffix)' == 'aot'))">false</_RunApiCompat> |
There was a problem hiding this comment.
You're missing a trailing parenthesis.
There was a problem hiding this comment.
Fixed the paren and quote (I think... not sure how to trigger the error locally)
There was a problem hiding this comment.
Build -allconfigurations from the root.
| <IsPartialFacadeAssembly>true</IsPartialFacadeAssembly> | ||
| <ILLinkClearInitLocals>true</ILLinkClearInitLocals> | ||
| <GenFacadesIgnoreMissingTypes Condition="'$(TargetGroup)'=='uapaot' OR '$(TargetGroup)' == 'uap'">true</GenFacadesIgnoreMissingTypes> | ||
| <GenFacadesIgnoreMissingTypes Condition="'$(PackageTargetRuntimeSuffix)'=='aot' OR '$(TargetGroup)' == 'uap'">true</GenFacadesIgnoreMissingTypes> |
There was a problem hiding this comment.
Lots more like this. Can you make all of them use TargetsAOT? PackageTargetRuntimeSuffix isn't meant to be used like this, its not a configuration property.
| <NoWarn>$(NoWarn);0809;0618</NoWarn> | ||
| <!-- Default interfaces are not officially supported in netcoreapp yet --> | ||
| <DefineConstants Condition="'$(IsPrerelease)' == 'true' and '$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);FEATURE_DEFAULT_INTERFACES</DefineConstants> | ||
| <DefineConstants Condition="'$(IsPrerelease)' == 'true' and '$(TargetGroup)' == 'netcoreapp' and '$(PackageTargetRuntimeSuffix)'!='aot'">$(DefineConstants);FEATURE_DEFAULT_INTERFACES</DefineConstants> |
| <AssemblyName>System.Runtime.Loader</AssemblyName> | ||
| <IsPartialFacadeAssembly>true</IsPartialFacadeAssembly> | ||
| <GenFacadesIgnoreMissingTypes Condition="'$(TargetGroup)'=='uapaot'">true</GenFacadesIgnoreMissingTypes> | ||
| <GenFacadesIgnoreMissingTypes Condition="'$(PackageTargetRuntimeSuffix)'=='aot'">true</GenFacadesIgnoreMissingTypes> |
| <IsPartialFacadeAssembly>true</IsPartialFacadeAssembly> | ||
| <GenFacadesIgnoreMissingTypes Condition="'$(TargetGroup)' == 'uapaot'">true</GenFacadesIgnoreMissingTypes> | ||
| <NoWarn Condition="'$(TargetGroup)' == 'uapaot'">0436;3001</NoWarn> | ||
| <GenFacadesIgnoreMissingTypes Condition="'$(PackageTargetRuntimeSuffix)' == 'aot'">true</GenFacadesIgnoreMissingTypes> |
| uap-Windows_NT; | ||
| uapaot-Windows_NT; | ||
| netcoreapp-Windows_NT; | ||
| netcoreappaot-Windows_NT; |
There was a problem hiding this comment.
If we are adding this, we should add it for Unix as well.
There was a problem hiding this comment.
I don't think we have a Unix CoreLib in a package we could build that against. If we start producing one somewhere, we could add those flavors.
| <OfficialBuildRID Include="win-x86"> | ||
| <Platform>x86</Platform> | ||
| </OfficialBuildRID> | ||
| <OfficialBuildRID Include="@(OfficialBuildRID->'%(Identity)-aot')" /> |
There was a problem hiding this comment.
Note that this will double the number of official builds.
There was a problem hiding this comment.
As we have discussed offline some time ago, I think it would be better to finish refactoring the CoreRT/AOT CoreLib so that we can have one CoreFX build that works for both non-AOT and AOT. It would avoid doubling of the official build flavors.
There was a problem hiding this comment.
I checked with @ericstj and this file doesn't actually control official build. I didn't add an official build in this change; I'll do that and CI separately. When I do, I'll just add one more build.
There was a problem hiding this comment.
I think it would be better to finish refactoring the CoreRT/AOT CoreLib so that we can have one CoreFX build that works for both non-AOT and AOT.
I think that's a great goal, but when I tried to experiment with using the existing netcoreapp, there were two issues:
- There are still lots of differences that would need refactoring.
- Testing needs to work differently (running ILC, etc).
By making this change, we can get testing for the runtime and compiler with this framework as well as having all of the remaining differences effectively flagged by the build variables (since this separates aot and uap). If the refactoring is completed, we can look at removing the TargetGroup.
There was a problem hiding this comment.
I'm ok with this change. It does mean that the runtime.json inside MS.Private.CoreFx.NetCoreApp will have AOT rids (which may be dangling refs if we don't have official builds) but I am ok with that since its only an internal package to move bits between CoreFx and Core-Setup.
tools-local/targetgroups.props
Outdated
| @@ -168,6 +168,20 @@ | |||
| <NuGetTargetMoniker>.NETCoreApp,Version=v1.2</NuGetTargetMoniker> | |||
| <NuGetTargetMonikerShort>netcoreapp1.2</NuGetTargetMonikerShort> | |||
| </TargetGroups> | |||
There was a problem hiding this comment.
You can delete the corert Group while you are on this - it was never used.
There was a problem hiding this comment.
Similar edits should be in pkg\Microsoft.NETCore.Platforms\runtime.json.
Directory.Build.props
Outdated
| <UseDotNetNativeToolchain Condition="$(_bc_TargetGroup.EndsWith('aot'))">true</UseDotNetNativeToolchain> | ||
| <!-- System.Private.* comes from test ilc, so the symbol packages for those versions will no exist, this is to avoid warnings --> | ||
| <DownloadCoreCLRSymbols Condition="'$(BuildingUAPAOTVertical)' == 'true'">false</DownloadCoreCLRSymbols> | ||
| <DownloadCoreCLRSymbols Condition="$(_bc_TargetGroup.EndsWith('aot'))">false</DownloadCoreCLRSymbols> |
There was a problem hiding this comment.
We can use UseDotNetNativeToolchain here
|
@morganbr do you have ETA for the PR? There was no activity in last 4 weeks. |
We decide which RID-specific package to build based on the PackageRID property. Make sure it's set correctly for aot.
… that started to do something similar.
|
I'm still working on figuring out the allConfigurations issue below. Any hints would certainly be appreciated.
|
|
@ericstj , that failure stems from an incorrect ifdef in the ref project for System.Runtime.csproj. The define below shouldn't get enabled for netcoreappaot since TargetsAOT should be true, but when using |
ericstj
left a comment
There was a problem hiding this comment.
Remember aot is a runtime and must satisfy the netcoreapp TFM surface area, same as Linux, osx, etc.
| <PropertyGroup> | ||
| <BuildConfigurations> | ||
| netcoreapp; | ||
| netcoreappaot; |
There was a problem hiding this comment.
You cannot have runtime-specific refs. You must satisfy the netcoreapp ref. Remove this.
There was a problem hiding this comment.
Done. This could eventually be problematic since the field in question tells Roslyn that the runtime supports a feature that it doesn't, but I don't think we need to block on it for now.
There was a problem hiding this comment.
Runtimes don't have the ability to limit compile-time features. You have to support that feature good enough so that folks can "light-down" at runtime.
There was a problem hiding this comment.
The feature in question is default interface implementations. Until that's actually built, I suspect the best we can do is a decent build error. As I said, we don't need to block for now since:
- The framework doesn't use them yet, so it shouldn't affect testing
- Nobody else uses them yet either since we haven't shipped a CoreCLR with it.
| <NoWarn>$(NoWarn);0809;0618</NoWarn> | ||
| <!-- Default interfaces are not officially supported in netcoreapp yet --> | ||
| <DefineConstants Condition="'$(IsPrerelease)' == 'true' and '$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);FEATURE_DEFAULT_INTERFACES</DefineConstants> | ||
| <DefineConstants Condition="'$(IsPrerelease)' == 'true' and '$(TargetGroup)' == 'netcoreapp' and '$(TargetsAOT)'!='true'">$(DefineConstants);FEATURE_DEFAULT_INTERFACES</DefineConstants> |
There was a problem hiding this comment.
Undo and add a baseline to src for missing API
…p and netcoreappaot match.
|
Test NETFX x86 Release Build |
|
Now that the build is clean (and I've verified a test still works), @ericstj, this should be ready to review 😄 |
ericstj
left a comment
There was a problem hiding this comment.
LGTM. FYI @weshaggard @joperezr
| <RuntimeGroupWithQualifiers Include="@(RuntimeGroup)"> | ||
| <AdditionalQualifiers>%(AdditionalQualifiers);corert</AdditionalQualifiers> | ||
| </RuntimeGroupWithQualifiers> | ||
| <RuntimeGroupWithQualifiers Include="@(RuntimeGroup)" /> |
There was a problem hiding this comment.
We could remove the RuntimeGroupWithQualifiers item entirely and just use RuntimeGroup.
There was a problem hiding this comment.
It looks like something gets added further down. Since I don't have insight into how this gets used, I'm not going to do further refactoring in this change.
| <OfficialBuildRID Include="win-x86"> | ||
| <Platform>x86</Platform> | ||
| </OfficialBuildRID> | ||
| <OfficialBuildRID Include="@(OfficialBuildRID->'%(Identity)-aot')" /> |
There was a problem hiding this comment.
I'm ok with this change. It does mean that the runtime.json inside MS.Private.CoreFx.NetCoreApp will have AOT rids (which may be dangling refs if we don't have official builds) but I am ok with that since its only an internal package to move bits between CoreFx and Core-Setup.
|
Thanks for all the help and reviews, @ericstj! |
Changes to add a new netcoreappaot target group, similar to netcoreapp but it builds against the .NET Native core libraries. A couple of libraries, such as System.Linq.Expressions, have aot-specific definitions that are enabled for netcoreappaot. Commit migrated from dotnet/corefx@3333166
Adds a netcoreappaot target group intended for CoreRT/.NET Native working with the netcoreapp framework. For the most part, netcoreappaot should be similar to netcoreapp, but it builds against the .NET Native core libraries. A couple of libraries, such as System.Linq.Expressions, have aot-specific definitions that are enabled for netcoreappaot.
I've verified that a couple of netcoreappaot tests pass, but haven't attempted a full test pass locally.