Add bootstrapping build mechanism and enable for SourceBuild (#114285)

* Revert "Publish with BaseOS RID when its present"

This reverts commit 38289afd3b.

* WIP: Bootstrap build instead of staged build

* Fix bootstrap restore.

* Get ILC and crossgen2 publishing with bootstrap subset + use-bootstrap

* Remove two-stage build and convert to bootstrap build.

* Don't build OOB libs in bootstrapping. They're not needed

* Layout bootstrap files in a separate directory so our actual product build still builds everything.

It's slower but ensures that our binlogs for the product build still have everything in them.

* Fix condition for bootstrap in SB

* Various refactorings and put cdac on the same plan as ilc/crossgen2

* Strip double-dash options too as they can be specified

* Update eng/build.sh

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>

* Update eng/DotNetBuild.props

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>

* Apply suggestion

* Don't remove the source-built-upstream-cache folder

* Fix loongarch64 leg

* Generate breadcrumbs in runtime.proj (where we build the aotsdk folder).

Move BuildIntegration.proj to use Microsoft.Build.NoTargets

* Adjust trimming tests to hook into targetingpacks.targets refactored logic

* Add documentation

* Fix local apphost path hookup

* Docs feedback

* Build hosts in runtime-linker-tests now that we're using the live hosts.

* Use the targetingpacks.targets process for a live apphost

* PR feedback

* Add to build.sh

* Fix up RID graph in the bootstrapping

* Pass the right RID graph for NativeExports

* Fix bootstrap for community portable platforms

* Update eng/Subsets.props

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>

* Update eng/Subsets.props

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>

---------

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
This commit is contained in:
Jeremy Koritzinsky 2025-05-02 09:15:07 -07:00 committed by GitHub
parent 828dec9840
commit 5cd7566c23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 263 additions and 137 deletions

View File

@ -15,4 +15,40 @@
<MSBuild Projects="$(RepoTasksDir)tasks.proj"
Targets="BuildIncrementally" />
</Target>
<Target Name="SetupBootstrapLayout"
AfterTargets="Build"
Condition="'$(Subset)' == 'bootstrap'">
<ItemGroup>
<AotSdkFile
Include="$(CoreCLRAotSdkDir)/*"
Condition="'$(UseNativeAotForComponents)' == 'true'" />
<AppHostFile
Include="$([MSBuild]::NormalizePath('$(DotNetHostBinDir)', 'apphost$(ExeSuffix)'))" />
<AppHostFile
Include="$([MSBuild]::NormalizePath('$(CoreCLRArtifactsPath)', 'corehost', 'singlefilehost$(ExeSuffix)'))"
Condition="'$(UseNativeAotForComponents)' != 'true'" />
<RefPackFile Include="$(MicrosoftNetCoreAppRefPackDir)/**/*" />
<RuntimePackFile Include="$(MicrosoftNetCoreAppRuntimePackDir)/**/*" />
<RidGraphFile Include="$(ArtifactsBinDir)Microsoft.NETCore.Platforms/*.json" />
<AotSdkFile
DestinationPath="$(BootstrapAotSdkDir)/%(Filename)%(Extension)" />
<AppHostFile
DestinationPath="$(BootstrapHostDir)/%(Filename)%(Extension)" />
<RefPackFile
DestinationPath="$(BootstrapRefPackDir)/%(RecursiveDir)%(Filename)%(Extension)" />
<RuntimePackFile
DestinationPath="$(BootstrapRuntimePackDir)/%(RecursiveDir)%(Filename)%(Extension)" />
<RidGraphFile
DestinationPath="$(BootstrapRidGraphDir)/%(RecursiveDir)%(Filename)%(Extension)" />
<BootstrapFile Include="@(AotSdkFile);@(AppHostFile);@(RefPackFile);@(RuntimePackFile);@(RidGraphFile)" />
</ItemGroup>
<Copy
SourceFiles="@(BootstrapFile)"
DestinationFiles="@(BootstrapFile->Metadata('DestinationPath'))"
SkipUnchangedFiles="true" />
<Message Importance="high" Text="Bootstrap files copied to $(ArtifactsDir)bootstrap" />
</Target>
</Project>

View File

@ -367,10 +367,4 @@
<BeforeMicrosoftNETSdkTargets Condition="'$(MSBuildProjectExtension)' == '.ilproj'">$(BeforeMicrosoftNETSdkTargets);$(RepositoryEngineeringDir)ILSdk.BeforeTargets.targets</BeforeMicrosoftNETSdkTargets>
</PropertyGroup>
<PropertyGroup>
<!-- Keep in sync with outputs defined in Microsoft.NETCore.Platforms.csproj. -->
<BundledRuntimeIdentifierGraphFile>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'Microsoft.NETCore.Platforms', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
<BundledRuntimeIdentifierGraphFile Condition="!Exists('$(BundledRuntimeIdentifierGraphFile)')">$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
</PropertyGroup>
</Project>

View File

@ -7,9 +7,22 @@
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
</PropertyGroup>
<Import Project="$(RepositoryEngineeringDir)liveBuilds.targets" />
<PropertyGroup Condition="'$(UseBootstrapLayout)' == 'true'">
<!-- Keep in sync with outputs defined in Microsoft.NETCore.Platforms.csproj. -->
<BundledRuntimeIdentifierGraphFile>$([MSBuild]::NormalizePath('$(BootstrapRidGraphDir)', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
<!-- If our bootstrap build didn't add a new RID to the graph, fall back to the frozen graph. -->
<BundledRuntimeIdentifierGraphFile Condition="!Exists('$(BundledRuntimeIdentifierGraphFile)')">$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
</PropertyGroup>
<PropertyGroup Condition="'$(UseBootstrapLayout)' != 'true'">
<!-- Keep in sync with outputs defined in Microsoft.NETCore.Platforms.csproj. -->
<BundledRuntimeIdentifierGraphFile>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'Microsoft.NETCore.Platforms', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
<BundledRuntimeIdentifierGraphFile Condition="!Exists('$(BundledRuntimeIdentifierGraphFile)')">$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
</PropertyGroup>
<Import Project="$(RepositoryEngineeringDir)Analyzers.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="$(RepositoryEngineeringDir)liveBuilds.targets" />
<Import Project="$(RepositoryEngineeringDir)toolAot.targets" />
<Import Project="$(RepositoryEngineeringDir)generators.targets" />
<Import Project="$(RepositoryEngineeringDir)python.targets" />

View File

@ -171,3 +171,15 @@ docker run --rm \
mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-12 \
./build.sh --subset clr --cross --os freebsd
```
### Building CoreCLR with Bootstrapping
CoreCLR builds a few tools, including NativeAOT compiler itself, using NativeAOT (or single file where NativeAOT is not supported). The build defaults to using a "Last Known Good" version of NativeAOT to build the tools. This "Last Known Good" version comes from the .NET SDK referenced in the global.json file. This default was chosen for a good local build experience of most repo contributors. Building with live NativeAOT version would make the local build longer and it would make debugging local changes that impact NativeAOT compiler complicated.
The runtime's build scripts provide an additional set of options to build with the live NativeAOT version instead of the "Last Known Good" version. This is useful for testing changes to NativeAOT or the tools that are built with it, and is required for building those tools for target platforms that are not known to the "Last Known Good" version of NativeAOT, such as FreeBSD, community architectures, or non-portable builds of .NET. This is not yet implemented for Windows.
To build the bootstrap subset of the runtime repo, you can build the `bootstrap` subset. To use the bootstrap components in the runtime repo build, you can pass the `--use-bootstrap` argument to the build script. This will use the bootstrap components instead of the "Last Known Good" version of NativeAOT.
For simplicity, a `--bootstrap` option is also provided. This option will build the `bootstrap` subset, clean up the artifacts directory, and then build the runtime repo with the `--use-bootstrap` option. This is useful for building the runtime repo with the live NativeAOT version without having to run two separate commands.
The `--bootstrap` option is automatically specified when building the runtime repo for .NET Source Build, as the vast majority of Source Build scenarios use non-portable RIDs.

View File

@ -38,6 +38,8 @@ Ensure you have all of the prerequisites installed from the [Linux Requirements]
Once that is done, refer to the [Linux section of the cross-building doc](/docs/workflow/building/coreclr/cross-building.md#linux-cross-building). There are detailed instructions on how to cross-compile using your Linux environment, including a section dedicated to FreeBSD building.
You'll also need to use the `--bootstrap` option as documented in the [cross-building doc](/docs/workflow/building/coreclr/cross-building.md#building-coreclr-with-bootstrapping) to build the cross-compilation toolchain.
## Build directly on FreeBSD
Ensure you have all of the prerequisites installed from the [FreeBSD Requirements](/docs/workflow/requirements/freebsd-requirements.md).

View File

@ -44,7 +44,9 @@
<InnerBuildArgs Condition="'$(OS)' != 'Windows_NT'">$(InnerBuildArgs) --outputrid $(OutputRID)</InnerBuildArgs>
<!-- BaseOS is an expected known rid in the graph that OutputRID is compatible with.
It's used to add OutputRID in the graph if the parent can't be detected. -->
<InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS) /p:BaseOS=$(BaseOS)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS)</InnerBuildArgs>
<!-- Source-build will use non-portable RIDs. To build for these non-portable RID scenarios, we must do a boostrapped build. -->
<InnerBuildArgs Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true'">$(InnerBuildArgs) --bootstrap</InnerBuildArgs>
<!-- Pass through special build modes controlled by properties -->
<InnerBuildArgs Condition="'$(DotNetBuildRuntimeWasmEnableThreads)' == 'true'">$(InnerBuildArgs) /p:WasmEnableThreads=true</InnerBuildArgs>
<InnerBuildArgs Condition="'$(DotNetBuildMonoEnableLLVM)' != ''">$(InnerBuildArgs) /p:MonoEnableLLVM=$(DotNetBuildMonoEnableLLVM)</InnerBuildArgs>

View File

@ -51,10 +51,13 @@
<_NativeAotSupportedArch Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'loongarch64' or '$(TargetArchitecture)' == 'riscv64' or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86')">true</_NativeAotSupportedArch>
<NativeAotSupported Condition="'$(_NativeAotSupportedOS)' == 'true' and '$(_NativeAotSupportedArch)' == 'true'">true</NativeAotSupported>
<!-- Determine if AOT tools can run on the specified target -->
<_AotToolsSupportedOS Condition="'$(TargetsMobile)' != 'true' and '$(TargetsLinuxBionic)' != 'true' and '$(StageOneBuild)' != 'true'">true</_AotToolsSupportedOS>
<_AotToolsSupportedArch Condition="'$(TargetArchitecture)' != 'armel'">true</_AotToolsSupportedArch>
<AotToolsSupported Condition="'$(_AotToolsSupportedOS)' == 'true' and '$(_AotToolsSupportedArch)' == 'true'">true</AotToolsSupported>
<!-- Determine if we support running the .NET SDK on the target platform -->
<_SdkToolsSupportedOS Condition="'$(TargetsMobile)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">true</_SdkToolsSupportedOS>
<_SdkToolsSupportedArch Condition="'$(TargetArchitecture)' != 'armel'">true</_SdkToolsSupportedArch>
<SdkToolsSupported Condition="'$(_SdkToolsSupportedOS)' == 'true' and '$(_SdkToolsSupportedArch)' == 'true'">true</SdkToolsSupported>
<_UseNativeAotForComponentsCrossOS Condition="'$(CrossBuild)' == 'true' and '$(_hostArchitecture)' == '$(_targetArchitecture)' and '$(_hostOS)' != 'windows'">true</_UseNativeAotForComponentsCrossOS>
<UseNativeAotForComponents Condition="'$(NativeAotSupported)' == 'true' and ('$(TargetOS)' == '$(HostOS)' or '$(_UseNativeAotForComponentsCrossOS)' == 'true') and '$(TargetsLinuxBionic)' != 'true'">true</UseNativeAotForComponents>
</PropertyGroup>
<PropertyGroup>
@ -149,6 +152,12 @@
<DefaultPacksSubsets Condition="'$(DotNetBuildSourceOnly)' != 'true'">$(DefaultPacksSubsets)+packs.installers</DefaultPacksSubsets>
<DefaultPacksSubsets Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true' and '$(DotNetBuildSourceOnly)' != 'true'">$(DefaultPacksSubsets)+packs.tests</DefaultPacksSubsets>
<DefaultPacksSubsets Condition="'$(RuntimeFlavor)' != 'Mono' and '$(ForceBuildMobileManifests)' == 'true'">$(DefaultPacksSubsets)+mono.manifests</DefaultPacksSubsets>
<BootstrapSubsets>host.native+libs.sfx+libs.pretest</BootstrapSubsets>
<BootstrapSubsets Condition="'$(UseNativeAotForComponents)' != 'true'">$(BootstrapSubsets)+clr.runtime+clr.corelib</BootstrapSubsets>
<BootstrapSubsets Condition="'$(UseNativeAotForComponents)' == 'true'">$(BootstrapSubsets)+clr.nativeaotlibs+clr.nativeaotruntime+libs.native</BootstrapSubsets>
<SwapNativeForIL Condition="$(_subset.Contains('+bootstrap+')) and '$(RuntimeFlavor)' == 'CoreCLR'">true</SwapNativeForIL>
</PropertyGroup>
<PropertyGroup>
@ -160,6 +169,7 @@
<_subset>$(_subset.Replace('+tools+', '+$(DefaultToolsSubsets)+'))</_subset>
<_subset>$(_subset.Replace('+host+', '+$(DefaultHostSubsets)+'))</_subset>
<_subset>$(_subset.Replace('+packs+', '+$(DefaultPacksSubsets)+'))</_subset>
<_subset>$(_subset.Replace('+bootstrap+', '+bootstrap+$(BootstrapSubsets)+'))</_subset>
<_subset Condition="'$(TargetOS)' == 'browser'">$(_subset.Replace('+clr.runtime+', '+mono.emsdk+clr.runtime+'))</_subset>
<!-- Surround _subset in dashes to simplify checks below -->
@ -170,8 +180,6 @@
</PropertyGroup>
<PropertyGroup>
<_IsCommunityCrossArchitecture Condition="'$(CrossBuild)' == 'true' and ('$(TargetArchitecture)' == 'loongarch64' or '$(TargetArchitecture)' == 'riscv64')">true</_IsCommunityCrossArchitecture>
<UseNativeAotForComponents Condition="'$(NativeAotSupported)' == 'true' and '$(TargetOS)' == '$(HostOS)' and '$(TargetsLinuxBionic)' != 'true' and '$(_IsCommunityCrossArchitecture)' != 'true'">true</UseNativeAotForComponents>
<!-- If we're building clr.nativeaotlibs and not building the CLR runtime, compile libraries against NativeAOT CoreLib -->
<UseNativeAotCoreLib Condition="'$(TestNativeAot)' == 'true' or ($(_subset.Contains('+clr.nativeaotlibs+')) and !$(_subset.Contains('+clr.native+')) and !$(_subset.Contains('+clr.runtime+')) and !$(_subset.Contains('+clr.corelib+')))">true</UseNativeAotCoreLib>
</PropertyGroup>
@ -259,6 +267,7 @@
<SubsetName Include="RegenerateDownloadTable" OnDemand="true" Description="Regenerates the nightly build download table" />
<SubsetName Include="RegenerateThirdPartyNotices" OnDemand="true" Description="Regenerates the THIRD-PARTY-NOTICES.TXT file based on other repos' TPN files." />
<SubsetName Include="tasks" OnDemand="true" Description="Build the repo local task projects." />
<SubsetName Include="bootstrap" OnDemand="true" Description="Build the projects needed to build shipping assets in the repo against live assets." />
</ItemGroup>
@ -441,22 +450,22 @@
$(CoreClrProjectRoot)tools\PdbChecker\PdbChecker.csproj;
$(CoreClrProjectRoot)tools\AssemblyChecker\AssemblyChecker.csproj;
$(ToolsProjectRoot)StressLogAnalyzer\src\StressLogAnalyzer.csproj" Category="clr" Condition="'$(DotNetBuildSourceOnly)' != 'true'"/>
<!-- We may use these targets with the in-build ILCompiler or with the shipping ILCompiler. Produce them whenever we may use them. -->
<ProjectToBuild Include="$(CoreClrProjectRoot)nativeaot\BuildIntegration\BuildIntegration.proj" Category="clr" Condition="'$(AotToolsSupported)' == 'true' or '$(NativeAotSupported)' == 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler.Build.Tasks\ILCompiler.Build.Tasks.csproj" Category="clr" Condition="'$(AotToolsSupported)' == 'true' or '$(NativeAotSupported)' == 'true'" />
<!-- skip the architectures that don't have LKG runtime packs -->
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_publish.csproj" Condition="'$(AotToolsSupported)' == 'true'" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_publish.csproj" Category="clr" Condition="'$(AotToolsSupported)' == 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Condition="'$(AotToolsSupported)' == 'true'" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Condition="'$(AotToolsSupported)' == 'true'" Category="clr" />
<!--
Always build the in-build variants of these tools. They run on the host machine, which we always have LKG packs for.
For two-stage builds, we omit this step during stage2 since stage1 covers it.
-->
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_inbuild.csproj" Category="clr" Condition="'$(StageTwoBuild)' != 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_inbuild.csproj" Category="clr" Condition="'$(StageTwoBuild)' != 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_inbuild.csproj" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_inbuild.csproj" Category="clr" />
<!-- We may use these targets with the in-build ILCompiler or with the shipping ILCompiler. Produce them whenever we may use them. -->
<ProjectToBuild Include="$(CoreClrProjectRoot)nativeaot\BuildIntegration\BuildIntegration.proj" Category="clr" Condition="'$(SdkToolsSupported)' == 'true' or '$(NativeAotSupported)' == 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler.Build.Tasks\ILCompiler.Build.Tasks.csproj" Category="clr" Condition="'$(SdkToolsSupported)' == 'true' or '$(NativeAotSupported)' == 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_publish.csproj" Condition="'$(SdkToolsSupported)' == 'true'" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_publish.csproj" Condition="'$(SdkToolsSupported)' == 'true'" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Condition="'$(SdkToolsSupported)' == 'true'" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Condition="'$(SdkToolsSupported)' == 'true'" Category="clr" />
<ProjectToBuild Condition="'$(TargetOS)' == 'windows' or ('$(TargetOS)' == 'linux' and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64')) or '$(TargetOS)' == 'osx'" Include="$(CoreClrProjectRoot)tools\SuperFileCheck\SuperFileCheck.csproj" Category="clr" />
@ -724,6 +733,11 @@
<ProjectToBuild Include="$(RepoTasksDir)tasks.proj" Category="tasks" />
</ItemGroup>
<!-- Bootstrap -->
<ItemGroup Condition="$(_subset.Contains('+bootstrap+'))">
<ProjectToBuild Include="$(LibrariesProjectRoot)Microsoft.NETCore.Platforms\src\Microsoft.NETCore.Platforms.csproj" Category="libraries" />
</ItemGroup>
<!-- Set default configurations. -->
<ItemGroup>
<ProjectToBuild Update="@(ProjectToBuild)">

View File

@ -48,6 +48,8 @@ usage()
echo " --usemonoruntime Product a .NET runtime with Mono as the underlying runtime."
echo " --verbosity (-v) MSBuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]."
echo " [Default: Minimal]"
echo " --use-bootstrap Use the results of building the bootstrap subset to build published tools on the target machine."
echo " --bootstrap Build the bootstrap subset and then build the repo with --use-bootstrap."
echo ""
echo "Actions (defaults to --restore --build):"
@ -156,6 +158,7 @@ cmakeargs=''
extraargs=''
crossBuild=0
portableBuild=1
bootstrap=0
source $scriptroot/common/native/init-os-and-arch.sh
@ -508,6 +511,16 @@ while [[ $# > 0 ]]; do
shift 1
;;
-use-bootstrap)
arguments="$arguments /p:UseBootstrap=true"
shift 1
;;
-bootstrap)
bootstrap=1
shift 1
;;
-fsanitize)
if [ -z ${2+x} ]; then
echo "No value for -fsanitize is supplied. See help (--help) for supported values." 1>&2
@ -570,4 +583,21 @@ export DOTNETSDK_ALLOW_TARGETING_PACK_CACHING=0
cmakeargs="${cmakeargs// /%20}"
arguments="$arguments /p:TargetArchitecture=$arch /p:BuildArchitecture=$hostArch"
arguments="$arguments /p:CMakeArgs=\"$cmakeargs\" $extraargs"
if [[ "$bootstrap" == "1" ]]; then
# Strip build actions other than -restore and -build from the arguments for the bootstrap build.
bootstrapArguments="$arguments"
for flag in --sign --publish --pack --test -sign -publish -pack -test; do
bootstrapArguments="${bootstrapArguments//$flag/}"
done
"$scriptroot/common/build.sh" $bootstrapArguments /p:Subset=bootstrap -bl:$scriptroot/../artifacts/log/bootstrap.binlog
# Remove artifacts from the bootstrap build so the product build is a "clean" build.
echo "Cleaning up artifacts from bootstrap build..."
rm -r "$scriptroot/../artifacts/bin"
# Remove all directories in obj except for the source-built-upstream-cache directory to avoid breaking SourceBuild.
find "$scriptroot/../artifacts/obj" -mindepth 1 -maxdepth 1 ! -name 'source-built-upstream-cache' -exec rm -rf {} +
arguments="$arguments /p:UseBootstrap=true"
fi
"$scriptroot/common/build.sh" $arguments

View File

@ -56,9 +56,22 @@
<CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'armel' and '$(BuildArchitecture)' != 'armel' and '$(TargetsLinux)' == 'true'">x64</CoreCLRCrossTargetComponentDirName>
</PropertyGroup>
<PropertyGroup Condition="'$(UseLocalAppHostPack)' == 'true'">
<AppHostSourcePath>$([MSBuild]::NormalizePath('$(DotNetHostBinDir)', 'apphost$(ExeSuffix)'))</AppHostSourcePath>
<SingleFileHostSourcePath>$([MSBuild]::NormalizePath('$(CoreCLRArtifactsPath)', 'corehost', 'singlefilehost$(ExeSuffix)'))</SingleFileHostSourcePath>
<PropertyGroup>
<BootstrapRefPackDir>$(ArtifactsDir)bootstrap/microsoft.netcore.app/ref</BootstrapRefPackDir>
<BootstrapRuntimePackDir>$(ArtifactsDir)bootstrap/microsoft.netcore.app/lib</BootstrapRuntimePackDir>
<BootstrapAotSdkDir>$(ArtifactsDir)bootstrap/aotsdk</BootstrapAotSdkDir>
<BootstrapHostDir>$(ArtifactsDir)bootstrap/host</BootstrapHostDir>
<BootstrapRidGraphDir>$(ArtifactsDir)bootstrap/ridgraph</BootstrapRidGraphDir>
</PropertyGroup>
<PropertyGroup>
<LocalAppHostPath>$([MSBuild]::NormalizePath('$(DotNetHostBinDir)', 'apphost$(ExeSuffix)'))</LocalAppHostPath>
<LocalSingleFileHostPath>$([MSBuild]::NormalizePath('$(CoreCLRArtifactsPath)', 'corehost', 'singlefilehost$(ExeSuffix)'))</LocalSingleFileHostPath>
</PropertyGroup>
<PropertyGroup Condition="'$(UseBootstrapLayout)' == 'true'">
<LocalAppHostPath>$(BootstrapHostDir)/apphost$(ExeSuffix)</LocalAppHostPath>
<LocalSingleFileHostPath>$(BootstrapHostDir)/singlefilehost$(ExeSuffix)</LocalSingleFileHostPath>
</PropertyGroup>
<Target Name="ResolveRuntimeFilesFromLocalBuild">

View File

@ -103,7 +103,7 @@ extends:
or(
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_non_mono_and_wasm.containsChange'], true),
eq(variables['isRollingBuild'], true))
buildArgs: -s clr+libs+tools.illink -c $(_BuildConfig)
buildArgs: -s clr+libs+tools.illink+host.native -c $(_BuildConfig)
postBuildSteps:
- template: /eng/pipelines/libraries/execute-trimming-tests-steps.yml

View File

@ -504,27 +504,9 @@ extends:
- linux_loongarch64
jobParameters:
testScope: innerloop
nameSuffix: CoreCLR_TwoStage
buildArgs: -s clr+libs+host -c $(_BuildConfig) -rc Checked -p:StageOneBuild=true
nameSuffix: CoreCLR_Bootstrapped
buildArgs: -s clr+libs+host -c $(_BuildConfig) -rc Checked --bootstrap
timeoutInMinutes: 120
postBuildSteps:
- script: |
echo Running $(Build.SourcesDirectory)/build$(scriptExt) \
${{ variables.debugOnPrReleaseOnRolling }} \
-s clr.tools+packs -rc Checked -cross \
-os $(osGroup) \
-a $(archType) \
-c $(_BuildConfig) \
-p:StageTwoBuild=true
$(Build.SourcesDirectory)/build$(scriptExt) \
${{ variables.debugOnPrReleaseOnRolling }} \
-s clr.tools+packs -rc Checked -cross \
-os $(osGroup) \
-a $(archType) \
-c $(_BuildConfig) \
-p:StageTwoBuild=true
displayName: Build clr.tools and packs
condition: >-
or(
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true),

View File

@ -34,6 +34,7 @@
<UseLocalILCompilerPack Condition="'$(UseLocalILCompilerPack)' == ''">$(UseLocalTargetingRuntimePack)</UseLocalILCompilerPack>
<UseLocalCrossgen2Pack Condition="'$(UseLocalCrossgen2Pack)' == ''">$(UseLocalTargetingRuntimePack)</UseLocalCrossgen2Pack>
<UseLocalNativeAotPack Condition="'$(UseLocalNativeAotPack)' == ''">$(UseLocalTargetingRuntimePack)</UseLocalNativeAotPack>
</PropertyGroup>
<!-- Add Known* items if the SDK doesn't support the TargetFramework yet. -->
@ -113,21 +114,30 @@
<Target Name="UpdateLocalTargetingAndRuntimePack"
Condition="'$(UseLocalTargetingRuntimePack)' == 'true'"
AfterTargets="ResolveFrameworkReferences">
<PropertyGroup Condition="'$(UseBootstrapLayout)' != 'true'">
<LocalRefPackDir>$(MicrosoftNetCoreAppRefPackDir)</LocalRefPackDir>
<LocalRuntimePackDir>$(MicrosoftNetCoreAppRuntimePackDir)</LocalRuntimePackDir>
</PropertyGroup>
<PropertyGroup Condition="'$(UseBootstrapLayout)' == 'true'">
<LocalRefPackDir>$(BootstrapRefPackDir)</LocalRefPackDir>
<LocalRuntimePackDir>$(BootstrapRuntimePackDir)</LocalRuntimePackDir>
</PropertyGroup>
<Error Text="The shared framework must be built before the local targeting pack can be consumed."
Condition="!Exists('$(MicrosoftNetCoreAppRefPackDir)data\FrameworkList.xml')" />
Condition="!Exists('$(LocalRefPackDir)\data\FrameworkList.xml')" />
<ItemGroup>
<ResolvedTargetingPack Path="$(MicrosoftNetCoreAppRefPackDir.TrimEnd('/\'))"
<ResolvedTargetingPack Path="$(LocalRefPackDir.TrimEnd('/\'))"
NuGetPackageVersion="$(ProductVersion)"
PackageDirectory="$(MicrosoftNetCoreAppRefPackDir.TrimEnd('/\'))"
PackageDirectory="$(LocalRefPackDir.TrimEnd('/\'))"
Condition="'%(ResolvedTargetingPack.RuntimeFrameworkName)' == '$(LocalFrameworkOverrideName)'" />
<ResolvedRuntimePack PackageDirectory="$(MicrosoftNetCoreAppRuntimePackDir)"
Condition="'$(MicrosoftNetCoreAppRuntimePackDir)' != '' and
<ResolvedRuntimePack PackageDirectory="$(LocalRuntimePackDir)"
Condition="'$(LocalRuntimePackDir)' != '' and
'%(ResolvedRuntimePack.FrameworkName)' == '$(LocalFrameworkOverrideName)'" />
<ResolvedFrameworkReference TargetingPackPath="$(MicrosoftNetCoreAppRefPackDir.TrimEnd('/\'))"
<ResolvedFrameworkReference TargetingPackPath="$(LocalRefPackDir.TrimEnd('/\'))"
TargetingPackVersion="$(ProductVersion)"
Condition="'%(Identity)' == '$(LocalFrameworkOverrideName)'">
<RuntimePackPath Condition="'$(MicrosoftNetCoreAppRuntimePackDir)' != ''">$(MicrosoftNetCoreAppRuntimePackDir)</RuntimePackPath>
<RuntimePackPath Condition="'$(LocalRuntimePackDir)' != ''">$(LocalRuntimePackDir)</RuntimePackPath>
</ResolvedFrameworkReference>
</ItemGroup>
</Target>
@ -146,6 +156,10 @@
<Target Name="UpdateLocalAppHostPack"
Condition="'$(UseLocalAppHostPack)' == 'true'"
AfterTargets="ResolveFrameworkReferences">
<PropertyGroup>
<AppHostSourcePath>$(LocalAppHostPath)</AppHostSourcePath>
<SingleFileHostSourcePath>$(LocalSingleFileHostPath)</SingleFileHostSourcePath>
</PropertyGroup>
<ItemGroup>
<ResolvedAppHostPack Path="$(AppHostSourcePath)"
PackageDirectory="$([System.IO.Path]::GetDirectoryName('$(AppHostSourcePath)'))"
@ -164,9 +178,23 @@
AfterTargets="ResolveTargetingPackAssets">
<ItemGroup>
<RuntimeFramework Condition="'%(RuntimeFramework.FrameworkName)' == '$(LocalFrameworkOverrideName)'">
<Version Condition="'$(StageTwoBuild)' != 'true'">$(ProductVersion)</Version>
<Version Condition="'$(StageTwoBuild)' == 'true'">$(BundledNETCoreAppPackageVersion)</Version>
<Version>$(ProductVersion)</Version>
</RuntimeFramework>
</ItemGroup>
</Target>
<PropertyGroup Condition="'$(UseLocalNativeAotPack)' == 'true'">
<IlcToolsPath>$(CoreCLRCrossILCompilerDir)</IlcToolsPath>
<SysRoot Condition="('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)') and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot>
<IlcBuildTasksPath>$(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll</IlcBuildTasksPath>
<IlcSdkPath>$(CoreCLRAotSdkDir)</IlcSdkPath>
<IlcFrameworkPath>$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)</IlcFrameworkPath>
<IlcFrameworkNativePath>$(MicrosoftNetCoreAppRuntimePackNativeDir)</IlcFrameworkNativePath>
</PropertyGroup>
<PropertyGroup Condition="'$(UseLocalNativeAotPack)' == 'true' and '$(UseBootstrapLayout)' == 'true'">
<IlcFrameworkPath>$(BootstrapRuntimePackDir)/runtimes/$(OutputRID)/lib/$(NetCoreAppCurrent)/</IlcFrameworkPath>
<IlcFrameworkNativePath>$(BootstrapRuntimePackDir)/runtimes/$(OutputRID)/native/</IlcFrameworkNativePath>
<IlcSdkPath>$(BootstrapAotSdkDir)/</IlcSdkPath>
</PropertyGroup>
</Project>

View File

@ -25,8 +25,6 @@
<NETCoreAppMaximumVersion>{NetCoreAppMaximumVersion}</NETCoreAppMaximumVersion>
<UseMonoRuntime>{UseMonoRuntime}</UseMonoRuntime>
<RuntimeIdentifier>{RuntimeIdentifier}</RuntimeIdentifier>
<AppHostSourcePath>{AppHostSourcePath}</AppHostSourcePath>
<SingleFileHostSourcePath>{SingleFileHostSourcePath}</SingleFileHostSourcePath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- Implicitly force 'UseNativeAotForComponents' for AOT tests -->
@ -48,20 +46,22 @@
<ProductVersion>{ProductVersion}</ProductVersion>
<NetCoreAppCurrent>{NetCoreAppCurrent}</NetCoreAppCurrent>
<NetCoreAppCurrentVersion>{NetCoreAppCurrentVersion}</NetCoreAppCurrentVersion>
<LocalAppHostPath>{LocalAppHostPath}</LocalAppHostPath>
<LocalSingleFileHostPath>{LocalSingleFileHostPath}</LocalSingleFileHostPath>
<MicrosoftNetCoreAppFrameworkName>{MicrosoftNetCoreAppFrameworkName}</MicrosoftNetCoreAppFrameworkName>
<MicrosoftNetCoreAppRefPackDir>{MicrosoftNetCoreAppRefPackDir}</MicrosoftNetCoreAppRefPackDir>
<MicrosoftNetCoreAppRuntimePackDir>{MicrosoftNetCoreAppRuntimePackDir}</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackRidLibTfmDir>{MicrosoftNetCoreAppRuntimePackRidLibTfmDir}</MicrosoftNetCoreAppRuntimePackRidLibTfmDir>
<MicrosoftNetCoreAppRuntimePackNativeDir>{MicrosoftNetCoreAppRuntimePackNativeDir}</MicrosoftNetCoreAppRuntimePackNativeDir>
<CoreCLRILCompilerDir>{CoreCLRILCompilerDir}</CoreCLRILCompilerDir>
<CoreCLRCrossILCompilerDir>{CoreCLRCrossILCompilerDir}</CoreCLRCrossILCompilerDir>
<CoreCLRAotSdkDir>{CoreCLRAotSdkDir}</CoreCLRAotSdkDir>
<RepositoryEngineeringDir>{RepositoryEngineeringDir}</RepositoryEngineeringDir>
<_ExtraTrimmerArgs>{ExtraTrimmerArgs} $(_ExtraTrimmerArgs) --dump-dependencies</_ExtraTrimmerArgs>
{AdditionalProperties}
<!-- Needed for PublishAot -->
<IlcToolsPath>{IlcToolsPath}</IlcToolsPath>
<IlcBuildTasksPath>{IlcBuildTasksPath}</IlcBuildTasksPath>
<IlcSdkPath>{IlcSdkPath}</IlcSdkPath>
<IlcFrameworkPath>{IlcFrameworkPath}</IlcFrameworkPath>
<IlcFrameworkNativePath>{IlcFrameworkNativePath}</IlcFrameworkNativePath>
<CoreCLRBuildIntegrationDir>{CoreCLRBuildIntegrationDir}</CoreCLRBuildIntegrationDir>
</PropertyGroup>

View File

@ -100,11 +100,6 @@
.Replace('{ExtraTrimmerArgs}', '%(TestConsoleApps.ExtraTrimmerArgs)')
.Replace('{AdditionalProperties}', '$(_additionalPropertiesString)')
.Replace('{ToolsILLinkDir}', '$(ToolsILLinkDir)')
.Replace('{IlcToolsPath}', '$(IlcToolsPath)')
.Replace('{IlcBuildTasksPath}', '$(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll')
.Replace('{IlcSdkPath}', '$(CoreCLRAotSdkDir)')
.Replace('{IlcFrameworkPath}', '$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)')
.Replace('{IlcFrameworkNativePath}', '$(MicrosoftNetCoreAppRuntimePackNativeDir)')
.Replace('{CoreCLRBuildIntegrationDir}', '$(CoreCLRBuildIntegrationDir)')
.Replace('{RuntimeHostConfigurationOptions}', '$(_runtimeHostConfigurationOptionsString)')
.Replace('{AdditionalProjectReferences}', '$(_additionalProjectReferencesString)')
@ -125,9 +120,14 @@
.Replace('{MicrosoftNetCoreAppFrameworkName}', '$(MicrosoftNetCoreAppFrameworkName)')
.Replace('{MicrosoftNetCoreAppRefPackDir}', '$(MicrosoftNetCoreAppRefPackDir)')
.Replace('{MicrosoftNetCoreAppRuntimePackDir}', '$(MicrosoftNetCoreAppRuntimePackDir)')
.Replace('{MicrosoftNetCoreAppRuntimePackRidLibTfmDir}', '$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)')
.Replace('{MicrosoftNetCoreAppRuntimePackNativeDir}', '$(MicrosoftNetCoreAppRuntimePackNativeDir)')
.Replace('{CoreCLRILCompilerDir}', '$(CoreCLRILCompilerDir)')
.Replace('{CoreCLRCrossILCompilerDir}', '$(CoreCLRCrossILCompilerDir)')
.Replace('{CoreCLRAotSdkDir}', '$(CoreCLRAotSdkDir)')
.Replace('{NativeSanitizersTargets}', '$(RepositoryEngineeringDir)nativeSanitizers.targets')
.Replace('{AppHostSourcePath}', '$(AppHostSourcePath)')
.Replace('{SingleFileHostSourcePath}', '$(SingleFileHostSourcePath)')
.Replace('{LocalAppHostPath}', '$(LocalAppHostPath)')
.Replace('{LocalSingleFileHostPath}', '$(LocalSingleFileHostPath)')
.Replace('{SanitizerRuntimeFolder}', '$(DotNetHostBinDir)'))"
Overwrite="true" />
<Copy SourceFiles="$(_projectSourceFile);

View File

@ -22,12 +22,6 @@
</PropertyGroup>
<PropertyGroup Condition="'$(TestNativeAot)' == 'true'">
<IlcToolsPath>$(CoreCLRCrossILCompilerDir)</IlcToolsPath>
<SysRoot Condition="('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)') and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot>
<IlcBuildTasksPath>$(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll</IlcBuildTasksPath>
<IlcSdkPath>$(CoreCLRAotSdkDir)</IlcSdkPath>
<IlcFrameworkPath>$(NetCoreAppCurrentTestHostSharedFrameworkPath)</IlcFrameworkPath>
<IlcFrameworkNativePath>$(NetCoreAppCurrentTestHostSharedFrameworkPath)</IlcFrameworkNativePath>
<IlcCppLinkerCustomWarningRegularExpression>module compiled with /GL found</IlcCppLinkerCustomWarningRegularExpression>
<NoWarn>$(NoWarn);IL1005;IL2122;IL3000;IL3001;IL3002;IL3003;IL3050;IL3051;IL3052;IL3053</NoWarn>
<TrimMode>partial</TrimMode>

View File

@ -12,15 +12,19 @@
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>
<!-- Allow overriding the LKG ILCompiler package with a specific version. -->
<PropertyGroup Condition="'$(UseNativeAotForComponents)' == 'true' and '$(PublishAot)' == 'true' and '$(MicrosoftDotNetILCompilerVersion)' != ''">
<SuppressGenerateILCompilerExplicitPackageReferenceWarning>true</SuppressGenerateILCompilerExplicitPackageReferenceWarning>
<PropertyGroup>
<_TrueTargetRid>$(RuntimeIdentifier)</_TrueTargetRid>
<!--
NativeAOT's targets don't handle cross-targeting to a non-portable RID.
Change the RID when importing the NativeAOT targets to the corresponding portable RID if specified.
-->
<RuntimeIdentifier Condition="'$(BaseOS)' != ''">$(BaseOS)</RuntimeIdentifier>
</PropertyGroup>
<Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.SingleEntry.targets" Condition="'$(PublishAot)' == 'true' and '$(UseBootstrapLayout)' == 'true'" />
<PropertyGroup>
<RuntimeIdentifier>$(_TrueTargetRid)</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup Condition="'$(UseNativeAotForComponents)' == 'true' and '$(PublishAot)' == 'true' and '$(MicrosoftDotNetILCompilerVersion)' != ''">
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="$(MicrosoftDotNetILCompilerVersion)" />
<PackageReference Include="runtime.$(NETCoreSdkRuntimeIdentifier).Microsoft.DotNet.ILCompiler" Version="$(MicrosoftDotNetILCompilerVersion)" />
</ItemGroup>
<Target Name="LocateNativeCompiler"
Condition="'$(UseNativeAotForComponents)' == 'true' and '$(HostOS)' != 'windows'"

View File

@ -1,34 +1,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="../Directory.Build.props" />
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<OutputPath>$(RuntimeBinDir)/build/</OutputPath>
</PropertyGroup>
<ItemGroup>
<Content Include="*.*" Exclude="$(MSBuildProjectFile)" />
<Content Include="*.*" Exclude="$(MSBuildProjectFile)" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<Target Name="Build">
<Copy SourceFiles="@(Content)" DestinationFolder="$(OutputPath)" />
<!-- Create breadcrumb to disable dynamic linking of release crt for debug runtime -->
<WriteLinesToFile
File="$(RuntimeBinDir)/aotsdk/debugucrt.txt"
Overwrite="true"
Condition="'$(TargetsWindows)'=='true' and '$(Configuration)' != 'Release'" />
<!-- Create breadcrumb to add additional libraries for non-portable builds -->
<WriteLinesToFile
File="$(RuntimeBinDir)/aotsdk/nonportable.txt"
Overwrite="true"
Condition="'$(TargetsWindows)'!='true' and '$(PortableBuild)' != 'true'" />
<Delete
Files="$(RuntimeBinDir)/aotsdk/nonportable.txt"
Condition="'$(TargetsWindows)'=='true' or '$(PortableBuild)' == 'true'" />
</Target>
<Target Name="Restore" />
<Target Name="Pack" />
</Project>

View File

@ -222,7 +222,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeSystemLibrary Include="icucore" Condition="'$(_IsApplePlatform)' == 'true'" />
<NativeSystemLibrary Include="m" />
<!-- See the comment in PalInterlockedCompareExchange128 for details. -->
<NativeSystemLibrary Include="atomic" Condition="'$(_targetArchitecture)' == 'riscv64'" />
<NativeSystemLibrary Include="atomic" Condition="'$(_targetArchitecture)' == 'riscv64' or '$(_targetArchitecture)' == 'loongarch64'" />
</ItemGroup>
<ItemGroup>

View File

@ -120,5 +120,25 @@
IgnoreStandardErrorWarningFormat="true" />
</Target>
<Target Name="CreateNativeAotBreadcrumbs"
AfterTargets="BuildRuntime"
Condition="'$(ClrNativeAotSubset)' == 'true' or '$(ClrFullNativeBuild)' == 'true'">
<!-- Create breadcrumb to disable dynamic linking of release crt for debug runtime -->
<WriteLinesToFile
File="$(RuntimeBinDir)/aotsdk/debugucrt.txt"
Overwrite="true"
Condition="'$(TargetsWindows)'=='true' and '$(Configuration)' != 'Release'" />
<!-- Create breadcrumb to add additional libraries for non-portable builds -->
<WriteLinesToFile
File="$(RuntimeBinDir)/aotsdk/nonportable.txt"
Overwrite="true"
Condition="'$(TargetsWindows)'!='true' and '$(PortableBuild)' != 'true'" />
<Delete
Files="$(RuntimeBinDir)/aotsdk/nonportable.txt"
Condition="'$(TargetsWindows)'=='true' or '$(PortableBuild)' == 'true'" />
</Target>
<Import Project="$(RepositoryEngineeringDir)nativeSanitizers.targets" />
</Project>

View File

@ -1,6 +1,11 @@
<Project>
<PropertyGroup>
<UseLocalTargetingRuntimePack Condition="'$(UseBootstrapLayout)' == 'true'">true</UseLocalTargetingRuntimePack>
</PropertyGroup>
<Import Project="../Directory.Build.targets" />
<PropertyGroup>
<IsTrimmable Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true</IsTrimmable>
</PropertyGroup>
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" Condition="'$(UseBootstrapLayout)' == 'true'" />
</Project>

View File

@ -13,11 +13,9 @@
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<Configurations>Debug;Release;Checked</Configurations>
<UseLocalTargetingRuntimePack Condition="'$(StageTwoBuild)' == 'true'">true</UseLocalTargetingRuntimePack>
</PropertyGroup>
<Import Project="../AotCompilerCommon.props" />
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" Condition="'$(StageTwoBuild)' == 'true'" />
<PropertyGroup>
<!-- CoreDisTools are used in debugging visualizers. -->

View File

@ -15,7 +15,7 @@
<TrimmerSingleWarn>false</TrimmerSingleWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(CrossBuild)' != 'true' or ('$(StageOneBuild)' != 'true' and '$(StageTwoBuild)' != 'true')">
<PropertyGroup Condition="'$(CrossBuild)' != 'true'">
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>

View File

@ -3,16 +3,12 @@
<PropertyGroup>
<_IsPublishing>true</_IsPublishing>
<RuntimeIdentifier>$(OutputRID)</RuntimeIdentifier>
<!--
If the output RID isn't the current SDK RID and we have a "base" RID, then the output RID isn't known to the SDK.
In that case, we need to set the RuntimeIdentifier to the base RID so the SDK can find a runtime pack for publishing.
-->
<RuntimeIdentifier Condition="'$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)' and '$(BaseOS)' != '' ">$(BaseOS)</RuntimeIdentifier>
<PublishDir>$(RuntimeBinDir)ilc-published/</PublishDir>
<SelfContained>true</SelfContained>
<PublishTrimmed>true</PublishTrimmed>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<AotOrSingleFile>true</AotOrSingleFile>
<UseBootstrapLayout Condition="'$(UseBootstrap)' == 'true'">true</UseBootstrapLayout>
</PropertyGroup>
<Import Project="ILCompiler.props" />

View File

@ -15,11 +15,9 @@
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<Configurations>Debug;Release;Checked</Configurations>
<RunAnalyzers>false</RunAnalyzers>
<UseLocalTargetingRuntimePack Condition="'$(StageTwoBuild)' == 'true'">true</UseLocalTargetingRuntimePack>
</PropertyGroup>
<Import Project="../AotCompilerCommon.props" />
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" Condition="'$(StageTwoBuild)' == 'true'" />
<ItemGroup Label="Embedded Resources">
<EmbeddedResource Include="Properties\Resources.resx">

View File

@ -15,7 +15,7 @@
<TrimmerSingleWarn>false</TrimmerSingleWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(CrossBuild)' != 'true' or ('$(StageOneBuild)' != 'true' and '$(StageTwoBuild)' != 'true')">
<PropertyGroup Condition="'$(CrossBuild)' != 'true'">
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>

View File

@ -3,16 +3,12 @@
<PropertyGroup>
<_IsPublishing>true</_IsPublishing>
<RuntimeIdentifier>$(OutputRID)</RuntimeIdentifier>
<!--
If the output RID isn't the current SDK RID and we have a "base" RID, then the output RID isn't known to the SDK.
In that case, we need to set the RuntimeIdentifier to the base RID so the SDK can find a runtime pack for publishing.
-->
<RuntimeIdentifier Condition="'$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)' and '$(BaseOS)' != '' ">$(BaseOS)</RuntimeIdentifier>
<PublishDir>$(RuntimeBinDir)crossgen2-published/</PublishDir>
<SelfContained>true</SelfContained>
<PublishTrimmed>true</PublishTrimmed>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<AotOrSingleFile>true</AotOrSingleFile>
<UseBootstrapLayout Condition="'$(UseBootstrap)' == 'true'">true</UseBootstrapLayout>
</PropertyGroup>
<Import Project="crossgen2.props" />

View File

@ -18,12 +18,19 @@
<_generateRuntimeGraphTargetFramework Condition="'$(MSBuildRuntimeType)' == 'core'">$(NetCoreAppToolCurrent)</_generateRuntimeGraphTargetFramework>
<_generateRuntimeGraphTargetFramework Condition="'$(MSBuildRuntimeType)' != 'core'">$(NetFrameworkToolCurrent)</_generateRuntimeGraphTargetFramework>
<_generateRuntimeGraphTask>$([MSBuild]::NormalizePath('$(BaseOutputPath)', $(Configuration), '$(_generateRuntimeGraphTargetFramework)', '$(AssemblyName).dll'))</_generateRuntimeGraphTask>
<OutputRIDParent Condition="'$(OutputRIDParent)' == ''">$(AdditionalRuntimeIdentifierParent)</OutputRIDParent>
</PropertyGroup>
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(CrossBuild)' != 'true'">
<!-- By default, assume a non-cross build's non-portable RID is compatible with the SDK's portable RID. -->
<OutputRIDParent Condition="'$(OutputRIDParent)' == ''">$(NETCoreSdkPortableRuntimeIdentifier)</OutputRIDParent>
</PropertyGroup>
<ItemGroup>
<AdditionalRuntimeIdentifiers Include="$(AdditionalRuntimeIdentifiers)" Imports="$(AdditionalRuntimeIdentifierParent)" />
<!-- When building from source, ensure the RID we're building for is part of the RID graph. -->
<AdditionalRuntimeIdentifiers Include="$(OutputRID)" Imports="$(AdditionalRuntimeIdentifierParent)" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<AdditionalRuntimeIdentifiers Include="$(OutputRID)" Imports="$(OutputRIDParent)" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
</ItemGroup>
<ItemGroup>

View File

@ -11,11 +11,6 @@
<RuntimeIdentifier>$(OutputRID)</RuntimeIdentifier>
<!-- Set the apphost RID so we download the apphost pack if needed. -->
<AppHostRuntimeIdentifier>$(OutputRID)</AppHostRuntimeIdentifier>
<!--
If the output RID isn't the current SDK RID and we have a "base" RID, then the output RID isn't known to the SDK.
In that case, we need to set the AppHostRuntimeIdentifier to the base RID so the SDK can find a runtime pack for publishing.
-->
<AppHostRuntimeIdentifier Condition="'$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)' and '$(BaseOS)' != '' ">$(BaseOS)</AppHostRuntimeIdentifier>
<UseLocalAppHostPack>true</UseLocalAppHostPack>
<!-- Don't use the local apphost pack on Windows as matching linker configurations is difficult. -->
<UseLocalAppHostPack Condition="'$(TargetOS)' == 'windows'">false</UseLocalAppHostPack>
@ -123,6 +118,7 @@
<Target Name="GetBuildArgumentsForDNNE"
DependsOnTargets="ResolveFrameworkReferences;
UpdateLocalAppHostPack;
GetUnixBuildArgumentsForDNNE;
GetAppleBuildArgumentsForDNNE;
GetUnixCrossBuildArgumentsForDNNE"
@ -131,4 +127,11 @@
<DnneNetHostDir>$([System.IO.Path]::GetDirectoryName('$(AppHostSourcePath)'))</DnneNetHostDir>
</PropertyGroup>
</Target>
<Target Name="SetRidGraphPath"
BeforeTargets="ProcessFrameworkReferences">
<PropertyGroup>
<RuntimeIdentifierGraphPath Condition="'$(UseBootstrap)' == 'true'">$([MSBuild]::NormalizePath('$(BootstrapRidGraphDir)', 'runtime.json'))</RuntimeIdentifierGraphPath>
</PropertyGroup>
</Target>
</Project>

View File

@ -0,0 +1,4 @@
<Project>
<Import Project="..\Directory.Build.targets" />
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" Condition="'$(UseBootstrapLayout)' == 'true'" />
</Project>