-
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
Microsoft.NETCore.App.Crossgen2.sfxproj in source-build #74721
Comments
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsThis project publishes crossgen as a self-contained app. For source-build this needs to use the runtime that got built from the runtime repo. The builds also needs to be aware of the rid that source-build added via cc @ericstj @omajid @MichaelSimons @jkotas @ViktorHofer
|
It may be easiest to publish it as framework dependent app for source-build. |
Tagging subscribers to this area: @hoyosjs Issue DetailsThis project publishes crossgen as a self-contained app. For source-build this needs to use the runtime that got built from the runtime repo. The builds also needs to be aware of the rid that source-build added via cc @ericstj @omajid @MichaelSimons @jkotas @ViktorHofer
|
@hoyosjs, @trylek, @jkoritzinsky (@agocke) just changed labels as this isn't related to the libraries infrastructure. Can you please take a look? |
When we're source-building .NET, runtime gets built twice: once as When the non-portable The To meet the built-from-source requirement, the We can then eliminate the |
Is this needed for .NET 7? From what I see this depends on #69455 which is not merged. We are already past RC2 snap. Once that's in, I wonder if we need a task to update |
I think we should set our goal to .NET 7 if that is feasible for everyone involved. source-build's timing doesn't make it feasible to change something before rc.
In this case, the rid we're publishing would be an exact match with a known rid.
I don't know about the Task. In #75597 I'm making some changes so source-build can pick up non-portable rids from a previous build. It would be good if we could eliminate the known references to things we shouldn't be using when cc @ericstj |
Infrastructure changes are OK to go into 7.0 so long as they stay constrained to infrastructure and feed into the source-build requirements. We can take them to Tactics if we think there is some product risk - typically we don't and instead work to mitigate the risk through some PR validation (manual checks, test cases, etc). I closed out that PR since I'm not actively working on it and my time for making fixes (especially those that others are dependent on) is pretty small at the moment. I think it makes more sense for that to be driven by folks who need it and can test the end-to-end with the change. |
Sorry, meant target. |
@ViktorHofer can we use |
Yes, that would be the right extension point to use. Out-of-band libraries under src/libraries and other projects like the mono samples use that as well. |
@ViktorHofer, can you (or someone else that is familiar) look into this? |
Do you mean reviewing the PR or enabling the targetingpack.targets infrastructure for crossgen sfxproj? |
Enabling targetpack.targets infra for sfxproj. I took a shot but didn't get far. I first built runtime repo Then I tried building just the I guess the fix involves importing Also, maybe we can remove some of the known packs and references, before adding the built ones, to be sure the prebuilts don't get used.
|
Crossgen2 is owned by the CLR team and @MichalStrehovsky afaik. It would be good to first agree on the direction. Do we want to publish framework dependent or self-contained in source-build? What are the components in play? Is it crossgen2.csproj and Microsoft.NETCore.App.Crossgen2.sfxproj? I hope that Michal or others can help further with this as I'm really short on additional resources right now. |
It's owned by @dotnet/crossgen-contrib. I look at stuff but don't make decisions and I'm not on the team that owns it. Do we need to build the sfxproj in the first place? Crossgen2 is on the same plan as NativeAOT - if you do |
The crossgen2 package gets used by the ASP.NET Core build. The goal is to ensure all artifacts produced by a single build of For .NET 7, these packages are only consumed while building .NET itself and they are not made available for end-users. So it is possible to publish them different if that makes it easier to meet the built-from-source requirement. (For .NET 8+, there is an open issue on source-build repo for source-built SDKs to also be capable of delivering these features.) It would be nice if we can do this for .NET 7. It allows to omit building My feeling is that using |
@ViktorHofer @MichalStrehovsky can someone take a look at this? |
fyi, this is what my latest attempt looks like: diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets
index 744a0cd20b4..b4d35aab5f7 100644
--- a/eng/targetingpacks.targets
+++ b/eng/targetingpacks.targets
@@ -26,6 +26,7 @@
<!-- Add Known* items if the SDK doesn't support the TargetFramework yet. -->
<ItemGroup Condition="'$(UseLocalTargetingRuntimePack)' == 'true'">
+ <KnownFrameworkReference Remove="$(LocalFrameworkOverrideName)" />
<KnownFrameworkReference Include="$(LocalFrameworkOverrideName)"
DefaultRuntimeFrameworkVersion="$(ProductVersion)"
LatestRuntimeFrameworkVersion="$(ProductVersion)"
@@ -36,6 +37,7 @@
TargetingPackName="$(LocalFrameworkOverrideName).Ref"
TargetingPackVersion="$(ProductVersion)"
Condition="'@(KnownFrameworkReference)' == '' or !@(KnownFrameworkReference->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))" />
+ <KnownRuntimePack Remove="$(LocalFrameworkOverrideName)" />
<KnownRuntimePack Include="$(LocalFrameworkOverrideName)"
TargetFramework="$(NetCoreAppCurrent)"
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
@@ -44,12 +46,14 @@
RuntimePackRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-bionic-arm64;linux-loongarch64;linux-musl-x64;linux-bionic-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86"
RuntimePackLabels="Mono"
Condition="'@(KnownRuntimePack)' == '' or !@(KnownRuntimePack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))"/>
+ <KnownAppHostPack Remove="$(LocalFrameworkOverrideName)" />
<KnownAppHostPack Include="$(LocalFrameworkOverrideName)"
AppHostPackNamePattern="$(LocalFrameworkOverrideName).Host.**RID**"
AppHostPackVersion="$([MSBuild]::ValueOrDefault('$(_AppHostBaselinePackVersion)', '$(ProductVersion)'))"
AppHostRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-bionic-arm64;linux-loongarch64;linux-musl-x64;linux-bionic-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64"
TargetFramework="$(NetCoreAppCurrent)"
Condition="'@(KnownAppHostPack)' == '' or !@(KnownAppHostPack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))" />
+ <KnownCrossgen2Pack Remove="$(LocalFrameworkOverrideName).Crossgen2" />
<KnownCrossgen2Pack Include="$(LocalFrameworkOverrideName).Crossgen2"
TargetFramework="$(NetCoreAppCurrent)"
Crossgen2PackNamePattern="$(LocalFrameworkOverrideName).Crossgen2.**RID**"
@@ -87,6 +91,14 @@
Condition="'$(UsePackageDownload)' == 'true' and $([System.String]::Copy('%(Identity)').StartsWith('$(LocalFrameworkOverrideName).Runtime'))" />
<PackageReference Remove="@(PackageReference)"
Condition="'$(UsePackageDownload)' != 'true' and $([System.String]::Copy('%(Identity)').StartsWith('$(LocalFrameworkOverrideName).Runtime'))" />
+ <PackageDownload Remove="@(PackageDownload)"
+ Condition="'$(UsePackageDownload)' == 'true' and $([System.String]::Copy('%(Identity)').StartsWith('$(LocalFrameworkOverrideName).Crossgen2'))" />
+ <PackageReference Remove="@(PackageReference)"
+ Condition="'$(UsePackageDownload)' != 'true' and $([System.String]::Copy('%(Identity)').StartsWith('$(LocalFrameworkOverrideName).Crossgen2'))" />
+ <PackageDownload Remove="@(PackageDownload)"
+ Condition="'$(UsePackageDownload)' == 'true' and $([System.String]::Copy('%(Identity)').StartsWith('$(LocalFrameworkOverrideName).Host'))" />
+ <PackageReference Remove="@(PackageReference)"
+ Condition="'$(UsePackageDownload)' != 'true' and $([System.String]::Copy('%(Identity)').StartsWith('$(LocalFrameworkOverrideName).Host'))" />
</ItemGroup>
</Target>
diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj
index 12864a2341e..bd45dd2dd41 100644
--- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj
+++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj
@@ -13,6 +13,7 @@
<RuntimeIdentifiers Condition="'$(DotNetBuildFromSource)' == 'true'">$(PackageRID)</RuntimeIdentifiers>
<SelfContained>false</SelfContained>
<SelfContained Condition="'$(RunningPublish)' == 'true'">true</SelfContained>
+ <UseLocalTargetingRuntimePack>true</UseLocalTargetingRuntimePack>
</PropertyGroup>
<Import Project="crossgen2.props" />
@@ -28,6 +29,7 @@
</PropertyGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
+ <Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" />
<PropertyGroup Condition="'$(NativeAotSupported)' == 'true'">
<IlcToolsPath>$(CoreCLRILCompilerDir)</IlcToolsPath> And
|
@mangod9 I Cc'd @dotnet/crossgen-contrib but there's no volunteer, could you nominate one? I assume this is blocking source build in .NET 7, but I don't know anything about source build or "packs". |
Is this required for 7? @trylek @AntonLapounov should be able to help here. |
Strictly speaking it is not required as we are capable of building .NET 7. We should still aim to fix this for .NET 7 as it enables reducing source-build's build time by 25% and more, see dotnet/installer#14549 (comment). |
@trylek @AntonLapounov can one of you ptal? |
Are you seeing that failure in the
|
I'll try to capture what happens when source-build runs this. @ViktorHofer @AntonLapounov it doesn't look like the top-level verbosity ripples down to the runtime/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj Lines 32 to 48 in c325a5a
|
@AntonLapounov if you want to take a stab at this. You can perform a build like this:
The Crossgen2 package should be built using |
Maybe this is already consuming the runtime pack that got built? What does this do: runtime/src/coreclr/tools/aot/crossgen2/crossgen2.csproj Lines 56 to 58 in f156fb9
And, what is the contents of |
Yes, that pulls the runtime pack that just got built |
Btw, Line 102 in d6fdb3a
maybe it's better to merge the condition in crossgen2 into the top-level Subsets.props to avoid any unexpected build state. It is basically controlling "after compiling crossgen2 assembly, whether to publish crossgen2 as nativeaot app (NativeAotSupported=true) or a singlefileapp (NativeAotSupported=false)". |
Great! I can just close this then. |
This project publishes crossgen as a self-contained app.
For source-build this needs to use the runtime that got built from the runtime repo.
The builds also needs to be aware of the rid that source-build added via
AdditionalRuntimeIdentifiers
by using #69455.cc @ericstj @omajid @MichaelSimons @jkotas @ViktorHofer
The text was updated successfully, but these errors were encountered: