Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.307
Choose a base ref
...
head repository: dotnet/sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 8,495 changed files with 968,314 additions and 226,176 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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.25081.2",
"commands": [
"darc"
]
}
}
}
10 changes: 10 additions & 0 deletions .config/tsaoptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"instanceUrl": "https://devdiv.visualstudio.com/",
"template": "TFSDEVDIV",
"projectName": "DEVDIV",
"areaPath": "DevDiv\\NET Tools\\SDK",
"iterationPath": "DevDiv",
"notificationAliases": [ "dotnetdevexcli@microsoft.com" ],
"repositoryName": "dotnet-sdk",
"codebaseName": "dotnet-sdk"
}
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "dotnet",
"image": "mcr.microsoft.com/devcontainers/base:debian",
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csdevkit",
"EditorConfig.EditorConfig",
"DavidAnson.vscode-markdownlint"
]
}
},
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash -i ${containerWorkspaceFolder}/.devcontainer/scripts/post-creation.sh",
// Add the locally installed dotnet to the path to ensure that it is activated
// This is needed so that things like the C# extension can resolve the correct SDK version
"remoteEnv": {
"PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}",
"DOTNET_INSTALL_DIR": "${containerWorkspaceFolder}/.dotnet",
"DOTNET_MULTILEVEL_LOOKUP": "0",
"DOTNET_ROOT": "${containerWorkspaceFolder}/.dotnet",
"DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR": "${containerWorkspaceFolder}/.dotnet",
"NUGET_PACKAGES": "/home/vscode/.nuget/packages"
}
}
4 changes: 4 additions & 0 deletions .devcontainer/scripts/post-creation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Install SDK and tool dependencies before container starts
# Also run the full restore on the repo so that go-to definition
# and other language features will be available in C# files
./restore.sh
61 changes: 61 additions & 0 deletions .devcontainer/vmr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!--
######## ######## ### ######## ######## ## ## #### ######
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ##
######## ###### ## ## ## ## ## ######### ## ######
## ## ## ######### ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ######## ## ## ######## ## ## ## #### ######
-->

This Codespace allows you to debug or make changes to the .NET SDK product. In case you ran this
from a `dotnet/sdk` PR branch, the directory tree contains the VMR (`dotnet/dotnet`) checked out into
`/workspaces/dotnet` with the PR changes pulled into it. Building the VMR from the codespace mimics
what the VMR pipelines in an sdk PR are doing. The build takes about 45-75 minutes
(depending on the machine spec and target OS) and, after completion, produces an archived .NET SDK located in
`/workspaces/dotnet/artifacts/assets/Release`.

## Build the SDK

To build the repository, run one of the following:
```bash
# Microsoft based build
./build.sh
```
or

```bash
# Building from source only
./prep-source-build.sh && ./build.sh -sb
```

> 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/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:centos-stream9",
"hostRequirements": {
// A completely source built .NET is >64 GB with all the repos/artifacts
"storage": "128gb"
},
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csharp"
]
},
"codespaces": {
"openFiles": [
"sdk/.devcontainer/vmr/README.md"
]
}
},
"onCreateCommand": "${containerWorkspaceFolder}/sdk/.devcontainer/vmr/init.sh",
"workspaceFolder": "/workspaces"
}
30 changes: 30 additions & 0 deletions .devcontainer/vmr/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 )"

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

cp "$sdk_dir/.devcontainer/vmr/synchronize-vmr.sh" "$workspace_dir"

mkdir -p "$tmp_dir"

# Codespaces performs a shallow fetch only
git -C "$sdk_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 "$sdk_dir" log --pretty=format:'%D' HEAD^ \
| grep 'origin/' \
| head -n1 \
| sed 's@origin/@@' \
| sed 's@,.*@@')

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

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

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