Skip to content

Add CG2 to source-build bundle #49241

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

Merged
merged 4 commits into from
Jun 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Layout/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -54,6 +54,12 @@
<BundleRuntimePacks Condition="'$(BundleRuntimePacks)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</BundleRuntimePacks>
<BundleNativeAotCompiler Condition="'$(BundleNativeAotCompiler)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true'">true</BundleNativeAotCompiler>

<!-- Crossgen2 is not bundled by default on platforms where Microsoft provides a package on nuget.org,
because it is large (100MB+). -->
<_IsCommunityPlatform Condition="'$(OSName)' != 'win' and '$(OSName)' != 'osx'
and !('$(OSName)' == 'linux' and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'arm64'))">true</_IsCommunityPlatform>
<BundleCrossgen2 Condition="'$(BundleCrossgen2)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true' and '$( _IsCommunityPlatform )' == 'true'">true</BundleCrossgen2>

<!-- Use the portable "linux-x64" Rid when downloading Linux shared framework compressed file. -->
<UsePortableLinuxSharedFramework Condition="'$(UsePortableLinuxSharedFramework)' == '' and '$(IsLinux)' == 'true' and !$(TargetRid.StartsWith('linux-musl'))">true</UsePortableLinuxSharedFramework>
<HighEntropyVA>true</HighEntropyVA>
4 changes: 4 additions & 0 deletions src/Layout/redist/targets/GenerateBundledVersions.targets
Original file line number Diff line number Diff line change
@@ -277,6 +277,10 @@
Condition="'$(BundleNativeAotCompiler)' == 'true'"
Include="$(ProductMonikerRid)" />

<Crossgen2SupportedRids
Condition="'$(BundleCrossgen2)' == 'true'"
Include="$(ProductMonikerRid)" />

<Net60MonoRuntimePackRids Include="
@(Net60RuntimePackRids);
browser-wasm;
6 changes: 6 additions & 0 deletions src/Layout/redist/targets/RestoreLayout.targets
Original file line number Diff line number Diff line change
@@ -116,6 +116,12 @@
PackageVersion="$(MicrosoftWindowsDesktopAppRefPackageVersion)"
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />

<BundledLayoutPackage Include="Microsoft.NETCore.App.Crossgen2.$(SharedFrameworkRid)"
Condition="'$(BundleCrossgen2)' == 'true'"
PackageName="Microsoft.NETCore.App.Crossgen2.$(SharedFrameworkRid)"
PackageVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />

<BundledLayoutPackage Include="runtime.$(SharedFrameworkRid).Microsoft.DotNet.ILCompiler"
Condition="'$(BundleNativeAotCompiler)' == 'true'"
PackageName="runtime.$(SharedFrameworkRid).Microsoft.DotNet.ILCompiler"
Loading
Oops, something went wrong.