Add Codespaces for source build investigations (#15285)
This commit is contained in:
parent
1670d4fa6e
commit
f71904833c
7 changed files with 98 additions and 4 deletions
27
.devcontainer/vmr-source-build/README.md
Normal file
27
.devcontainer/vmr-source-build/README.md
Normal file
|
@ -0,0 +1,27 @@
|
|||
<!--
|
||||
######## ######## ### ######## ######## ## ## #### ######
|
||||
## ## ## ## ## ## ## ## ## ## ## ## ##
|
||||
## ## ## ## ## ## ## ## ## ## ## ##
|
||||
######## ###### ## ## ## ## ## ######### ## ######
|
||||
## ## ## ######### ## ## ## ## ## ## ##
|
||||
## ## ## ## ## ## ## ## ## ## ## ## ##
|
||||
## ## ######## ## ## ######## ## ## ## #### ######
|
||||
-->
|
||||
|
||||
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 in `/workspaces/artifacts/x64/Release`.
|
||||
|
||||
To build the VMR, run following:
|
||||
```bash
|
||||
cd /workspaces/dotnet
|
||||
unset RepositoryName
|
||||
./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.
|
||||
|
||||
For more details, see the instructions at https://github.com/dotnet/dotnet.
|
24
.devcontainer/vmr-source-build/devcontainer.json
Normal file
24
.devcontainer/vmr-source-build/devcontainer.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
// 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": [
|
||||
".devcontainer/vmr-source-build/README.md"
|
||||
]
|
||||
}
|
||||
},
|
||||
"onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/vmr-source-build/init.sh"
|
||||
}
|
35
.devcontainer/vmr-source-build/init.sh
Normal file
35
.devcontainer/vmr-source-build/init.sh
Normal file
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
source="${BASH_SOURCE[0]}"
|
||||
script_root="$( cd -P "$( dirname "$source" )" && pwd )"
|
||||
|
||||
# TODO: Remove once we have a new version of the image
|
||||
dnf -y install openssl1.1
|
||||
|
||||
installer_dir=$(realpath "$script_root/../..")
|
||||
workspace_dir=$(realpath "$installer_dir/../")
|
||||
tmp_dir=$(realpath "$workspace_dir/tmp")
|
||||
vmr_dir=$(realpath "$workspace_dir/dotnet")
|
||||
|
||||
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 log --pretty=format:'%D' HEAD^ | grep 'origin/' | head -n1 | sed 's@origin/@@' | sed 's@,.*@@')
|
||||
|
||||
"$installer_dir/eng/vmr-sync.sh" \
|
||||
--vmr "$vmr_dir" \
|
||||
--tmp "$tmp_dir" \
|
||||
--branch "$vmr_branch" \
|
||||
--debug
|
||||
|
||||
# Run prep.sh
|
||||
unset RepositoryName
|
||||
pushd "$vmr_dir"
|
||||
./prep.sh
|
||||
popd
|
Loading…
Add table
Add a link
Reference in a new issue