dotnet-installer/src/SourceBuild
dotnet-maestro-bot 6791ff652b
[automated] Merge branch 'release/6.0.2xx' => 'release/6.0.3xx' (#13461)
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220309.1

Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 6.0.0-servicing.22158.2 -> To Version 6.0.0-servicing.22159.1

* Update source-build with 6.0.103 artifacts

* Disable public source-build tarball ci (#13377)

* Fix invalid pipeline trigger.

* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220310.1

Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 6.0.0-servicing.22159.1 -> To Version 6.0.0-servicing.22160.1

* Update dependencies from https://github.com/dotnet/arcade build 20220309.8

Microsoft.DotNet.CMake.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
 From Version 6.0.0-beta.22122.7 -> To Version 6.0.0-beta.22159.8

* Remove maui workloads from 6.0.100

The old workloads break MU so we either have to update them or remove them.

* Only do signcheck if there are files to sign check

* Remove template text-only packages which are alread included in source-build (#13380)

* Update dependencies from https://github.com/dotnet/arcade build 20220311.1

Microsoft.DotNet.CMake.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
 From Version 6.0.0-beta.22159.8 -> To Version 6.0.0-beta.22161.1

* Update source-build MsftToSbSdk.diff baseline (#13400)

* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220311.1

Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 6.0.0-servicing.22160.1 -> To Version 6.0.0-servicing.22161.1

* [release/6.0.1xx] Windows SDK projection update

* [release/6.0.1xx] dotnet watch smoke test (#13392)

* add dotnet watch smoke test

* Fix issue with BundledTemplates condition

* Make a source-build targetted fix to unblock release

* Fix issue with BundledTemplates condition

* Make a source-build targetted fix to unblock release

* Refactor build.sh to optimize PackageVersions.props retrieval (#13443)

* Update NuGet path issue in Run Tests CI step (#13453)

* Refactor SdkContentTests to warn on diffs when run in CI (#13432)

* Revert the Versions.props file

* Revert the Versions.props file

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: MichaelSimons <msimons@microsoft.com>
Co-authored-by: v-wuzhai <46013274+v-wuzhai@users.noreply.github.com>
Co-authored-by: Marc Paine <marcpop@microsoft.com>
Co-authored-by: Jason Zhai <v-wuzhai@microsoft.com>
Co-authored-by: Manodasan Wignarajah <mawign@microsoft.com>
Co-authored-by: Logan Bussell <loganbussell@microsoft.com>
2022-03-25 09:58:21 -07:00
..
Arcade [automated] Merge branch 'release/6.0.2xx' => 'release/6.0.3xx' (#13461) 2022-03-25 09:58:21 -07:00
tarball [automated] Merge branch 'release/6.0.2xx' => 'release/6.0.3xx' (#13461) 2022-03-25 09:58:21 -07:00
README.md aspnetcore stable version workaround 2021-10-21 17:19:38 +00:00

Source-Build

This directory contains files necessary to generate a tarball that can be used to build .NET from source.

For more information, see 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.
  2. ./build.sh /p:ArcadeBuildTarball=true /p:TarballDir=/repos/tarball1 /p:PreserveTarballGitFolders=true
    • The TarballDir can be anywhere you want outside of the repository.
  3. cd /repos/tarball1
  4. ./prep.sh
  5. ./build.sh --online
  6. 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.
  7. 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
  8. 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

Creating a patch file

To create a repo patch file, first commit your changes to the repo as normal, then run this command inside the repo to generate a patch file inside the repo:

git format-patch --zero-commit --no-signature -1

Then, move the patch file into this repo, at src/SourceBuild/tarball/patches/<repo>.

If you define PATCH_DIR to point at the patches directory, you can use -o to place the patch file directly in the right directory:

git format-patch --zero-commit --no-signature -1 -o "$PATCH_DIR/<repo>"

After generating the patch file, the numeric prefix on the filename may need to be changed. By convention, new patches should be one number above the largest number that already exists in the patch file directory. If there's a gap in the number sequence, do not fix it (generally speaking), to avoid unnecessary diffs and potential merge conflicts.

To apply a patch, or multiple patches, use git am while inside the target repo. For example, to apply all sdk patches onto a fresh clone of the sdk repository that has already been checked out to the correct commit, use:

git am "$PATCH_DIR/sdk/*"

This creates a Git commit with the patch contents, so you can easily amend a patch or create a new commit on top that you can be sure will apply cleanly.

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.