Update the src/SourceBuild readme (#15214)

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
This commit is contained in:
Michael Simons 2023-01-09 09:52:10 -06:00 committed by GitHub
parent cd34038e97
commit f7a7fed049
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,38 +1,22 @@
# Source-Build
This directory contains files necessary to generate a tarball that can be used
to build .NET from source.
This directory contains the .NET source build infrastructure.
For more information, see
[dotnet/source-build](https://github.com/dotnet/source-build).
_content_ - source build infrastructure mirrored to [dotnet/dotnet](https://github.com/dotnet/dotnet)
[VMR](https://github.com/dotnet/arcade/blob/main/Documentation/UnifiedBuild/VMR-Design-And-Operation.md).
_patches_ - repo patches needed for .NET source build. Typically these are ephemeral to workaround integration
issues. Patches should always have a tracking issue/pr to backport the fix or address the underlying issue
being worked around.
For more information, see [dotnet/source-build](https://github.com/dotnet/source-build).
## Local development workflow
These are the steps used by some members of the .NET source-build team to create
a tarball and build it on a local machine as part of the development cycle:
1. Check out this repository and open a command line in the directory.
1. `./build.sh /p:ArcadeBuildTarball=true /p:TarballDir=/repos/tarball1 /p:PreserveTarballGitFolders=true`
* The `TarballDir` can be anywhere you want outside of the repository.
1. `cd /repos/tarball1`
1. `./prep.sh`
1. `./build.sh --online`
1. Examine results and make changes to the source code in the tarball. The
`.git` folders are preserved, so you can commit changes and save them as
patches.
1. When a repo builds, source-build places a `.complete` file to prevent it from
rebuilding again. This allows you to incrementally retry a build if there's a
transient failure. But it also prevents you from rebuilding a repo after
you've modified it.
* To force a repo to rebuild with your new changes, run:
`rm -f ./artifacts/obj/semaphores/<repo>/Build.complete`
1. Run `./build.sh --online` again, and continue to repeat as necessary.
When developing a prebuilt removal change, examine the results of the build,
specifically:
* Prebuilt report. For example:
`./src/runtime.733a3089ec6945422caf06035c18ff700c9d51be/artifacts/source-build/self/prebuilt-report`
When making changes to the source build infrastructure, devs would typically make and test the
changes in a local clone of [dotnet/dotnet](https://github.com/dotnet/dotnet). Once complete
you would copy the changed files here and make a PR. To validate the end to end experience, you
can synchronize the VMR with any changes made here by running [eng/vmr-sync.sh](https://github.com/dotnet/installer/blob/main/eng/vmr-sync.sh).
## Creating a patch file
@ -74,4 +58,5 @@ There is a method to create a series of patches based on a range of Git commits,
but this is not usually useful for 6.0 main development. It is used in servicing
to "freshen up" the sequence of patches (resolve conflicts) all at once.
Note: Tarballs have already applied patches to the source code.
> Note: The VMR has all of the `src/SourceBuild/patches` applied. This is done as part of the
[synchronization process](https://github.com/dotnet/arcade/blob/main/Documentation/UnifiedBuild/VMR-Design-And-Operation.md#source-build-patches).