Skip to content

Commit

Permalink
Merge branch 'release/9.0.1xx' of https://github.com/dotnet/sdk into …
Browse files Browse the repository at this point in the history
…merge/release/8.0.4xx-to-release/9.0.1xx
  • Loading branch information
v-wuzhai committed Sep 5, 2024
2 parents a709c71 + d3e7499 commit 3634c1f
Show file tree
Hide file tree
Showing 5,866 changed files with 627,664 additions and 144,504 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.24367.3",
"commands": [
"darc"
]
}
}
}
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:fedora-39",
"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" --debug

(cd "$vmr_dir" && ./prep-source-build.sh)
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 $*)
22 changes: 16 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
spelling_exclusion_path = ./exclusion.dic

[*.json]
indent_size = 2
Expand Down Expand Up @@ -273,11 +274,13 @@ dotnet_diagnostic.IDE0043.severity = warning
dotnet_diagnostic.IDE0062.severity = warning
# ConvertTypeOfToNameOf
dotnet_diagnostic.IDE0082.severity = warning
# Remove unnecessary lambda expression
dotnet_diagnostic.IDE0200.severity = none
# Remove redundant nullable directive
dotnet_diagnostic.IDE0240.severity = warning

# Additional rules for template engine source code
[src/**{Microsoft.TemplateEngine.*,dotnet-new?*}/**.cs]
[{src,test}/**{Microsoft.TemplateEngine.*,dotnet-new?*}/**.cs]
# Default analyzed API surface = 'public' (public APIs)
dotnet_code_quality.api_surface = public
# Provide ObsoleteAttribute message
Expand Down Expand Up @@ -313,7 +316,7 @@ dotnet_diagnostic.CA1838.severity = warning
# Use 'Environment.CurrentManagedThreadId'
dotnet_diagnostic.CA1840.severity = warning
# Consider calling ConfigureAwait on the awaited task
dotnet_diagnostic.CA2007.severity = warning
dotnet_diagnostic.CA2007.severity = none
# Do not create tasks without passing a TaskScheduler
dotnet_diagnostic.CA2008.severity = warning
# Use ValueTasks correctly
Expand Down Expand Up @@ -442,7 +445,7 @@ dotnet_diagnostic.SA1642.severity = none
dotnet_diagnostic.SA1649.severity = none

# Disable some StyleCop rules for test common Program.cs that is linked to test project of template engine
[src/Tests/Common/Program.cs]
[test/Common/Program.cs]
# Declare types in namespaces
dotnet_diagnostic.CA1050.severity = none
# Elements should be documented
Expand All @@ -453,7 +456,7 @@ dotnet_diagnostic.SA1601.severity = none
dotnet_diagnostic.SA1633.severity = none

# Additional rules for test source code for template engine
[src/Tests/{Microsoft.TemplateEngine.*,dotnet-new.Tests}/**.cs]
[test/{Microsoft.TemplateEngine.*,dotnet-new.Tests}/**.cs]
# Test methods should not be skipped
dotnet_diagnostic.xUnit1004.severity = warning
# Elements should appear in the correct order
Expand Down Expand Up @@ -503,5 +506,12 @@ dotnet_diagnostic.IDE0040.severity = warning
[*.txt]
insert_final_newline = false

[src/Tests/dotnet-new.Tests/**/Approvals/**]
trim_trailing_whitespace = false
# Verify settings
[*.{received,verified}.{txt,xml,json}]
charset = "utf-8-bom"
end_of_line = lf
indent_size = unset
indent_style = unset
insert_final_newline = false
tab_width = unset
trim_trailing_whitespace = false
7 changes: 6 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@

*.jpg binary
*.png binary
*.gif binary
*.gif binary

# VerifyTests
*.verified.txt text eol=lf working-tree-encoding=UTF-8
*.verified.xml text eol=lf working-tree-encoding=UTF-8
*.verified.json text eol=lf working-tree-encoding=UTF-8
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ contact_links:
- name: Issue with .NET runtime or core .NET libraries
url: https://github.com/dotnet/runtime/issues/new/choose
about: Please open issues relating to the .NET runtime or core .NET libraries in dotnet/runtime.
- name: Issue with .NET SDK
url: https://github.com/dotnet/sdk/issues/new/choose
about: Please open issues relating to the .NET SDK itself in dotnet/sdk.
- name: Issue with Entity Framework Core
url: https://github.com/dotnet/efcore/issues/new/choose
about: Please open issues relating to Entity Framework Core in dotnet/efcore.
- name: Issue with Roslyn compiler
url: https://github.com/dotnet/roslyn/issues/new/choose
about: Please open issues relating to the Roslyn .NET compiler in dotnet/roslyn.
about: Please open issues relating to the Roslyn .NET compiler in dotnet/roslyn.
18 changes: 9 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ updates:
- "dependencies"
- "dependabot: main"

- package-ecosystem: "nuget"
directory: "/eng/dependabot"
open-pull-requests-limit: 10
schedule:
interval: "weekly"
target-branch: "release/7.0.4xx"
labels:
- "dependencies"
- "dependabot: 7.0.4xx"
# - package-ecosystem: "nuget"
# directory: "/eng/dependabot"
# open-pull-requests-limit: 10
# schedule:
# interval: "weekly"
# target-branch: "release/8.0.1xx"
# labels:
# - "dependencies"
# - "dependabot: 8.0.1xx"
Loading

0 comments on commit 3634c1f

Please sign in to comment.