Skip to content

Commit 52021b4

Browse files
authored
Merge pull request #57637 from JoeRobich/update-to-net6.0GA
Use the .NET 6.0 SDK for building (Arcade7)
2 parents bbd4111 + 27ba7fd commit 52021b4

18 files changed

+194
-141
lines changed

docs/contributing/Building, Debugging, and Testing on Unix.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Building, Debugging and Testing on Unix
2-
This guide is meant to help developers setup an environment for debugging / contributing to Roslyn from Linux.
3-
Particularly for developers who aren't experienced with .NET Core development on Linux.
2+
This guide is meant to help developers setup an environment for debugging / contributing to Roslyn from Linux.
3+
Particularly for developers who aren't experienced with .NET Core development on Linux.
44

55
## Working with the code
66
1. Ensure the commands `git` and `curl` are available
@@ -12,7 +12,7 @@ Particularly for developers who aren't experienced with .NET Core development on
1212
1. Install [VS Code](https://code.visualstudio.com/Download)
1313
- After you install VS Code, install the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)
1414
- Important tip: You can look up editor commands by name by hitting *Ctrl+Shift+P*, or by hitting *Ctrl+P* and typing a `>` character. This will help you get familiar with editor commands mentioned below. On a Mac, use ** instead of *Ctrl*.
15-
2. Install the [.NET 6.0 RC 2 SDK](https://dotnet.microsoft.com/download/dotnet-core/6.0).
15+
2. Install the [.NET 6.0 SDK](https://dotnet.microsoft.com/download/dotnet-core/6.0).
1616
3. You can build from VS Code by running the *Run Build Task* command, then selecting an appropriate task such as *build* or *build current project* (the latter builds the containing project for the current file you're viewing in the editor).
1717
4. You can run tests from VS Code by opening a test class in the editor, then using the *Run Tests in Context* and *Debug Tests in Context* editor commands. You may want to bind these commands to keyboard shortcuts that match their Visual Studio equivalents (**Ctrl+R, T** for *Run Tests in Context* and **Ctrl+R, Ctrl+T** for *Debug Tests in Context*).
1818

@@ -23,14 +23,14 @@ To run all tests in a single project, it's recommended to use the `dotnet test p
2323

2424
## GitHub
2525
The best way to clone and push is to use SSH. On Windows you typically use HTTPS and this is not directly compatible
26-
with two factor authentication (requires a PAT). The SSH setup is much simpler and GitHub has a great HOWTO for
26+
with two factor authentication (requires a PAT). The SSH setup is much simpler and GitHub has a great HOWTO for
2727
getting this setup.
2828

2929
https://help.github.com/articles/connecting-to-github-with-ssh/
3030

3131
## Debugging test failures
3232
The best way to debug is using lldb with the SOS plugin. This is the same SOS as used in WinDbg and if you're familiar
33-
with it then lldb debugging will be pretty straight forward.
33+
with it then lldb debugging will be pretty straight forward.
3434

3535
The [dotnet/diagnostics](https://github.com/dotnet/diagnostics) repo has more information:
3636

@@ -45,10 +45,10 @@ CoreCLR also has some guidelines for specific Linux debugging scenarios:
4545

4646
Corrections:
4747
- LLDB and createdump must be run as root
48-
- `dotnet tool install -g dotnet-symbol` must be run from `$HOME`
48+
- `dotnet tool install -g dotnet-symbol` must be run from `$HOME`
4949

5050
### Core Dumps
51-
The CoreClr does not used the standard core dumping mechanisms on Linux. Instead you must specify via
51+
The CoreClr does not used the standard core dumping mechanisms on Linux. Instead you must specify via
5252
environment variables that you want a core dump to be produced. The simplest setup is to do the following:
5353

5454
```
@@ -79,12 +79,12 @@ indeed crashing in the GC.
7979
Note: this variables can also be used on Windows as well.
8080

8181
## Ubuntu 18.04
82-
The recommended OS for developing Roslyn is Ubuntu 18.04. This guide was written using Ubuntu 18.04 but should be
82+
The recommended OS for developing Roslyn is Ubuntu 18.04. This guide was written using Ubuntu 18.04 but should be
8383
applicable to most Linux environments. Ubuntu 18.04 was chosen here due to it's support for enhanced VMs in Hyper-V.
8484
This makes it easier to use from a Windows machine: full screen, copy / paste, etc ...
8585

8686
### Hyper-V
87-
Hyper-V has a builtin Ubuntu 18.04 image which supports enhanced mode. Here is a tutorial for creating
87+
Hyper-V has a builtin Ubuntu 18.04 image which supports enhanced mode. Here is a tutorial for creating
8888
such an image:
8989

9090
https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/quick-create-virtual-machine
@@ -93,10 +93,10 @@ When following this make sure to:
9393
1. Click Installation Source and uncheck "Windows Secure Boot"
9494
1. Complete the Ubuntu installation wizard. Full screen mode won't be available until this is done.
9595

96-
Overall this takes about 5-10 minutes to complete.
96+
Overall this takes about 5-10 minutes to complete.
9797

9898
### Source Link
99-
Many of the repositories that need to be built use source link and it crashes on Ubuntu 18.04 due to dependency changes.
99+
Many of the repositories that need to be built use source link and it crashes on Ubuntu 18.04 due to dependency changes.
100100
To disable source link add the following to the `Directory.Build.props` file in the root of the repository.
101101

102102
``` xml
@@ -109,6 +109,6 @@ To disable source link add the following to the `Directory.Build.props` file in
109109
Make sure to install the following via `apt install`
110110

111111
- clang
112-
- lldb
112+
- lldb
113113
- cmake
114114
- xrdp

docs/contributing/Building, Debugging, and Testing on Windows.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The minimal required version of .NET Framework is 4.7.2.
2020
- Ensure Visual Studio is on Version "17.0" or greater
2121
- Ensure "Use previews of the .NET Core SDK" is checked in Tools -> Options -> Environment -> Preview Features
2222
- Restart Visual Studio
23-
1. [.NET 6.0 RC 2 SDK](https://dotnet.microsoft.com/download/dotnet-core/6.0) [Windows x64 installer](https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-6.0.100-rc.2-windows-x64-installer)
23+
1. [.NET 6.0 SDK](https://dotnet.microsoft.com/download/dotnet-core/6.0) [Windows x64 installer](https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-6.0.100-windows-x64-installer)
2424
1. [PowerShell 5.0 or newer](https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell). If you are on Windows 10, you are fine; you'll only need to upgrade if you're on earlier versions of Windows. The download link is under the ["Upgrading existing Windows PowerShell"](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell) heading.
2525
1. Run Restore.cmd
2626
1. Open Roslyn.sln

eng/Version.Details.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
</Dependency>
1414
</ProductDependencies>
1515
<ToolsetDependencies>
16-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.21474.2">
16+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.21566.10">
1717
<Uri>https://github.com/dotnet/arcade</Uri>
18-
<Sha>3ea0d860c6973f2cbadc9e895c7ec2cbdaec4ad5</Sha>
18+
<Sha>53cc1bc2e555aa7aea95884575d22e21d63708cf</Sha>
1919
<SourceBuild RepoName="arcade" ManagedOnly="true" />
2020
</Dependency>
2121
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.0.0-5.21469.2">
2222
<Uri>https://github.com/dotnet/roslyn</Uri>
2323
<Sha>c1d8c6f043bc80425c6828455eb57f8a404759c6</Sha>
2424
</Dependency>
25-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.21474.2">
25+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.21566.10">
2626
<Uri>https://github.com/dotnet/arcade</Uri>
27-
<Sha>3ea0d860c6973f2cbadc9e895c7ec2cbdaec4ad5</Sha>
27+
<Sha>53cc1bc2e555aa7aea95884575d22e21d63708cf</Sha>
2828
</Dependency>
2929
</ToolsetDependencies>
3030
</Dependencies>

eng/common/msbuild.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Param(
66
[switch] $ci,
77
[switch] $prepareMachine,
88
[switch] $excludePrereleaseVS,
9+
[string] $msbuildEngine = $null,
910
[Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs
1011
)
1112

eng/common/native/init-compiler.sh

+12-10
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@
33
# This file detects the C/C++ compiler and exports it to the CC/CXX environment variables
44
#
55

6-
if [[ "$#" -lt 2 ]]; then
6+
if [[ "$#" -lt 3 ]]; then
77
echo "Usage..."
8-
echo "init-compiler.sh <Architecture> <compiler> <compiler major version> <compiler minor version>"
8+
echo "init-compiler.sh <script directory> <Architecture> <compiler> <compiler major version> <compiler minor version>"
9+
echo "Specify the script directory."
910
echo "Specify the target architecture."
1011
echo "Specify the name of compiler (clang or gcc)."
1112
echo "Specify the major version of compiler."
1213
echo "Specify the minor version of compiler."
1314
exit 1
1415
fi
1516

16-
. "$( cd -P "$( dirname "$0" )" && pwd )"/../pipeline-logging-functions.sh
17-
18-
build_arch="$1"
19-
compiler="$2"
17+
nativescriptroot="$1"
18+
build_arch="$2"
19+
compiler="$3"
2020
cxxCompiler="$compiler++"
21-
majorVersion="$3"
22-
minorVersion="$4"
21+
majorVersion="$4"
22+
minorVersion="$5"
23+
24+
. "$nativescriptroot"/../pipeline-logging-functions.sh
2325

2426
# clear the existing CC and CXX from environment
2527
CC=
@@ -48,8 +50,8 @@ if [[ -z "$CLR_CC" ]]; then
4850
# Set default versions
4951
if [[ -z "$majorVersion" ]]; then
5052
# note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero.
51-
if [[ "$compiler" == "clang" ]]; then versions=( 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
52-
elif [[ "$compiler" == "gcc" ]]; then versions=( 11 10 9 8 7 6 5 4.9 ); fi
53+
if [[ "$compiler" == "clang" ]]; then versions=( 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
54+
elif [[ "$compiler" == "gcc" ]]; then versions=( 12 11 10 9 8 7 6 5 4.9 ); fi
5355

5456
for version in "${versions[@]}"; do
5557
parts=(${version//./ })

eng/common/post-build/sourcelink-validation.ps1

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ $RetryWaitTimeInSeconds = 30
2222
# Wait time between check for system load
2323
$SecondsBetweenLoadChecks = 10
2424

25+
if (!$InputPath -or !(Test-Path $InputPath)){
26+
Write-Host "No files to validate."
27+
ExitWithExitCode 0
28+
}
29+
2530
$ValidatePackage = {
2631
param(
2732
[string] $PackagePath # Full path to a Symbols.NuGet package

eng/common/post-build/symbols-validation.ps1

+59-36
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ param(
44
[Parameter(Mandatory = $true)][string] $DotnetSymbolVersion, # Version of dotnet symbol to use
55
[Parameter(Mandatory = $false)][switch] $CheckForWindowsPdbs, # If we should check for the existence of windows pdbs in addition to portable PDBs
66
[Parameter(Mandatory = $false)][switch] $ContinueOnError, # If we should keep checking symbols after an error
7-
[Parameter(Mandatory = $false)][switch] $Clean # Clean extracted symbols directory after checking symbols
7+
[Parameter(Mandatory = $false)][switch] $Clean, # Clean extracted symbols directory after checking symbols
8+
[Parameter(Mandatory = $false)][string] $SymbolExclusionFile # Exclude the symbols in the file from publishing to symbol server
89
)
910

11+
. $PSScriptRoot\..\tools.ps1
1012
# Maximum number of jobs to run in parallel
1113
$MaxParallelJobs = 16
1214

@@ -25,14 +27,28 @@ if ($CheckForWindowsPdbs) {
2527
$WindowsPdbVerificationParam = "--windows-pdbs"
2628
}
2729

30+
$ExclusionSet = New-Object System.Collections.Generic.HashSet[string];
31+
32+
if (!$InputPath -or !(Test-Path $InputPath)){
33+
Write-Host "No symbols to validate."
34+
ExitWithExitCode 0
35+
}
36+
37+
#Check if the path exists
38+
if ($SymbolExclusionFile -and (Test-Path $SymbolExclusionFile)){
39+
[string[]]$Exclusions = Get-Content "$SymbolExclusionFile"
40+
$Exclusions | foreach { if($_ -and $_.Trim()){$ExclusionSet.Add($_)} }
41+
}
42+
else{
43+
Write-Host "Symbol Exclusion file does not exists. No symbols to exclude."
44+
}
45+
2846
$CountMissingSymbols = {
2947
param(
3048
[string] $PackagePath, # Path to a NuGet package
3149
[string] $WindowsPdbVerificationParam # If we should check for the existence of windows pdbs in addition to portable PDBs
3250
)
3351

34-
. $using:PSScriptRoot\..\tools.ps1
35-
3652
Add-Type -AssemblyName System.IO.Compression.FileSystem
3753

3854
Write-Host "Validating $PackagePath "
@@ -118,17 +134,17 @@ $CountMissingSymbols = {
118134
# Save the output and get diagnostic output
119135
$output = & $dotnetSymbolExe --symbols --modules $WindowsPdbVerificationParam $TargetServerParam $FullPath -o $SymbolsPath --diagnostics | Out-String
120136

121-
if (Test-Path $PdbPath) {
122-
return 'PDB'
137+
if ((Test-Path $PdbPath) -and (Test-path $SymbolPath)) {
138+
return 'Module and PDB for Module'
123139
}
124-
elseif (Test-Path $NGenPdb) {
125-
return 'NGen PDB'
140+
elseif ((Test-Path $NGenPdb) -and (Test-Path $PdbPath) -and (Test-Path $SymbolPath)) {
141+
return 'Dll, PDB and NGen PDB'
126142
}
127-
elseif (Test-Path $SODbg) {
128-
return 'DBG for SO'
143+
elseif ((Test-Path $SODbg) -and (Test-Path $SymbolPath)) {
144+
return 'So and DBG for SO'
129145
}
130-
elseif (Test-Path $DylibDwarf) {
131-
return 'Dwarf for Dylib'
146+
elseif ((Test-Path $DylibDwarf) -and (Test-Path $SymbolPath)) {
147+
return 'Dylib and Dwarf for Dylib'
132148
}
133149
elseif (Test-Path $SymbolPath) {
134150
return 'Module'
@@ -142,37 +158,44 @@ $CountMissingSymbols = {
142158
return $null
143159
}
144160

145-
$FileGuid = New-Guid
146-
$ExpandedSymbolsPath = Join-Path -Path $SymbolsPath -ChildPath $FileGuid
147-
148-
$SymbolsOnMSDL = & $FirstMatchingSymbolDescriptionOrDefault `
149-
-FullPath $FileName `
150-
-TargetServerParam '--microsoft-symbol-server' `
151-
-SymbolsPath "$ExpandedSymbolsPath-msdl" `
152-
-WindowsPdbVerificationParam $WindowsPdbVerificationParam
153-
$SymbolsOnSymWeb = & $FirstMatchingSymbolDescriptionOrDefault `
154-
-FullPath $FileName `
155-
-TargetServerParam '--internal-server' `
156-
-SymbolsPath "$ExpandedSymbolsPath-symweb" `
157-
-WindowsPdbVerificationParam $WindowsPdbVerificationParam
158-
159-
Write-Host -NoNewLine "`t Checking file " $FileName "... "
160-
161-
if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) {
162-
Write-Host "Symbols found on MSDL ($SymbolsOnMSDL) and SymWeb ($SymbolsOnSymWeb)"
161+
$FileRelativePath = $FileName.Replace("$ExtractPath\", "")
162+
if (($($using:ExclusionSet) -ne $null) -and ($($using:ExclusionSet).Contains($FileRelativePath) -or ($($using:ExclusionSet).Contains($FileRelativePath.Replace("\", "/"))))){
163+
Write-Host "Skipping $FileName from symbol validation"
163164
}
164-
else {
165-
$MissingSymbols++
166165

167-
if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) {
168-
Write-Host 'No symbols found on MSDL or SymWeb!'
166+
else {
167+
$FileGuid = New-Guid
168+
$ExpandedSymbolsPath = Join-Path -Path $SymbolsPath -ChildPath $FileGuid
169+
170+
$SymbolsOnMSDL = & $FirstMatchingSymbolDescriptionOrDefault `
171+
-FullPath $FileName `
172+
-TargetServerParam '--microsoft-symbol-server' `
173+
-SymbolsPath "$ExpandedSymbolsPath-msdl" `
174+
-WindowsPdbVerificationParam $WindowsPdbVerificationParam
175+
$SymbolsOnSymWeb = & $FirstMatchingSymbolDescriptionOrDefault `
176+
-FullPath $FileName `
177+
-TargetServerParam '--internal-server' `
178+
-SymbolsPath "$ExpandedSymbolsPath-symweb" `
179+
-WindowsPdbVerificationParam $WindowsPdbVerificationParam
180+
181+
Write-Host -NoNewLine "`t Checking file " $FileName "... "
182+
183+
if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) {
184+
Write-Host "Symbols found on MSDL ($SymbolsOnMSDL) and SymWeb ($SymbolsOnSymWeb)"
169185
}
170186
else {
171-
if ($SymbolsOnMSDL -eq $null) {
172-
Write-Host 'No symbols found on MSDL!'
187+
$MissingSymbols++
188+
189+
if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) {
190+
Write-Host 'No symbols found on MSDL or SymWeb!'
173191
}
174192
else {
175-
Write-Host 'No symbols found on SymWeb!'
193+
if ($SymbolsOnMSDL -eq $null) {
194+
Write-Host 'No symbols found on MSDL!'
195+
}
196+
else {
197+
Write-Host 'No symbols found on SymWeb!'
198+
}
176199
}
177200
}
178201
}

eng/common/sdl/configure-sdl-tool.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ try {
6969
# For some tools, add default and automatic args.
7070
if ($tool.Name -eq 'credscan') {
7171
if ($targetDirectory) {
72-
$tool.Args += "TargetDirectory < $TargetDirectory"
72+
$tool.Args += "`"TargetDirectory < $TargetDirectory`""
7373
}
74-
$tool.Args += "OutputType < pre"
74+
$tool.Args += "`"OutputType < pre`""
7575
$tool.Args += $CrScanAdditionalRunConfigParams
7676
} elseif ($tool.Name -eq 'policheck') {
7777
if ($targetDirectory) {
78-
$tool.Args += "Target < $TargetDirectory"
78+
$tool.Args += "`"Target < $TargetDirectory`""
7979
}
8080
$tool.Args += $PoliCheckAdditionalRunConfigParams
8181
}

eng/common/sdl/execute-all-sdl-tools.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ try {
124124
Exec-BlockVerbosely {
125125
& $(Join-Path $PSScriptRoot 'run-sdl.ps1') `
126126
-GuardianCliLocation $guardianCliLocation `
127-
-WorkingDirectory $workingDirectory `
127+
-WorkingDirectory $SourceDirectory `
128128
-UpdateBaseline $UpdateBaseline `
129129
-GdnFolder $gdnFolder
130130
}

eng/common/templates/job/execute-sdl.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ jobs:
6060
- name: GuardianPackagesConfigFile
6161
value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config
6262
pool:
63-
# To extract archives (.tar.gz, .zip), we need access to "tar", added in Windows 10/2019.
64-
${{ if eq(parameters.extractArchiveArtifacts, 'false') }}:
65-
name: Hosted VS2017
66-
${{ if ne(parameters.extractArchiveArtifacts, 'false') }}:
67-
vmImage: windows-2019
63+
vmImage: windows-2019
6864
steps:
6965
- checkout: self
7066
clean: true

eng/common/templates/job/onelocbuild.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ parameters:
44

55
# Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool
66
pool:
7-
vmImage: vs2017-win2016
7+
vmImage: 'windows-2019'
88

99
CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex
1010
GithubPat: $(BotAccount-dotnet-bot-repo-PAT)
1111

1212
SourcesDirectory: $(Build.SourcesDirectory)
1313
CreatePr: true
1414
AutoCompletePr: false
15+
ReusePr: true
1516
UseLfLineEndings: true
1617
UseCheckedInLocProjectJson: false
1718
LanguageSet: VS_Main_Languages
@@ -64,6 +65,8 @@ jobs:
6465
${{ if eq(parameters.CreatePr, true) }}:
6566
isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }}
6667
isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }}
68+
${{ if eq(parameters.RepoType, 'gitHub') }}:
69+
isShouldReusePrSelected: ${{ parameters.ReusePr }}
6770
packageSourceAuth: patAuth
6871
patVariable: ${{ parameters.CeapexPat }}
6972
${{ if eq(parameters.RepoType, 'gitHub') }}:

0 commit comments

Comments
 (0)