Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.5k
Add bootstrapping build mechanism and enable for SourceBuild#114285
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
2c52e807c8bc6ec5a67c05fc4b0a3ae8a10ae6824b6c353f84d69c06b22b99c64667efc12698ab631070efeda560b066ed59c078ff23c6419400e952d6e806de101ab54630a94c611b19fb4c78bc6ec22d798f2aef6a6f8053dcaed109c64e494fa9feff1e179115e3cbc3b61ab7e4e7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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> | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is good for me. I wonder if MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't use that by itself because that would cause this to trigger on some (but not all) Unified Build legs. For Unified Build, we'll want this on either for 100% of the verticals or never. | ||
| <!-- 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> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) | ||
jkoritzinsky marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| 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 | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.