-
Notifications
You must be signed in to change notification settings - Fork 138
Add how to documentation for stage 2 builds #5277
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
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # How to run a stage 2 build | ||
|
|
||
| This document describes how to perform a stage 2 source build. | ||
|
|
||
| ## What is a stage 2 build | ||
|
|
||
| A **stage 2 build** is when you run a source build, then take the SDK and packages produced by that build and use them to rebuild the product. | ||
| Stage 2 builds are essential for validating a source‑built product. | ||
|
|
||
| It’s common for stage 2 builds to surface issues. | ||
| For example, if a new Roslyn analyzer is included in the SDK, it can introduce new build errors during the stage 2 build. | ||
| These issues must be resolved for the product to be considered **source‑buildable**. | ||
|
|
||
| The process of using built SDK and artifacts to rebuild the product is often called **bootstrapping**. | ||
| Distribution maintainers use it to initiate the build process: build once using the Microsoft SDK and artifacts, then rebuild using the resulting SDK and artifacts. | ||
|
|
||
| ## Steps to run a stage 2 build | ||
|
|
||
| 1. Run a stage 1 build | ||
|
|
||
| ```bash | ||
| git clone https://github.com/dotnet/dotnet.git dotnet1 | ||
| pushd dotnet1 | ||
| ./prep-source-build.sh | ||
| ./build.sh -sb | ||
| popd | ||
| ``` | ||
|
|
||
| 2. Run a stage 2 build | ||
|
|
||
| ``` bash | ||
| mkdir -p stage1/sdk stage1/packages | ||
|
|
||
| tar -xf dotnet1/artifacts/assets/Release/Private.SourceBuilt.Artifacts.*.tar.gz -C stage1/packages | ||
|
|
||
| tar -xf dotnet1/artifacts/assets/Release/Sdk/*/dotnet-sdk-*.tar.gz -C stage1/sdk | ||
|
|
||
| git clone https://github.com/dotnet/dotnet.git dotnet2 | ||
| pushd dotnet2 | ||
| ./build.sh -sb --with-packages stage1/packages --with-sdk stage1/sdk | ||
| popd | ||
| ``` | ||
|
|
||
| > **Note:** `prep-source-build.sh` is optional for stage 2. It is only needed if you want to remove checked‑in binaries before building. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.