Skip to content

Commit

Permalink
Merge branch 'release/8.0.1xx' of https://github.com/dotnet/installer
Browse files Browse the repository at this point in the history
…into merge/release/6.0.4xx-to-release/8.0.1xx
  • Loading branch information
v-wuzhai committed Oct 11, 2024
2 parents dd54f04 + dcd137d commit 5691111
Show file tree
Hide file tree
Showing 539 changed files with 16,395 additions and 13,535 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"microsoft.dotnet.darc": {
"version": "1.1.0-beta.23621.3",
"commands": [
"darc"
]
}
}
}
55 changes: 55 additions & 0 deletions .devcontainer/vmr-source-build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!--
######## ######## ### ######## ######## ## ## #### ######
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ##
######## ###### ## ## ## ## ## ######### ## ######
## ## ## ######### ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ######## ## ## ######## ## ## ## #### ######
-->

This Codespace can help you debug the source build of .NET. In case you have run this from a
`dotnet/installer` PR branch, it will contain the VMR (`dotnet/dotnet`) checked out into
`/workspaces/dotnet` with the PR changes pulled into it. You can then attempt to source-build
the VMR which is what the VMR leg in the installer PR build doing. This build takes about 45
minutes and, after completion, produces an archived .NET SDK located in
`/workspaces/dotnet/artifacts/x64/Release`.

## Build the SDK

To build the VMR, run following:
```bash
cd /workspaces/dotnet
./build.sh --online
```

> Please note that, at this time, the build modifies some of the checked-in sources so it might
be preferential to rebuild the Codespace between attempts (or reset the working tree changes).

For more details, see the instructions at https://github.com/dotnet/dotnet.

## Synchronize your changes in locally

When debugging the build, you have two options how to test your changes in this environment.

### Making changes to the VMR directly

You can make the changes directly to the local checkout of the VMR at `/workspaces/dotnet`. You
can then try to build the VMR and see if the change works for you.

### Pull changes into the Codespace from your fork

You can also make a fix in the individual source repository (e.g. `dotnet/runtime`) and push the
fix into a branch; can be in your fork too. Once you have the commit pushed, you can pull this
version of the repository into the Codespace by running:

```
/workspaces/synchronize-vmr.sh \
--repository <repo>:<commit, tag or branch> \
--remote <repo>:<fork URI>
```

You can now proceed building the VMR in the Codespace using instructions above. You can repeat
this process and sync a new commit from your fork. Only note that, at this time, Source-Build
modifies some of the checked-in sources so you'll need to revert the working tree changes
between attempts.
25 changes: 25 additions & 0 deletions .devcontainer/vmr-source-build/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Container suitable for investigating issues with source build
// Contains the VMR (dotnet/dotnet) with applied changes from the current PR
// The container supports source-building the SDK
{
"name": "VMR with PR changes",
"image": "mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-36",
"hostRequirements": {
// A completely source built .NET is >64 GB with all the repos/artifacts
"storage": "128gb"
},
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csharp"
]
},
"codespaces": {
"openFiles": [
"installer/.devcontainer/vmr-source-build/README.md"
]
}
},
"onCreateCommand": "${containerWorkspaceFolder}/installer/.devcontainer/vmr-source-build/init.sh",
"workspaceFolder": "/workspaces"
}
30 changes: 30 additions & 0 deletions .devcontainer/vmr-source-build/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -ex

source="${BASH_SOURCE[0]}"
script_root="$( cd -P "$( dirname "$source" )" && pwd )"

installer_dir=$(realpath "$script_root/../..")
workspace_dir=$(realpath "$installer_dir/../")
tmp_dir=$(realpath "$workspace_dir/tmp")
vmr_dir=$(realpath "$workspace_dir/dotnet")

cp "$installer_dir/.devcontainer/vmr-source-build/synchronize-vmr.sh" "$workspace_dir"

mkdir -p "$tmp_dir"

# Codespaces performs a shallow fetch only
git -C "$installer_dir" fetch --all --unshallow

# We will try to figure out, which branch is the current (PR) branch based off of
# We need this to figure out, which VMR branch to use
vmr_branch=$(git -C "$installer_dir" log --pretty=format:'%D' HEAD^ \
| grep 'origin/' \
| head -n1 \
| sed 's@origin/@@' \
| sed 's@,.*@@')

"$workspace_dir/synchronize-vmr.sh" --branch "$vmr_branch" --debug

(cd "$vmr_dir" && ./prep.sh)
4 changes: 4 additions & 0 deletions .devcontainer/vmr-source-build/synchronize-vmr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

(cd /workspaces/installer \
&& ./eng/vmr-sync.sh --vmr /workspaces/dotnet --tmp /workspaces/tmp $*)
Loading

0 comments on commit 5691111

Please sign in to comment.