Skip to content

Commit

Permalink
Merge branch 'main' into merge/vs17.8-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
YuliiaKovalova authored Sep 27, 2023
2 parents 585e097 + 0bc6323 commit 9951075
Show file tree
Hide file tree
Showing 24 changed files with 288 additions and 223 deletions.
127 changes: 127 additions & 0 deletions .exp-insertions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Pipeline creates a dotnet with experimental msbuild dlls.

trigger: none # Prevents this pipeline from triggering on check-ins
pr: none # don't run this on PR as well

parameters:
# Dotnet installer channel from where to take the latest dotnet bits.
- name: DotnetInstallerChannel
displayName: Dotnet installer channel
type: string
# Branch from the MSBuild Build CI pipeline. Default: main
# Top run for the branch would be used to create an experimental insertion.
- name: MSBuildBranch
displayName: MSBuild Branch
type: string
default: 'refs/heads/main'
# BuildID from the MSBuild Build CI pipeline. Overrides the choice of MSBuildBranch parameter
- name: MSBuildBuildID
displayName: MSBuild CI Run Override
type: string
default: 'default'

variables:
- name: _MsBuildCiPipelineId
value: 9434

pool:
vmImage: windows-latest

steps:
- powershell: |
mkdir '$(System.ArtifactsDirectory)/installer'
$dotnetChannel = '${{parameters.DotnetInstallerChannel}}'
$sdks = "dotnet-sdk-win-x64.zip", "dotnet-sdk-linux-x64.tar.gz"
foreach ($sdk in $sdks)
{
Write-Host "Downloading dotnet $sdk from channel $dotnetChannel"
Invoke-WebRequest `
-Uri "https://aka.ms/dotnet/$dotnetChannel/daily/$sdk" `
-OutFile "$(System.ArtifactsDirectory)/installer/$sdk"
}
mkdir '$(Pipeline.Workspace)/artifacts'
displayName: Download latest dotnet sdks

# Download latest build artifacts for a branch from MSBuild Build CI
- ${{ if eq(parameters.MSBuildBuildID, 'default') }}:
- task: DownloadBuildArtifacts@1
inputs:
buildType: specific
project: DevDiv
pipeline: $(_MsBuildCiPipelineId)
buildVersionToDownload: latestFromBranch
branchName: '${{parameters.MSBuildBranch}}'
artifactName: bin
downloadPath: '$(System.ArtifactsDirectory)/msbuild/artifacts/bin'
itemPattern: "MSBuild.Bootstrap/**"
displayName: Download latest msbuild from branch

# Download build artifacts for MSBuild Build CI specific build
- ${{ if ne(parameters.MSBuildBuildID, 'default') }}:
- task: DownloadBuildArtifacts@1
inputs:
buildType: specific
project: DevDiv
pipeline: $(_MsBuildCiPipelineId)
buildVersionToDownload: specific
buildId: ${{parameters.MSBuildBuildID}}
artifactName: bin
downloadPath: '$(System.ArtifactsDirectory)/msbuild/artifacts/bin'
itemPattern: "MSBuild.Bootstrap/**"
displayName: Download specified msbuild build

- powershell: |
$sdk = "dotnet-sdk-win-x64"
Write-Host "Extracting $(System.ArtifactsDirectory)/installer/$sdk.zip"
Expand-Archive "$(System.ArtifactsDirectory)/installer/$sdk.zip" -DestinationPath "$(Pipeline.Workspace)/exp-dotnet/$sdk"
$dotnetDirectory = Get-ChildItem -Directory -Path "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk"
$dotnetVersion = $dotnetDirectory.Name
Write-Host "Detected dotnet version: $dotnetVersion"
Write-Host "Updating MSBuild dlls."
$(Build.SourcesDirectory)/scripts/Deploy-MSBuild.ps1 `
-destination "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk/$dotnetVersion" `
-bootstrapDirectory "$(System.ArtifactsDirectory)/msbuild/artifacts/bin/MSBuild.Bootstrap" `
-configuration Release `
-makeBackup $false
Write-Host "Compressing dotnet sdk files"
Get-ChildItem -Path "$(Pipeline.Workspace)/exp-dotnet/$sdk" | Compress-Archive -DestinationPath "$(Pipeline.Workspace)/artifacts/$sdk.zip"
displayName: Dogfood msbuild dlls to dotnet sdk win-x64

- powershell: |
$sdk = "dotnet-sdk-linux-x64"
mkdir "$(Pipeline.Workspace)/exp-dotnet/$sdk"
Write-Host "Extracting $(System.ArtifactsDirectory)/installer/$sdk.tar.gz"
tar -xzvf "$(System.ArtifactsDirectory)/installer/$sdk.tar.gz" -C "$(Pipeline.Workspace)/exp-dotnet/$sdk"
$dotnetDirectory = Get-ChildItem -Directory -Path $(Pipeline.Workspace)/exp-dotnet/$sdk/sdk
$dotnetVersion = $dotnetDirectory.Name
Write-Host "Detected dotnet version: $dotnetVersion"
Write-Host "Updating MSBuild dlls."
$(Build.SourcesDirectory)/scripts/Deploy-MSBuild.ps1 `
-destination "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk/$dotnetVersion" `
-bootstrapDirectory "$(System.ArtifactsDirectory)/msbuild/artifacts/bin/MSBuild.Bootstrap" `
-configuration Release `
-makeBackup $false
Write-Host "Compressing dotnet sdk files"
tar -czvf "$(Pipeline.Workspace)/artifacts/$sdk.tar.gz" -C "$(Pipeline.Workspace)/exp-dotnet/$sdk" .
displayName: Dogfood msbuild dlls to dotnet sdk linux-x64

- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)/artifacts'
artifactName: ExperimentalDotnet
parallel: true
condition: always()
displayName: Publish crank assests artifacts
16 changes: 16 additions & 0 deletions .vsts-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ variables:
value: true
- name: Codeql.Enabled
value: true
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-MSBuild-SDLValidation-Params

stages:
- stage: build
Expand Down Expand Up @@ -294,3 +296,17 @@ stages:
enableSymbolValidation: false
enableSourceLinkValidation: false
enableNugetValidation: false
SDLValidationParameters:
enable: true
continueOnError: false
params: ' -SourceToolsList @("policheck","credscan")
-TsaInstanceURL "$(_TsaInstanceURL)"
-TsaProjectName "$(_TsaProjectName)"
-TsaNotificationEmail "$(_TsaNotificationEmail)"
-TsaCodebaseAdmin "$(_TsaCodebaseAdmin)"
-TsaBugAreaPath "$(_TsaBugAreaPath)"
-TsaIterationPath "$(_TsaIterationPath)"
-TsaRepositoryName "dotnet-msbuild"
-TsaCodebaseName "dotnet-msbuild"
-TsaPublish $True
-PoliCheckAdditionalRunConfigParams @("UserExclusionPath < $(Build.SourcesDirectory)\eng\policheck_exclusions.xml")'
3 changes: 3 additions & 0 deletions eng/BootStrapMSBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@
<Copy SourceFiles="@(NuGetSdkResolverManifest)"
DestinationFolder="$(BootstrapDestination)SdkResolvers\Microsoft.Build.NuGetSdkResolver" />

<Copy SourceFiles="$(RuntimeIdentifierGraphPath)"
DestinationFolder="$(BootstrapDestination)" />

<Copy SourceFiles="@(InstalledSdks)"
DestinationFiles="@(InstalledSdks -> '$(BootstrapDestination)Sdks\%(RecursiveDir)%(Filename)%(Extension)')" />

Expand Down
24 changes: 12 additions & 12 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="8.0.0-alpha.1.23428.2">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.23475.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>26ce96327dd346534926c4551f8b8d62a6fc724f</Sha>
<Sha>0650b50b2a5263c735d12b5c36c5deb34e7e6b60</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Necessary for source-build. This allows the live version of the package to be used by source-build. -->
Expand Down Expand Up @@ -58,28 +58,28 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.23425.2">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.23463.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>90c167d5c57de4a8bced566379dbd893556c94e8</Sha>
<Sha>1d451c32dda2314c721adbf8829e1c0cd4e681ff</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="1.0.0-beta.23423.1" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="1.0.0-beta.23426.1" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
<Uri>https://github.com/dotnet/xliff-tasks</Uri>
<Sha>ed9a83526483c094fb51e7000b6f816ce6cb0325</Sha>
<Sha>194f32828726c3f1f63f79f3dc09b9e99c157b11</Sha>
<SourceBuild RepoName="xliff-tasks" ManagedOnly="true" />
</Dependency>
<Dependency Name="NuGet.Build.Tasks" Version="6.8.0-rc.112">
<Dependency Name="NuGet.Build.Tasks" Version="6.8.0-rc.117">
<Uri>https://github.com/nuget/nuget.client</Uri>
<Sha>f47eb5771ee3f9a100d0b31d82ccb5ee600a56ed</Sha>
<Sha>7fb5ed887352d2892797a365cfdd7bb8df029941</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.8.0-3.23465.5">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.8.0-3.23474.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>dc3d0694a4b31b8e27038431888cd4e8dd5b6cb6</Sha>
<Sha>2fe37da588ea81d852d3a42e290f8da4d610882f</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="8.0.0-beta.23425.2">
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="8.0.0-beta.23463.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>90c167d5c57de4a8bced566379dbd893556c94e8</Sha>
<Sha>1d451c32dda2314c721adbf8829e1c0cd4e681ff</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
10 changes: 5 additions & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>
<PropertyGroup>
<VersionPrefix>17.8.1</VersionPrefix><DotNetFinalVersionKind>release</DotNetFinalVersionKind>
<PackageValidationBaselineVersion>17.7.0</PackageValidationBaselineVersion>
<VersionPrefix>17.9.0</VersionPrefix>
<PackageValidationBaselineVersion>17.8.0-preview-23471-08</PackageValidationBaselineVersion>
<AssemblyVersion>15.1.0.0</AssemblyVersion>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
<DotNetUseShippingVersions>true</DotNetUseShippingVersions>
Expand Down Expand Up @@ -47,11 +47,11 @@
Otherwise, this version of dotnet will not be installed and the build will error out. -->
<DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\global.json')), '"dotnet": "([^"]*)"').Groups.get_Item(1))</DotNetCliVersion>
<MicrosoftCodeAnalysisCollectionsVersion>4.2.0-1.22102.8</MicrosoftCodeAnalysisCollectionsVersion>
<MicrosoftDotNetXUnitExtensionsVersion>8.0.0-beta.23425.2</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitExtensionsVersion>8.0.0-beta.23463.1</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftExtensionsDependencyModelVersion>7.0.0</MicrosoftExtensionsDependencyModelVersion>
<MicrosoftIORedistVersion>6.0.0</MicrosoftIORedistVersion>
<MicrosoftNetCompilersToolsetVersion>4.8.0-3.23465.5</MicrosoftNetCompilersToolsetVersion>
<NuGetBuildTasksVersion>6.8.0-rc.112</NuGetBuildTasksVersion>
<MicrosoftNetCompilersToolsetVersion>4.8.0-3.23474.3</MicrosoftNetCompilersToolsetVersion>
<NuGetBuildTasksVersion>6.8.0-rc.117</NuGetBuildTasksVersion>
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
<SystemTextJsonVersion>7.0.3</SystemTextJsonVersion>
<SystemThreadingTasksDataflowVersion>7.0.0</SystemThreadingTasksDataflowVersion>
Expand Down
2 changes: 1 addition & 1 deletion eng/common/cross/toolchain.cmake

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions eng/policheck_exclusions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<PoliCheckExclusions>
<!-- All strings must be UPPER CASE -->
<!--Each of these exclusions is a folder name -if \[name]\exists in the file path, it will be skipped -->
<!--<Exclusion Type="FolderPathFull">ABC|XYZ</Exclusion>-->
<!--Each of these exclusions is a folder name -if any folder or file starts with "\[name]", it will be skipped -->
<!--<Exclusion Type="FolderPathStart">ABC|XYZ</Exclusion>-->
<!--Each of these file types will be completely skipped for the entire scan -->
<!--<Exclusion Type="FileType">.ABC|.XYZ</Exclusion>-->
<!--The specified file names will be skipped during the scan regardless which folder they are in -->
<!--<Exclusion Type="FileName">ABC.TXT|XYZ.CS</Exclusion>-->

<Exclusion Type="FolderPathFull">.DOTNET</Exclusion>
</PoliCheckExclusions>
10 changes: 5 additions & 5 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"allowPrerelease": true
},
"tools": {
"dotnet": "8.0.100-preview.7.23376.3",
"dotnet": "8.0.100-rc.1.23463.5",
"vs": {
"version": "17.6.0"
"version": "17.7.0"
},
"xcopy-msbuild": "17.6.0-2"
"xcopy-msbuild": "17.7.2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23425.2"
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23463.1"
}
}
}
26 changes: 19 additions & 7 deletions scripts/Deploy-MSBuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Param(
[ValidateSet('Debug','Release')]
[string] $configuration = "Debug",
[ValidateSet('Core','Desktop', 'Detect', 'Full')]
[string] $runtime = "Detect"
[string] $runtime = "Detect",
[string] $bootstrapDirectory = "",
[bool] $makeBackup = $true
)

Set-StrictMode -Version "Latest"
Expand All @@ -15,9 +17,9 @@ function Copy-WithBackup ($origin, $destinationSubFolder = "") {
$directoryPart = [IO.Path]::Combine($destination, $destinationSubFolder, $origin.IntermediaryDirectories)
$destinationPath = Join-Path -Path $directoryPart (Split-Path $origin.SourceFile -leaf)

$backupInto = [IO.Path]::Combine($BackupFolder, $destinationSubFolder)
if (($makeBackup) -and (Test-Path $destinationPath -PathType Leaf)) {
$backupInto = [IO.Path]::Combine($BackupFolder, $destinationSubFolder)

if (Test-Path $destinationPath -PathType Leaf) {
# Back up previous copy of the file
if (!(Test-Path $backupInto)) {
[system.io.directory]::CreateDirectory($backupInto)
Expand Down Expand Up @@ -45,10 +47,15 @@ function FileToCopy([string] $sourceFileRelativeToRepoRoot, [string] $intermedia

# TODO: find most-recently-built MSBuild and make it default $configuration

$BackupFolder = New-Item (Join-Path $destination -ChildPath "Backup-$(Get-Date -Format FileDateTime)") -itemType directory -ErrorAction Stop

Write-Verbose "Copying $configuration MSBuild to $destination"
Write-Host "Existing MSBuild assemblies backed up to $BackupFolder"

if ($makeBackup) {
$BackupFolder = New-Item (Join-Path $destination -ChildPath "Backup-$(Get-Date -Format FileDateTime)") -itemType directory -ErrorAction Stop
Write-Host "Existing MSBuild assemblies backed up to $BackupFolder"
}
else {
Write-Host "Existing MSBuild assemblies won't be backed up"
}

if ($runtime -eq "Detect") {
if ($destination -like "*dotnet*sdk*") {
Expand All @@ -72,7 +79,12 @@ if ($runtime -eq "Desktop") {
$targetFramework = "net8.0"
}

$bootstrapBinDirectory = "artifacts\bin\MSBuild.Bootstrap\$configuration\$targetFramework"
# If bootstrap directory is not defined in parameters, use the default location
if ($bootstrapDirectory -eq "") {
$bootstrapDirectory = "artifacts\bin\MSBuild.Bootstrap"
}

$bootstrapBinDirectory = "$bootstrapDirectory\$configuration\$targetFramework"

$filesToCopyToBin = @(
FileToCopy "$bootstrapBinDirectory\Microsoft.Build.dll"
Expand Down
5 changes: 0 additions & 5 deletions src/Build/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- For updating target framework from net 7.0 to net 8.0 in MSBuild 17.8 suppress baseline package validation error PKV006 on net 7.0 -->
<Suppression>
<DiagnosticId>PKV006</DiagnosticId>
<Target>net7.0</Target>
</Suppression>
</Suppressions>
4 changes: 2 additions & 2 deletions src/Build/Definition/ProjectItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,11 +1020,11 @@ public ProjectItem CreateItem(string evaluatedIncludeEscaped, string evaluatedIn
/// <summary>
/// Applies the supplied metadata to the destination item.
/// </summary>
public void SetMetadata(IEnumerable<Pair<ProjectMetadataElement, string>> metadata, IEnumerable<ProjectItem> destinationItems)
public void SetMetadata(IEnumerable<KeyValuePair<ProjectMetadataElement, string>> metadata, IEnumerable<ProjectItem> destinationItems)
{
foreach (IItem<ProjectMetadata> item in destinationItems)
{
foreach (Pair<ProjectMetadataElement, string> metadatum in metadata)
foreach (KeyValuePair<ProjectMetadataElement, string> metadatum in metadata)
{
item.SetMetadata(metadatum.Key, metadatum.Value);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Build/Evaluation/Evaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ internal class Evaluator<P, I, M, D>
/// Key is the directory of the file importing the usingTask, which is needed
/// to handle any relative paths in the usingTask.
/// </summary>
private readonly List<Pair<string, ProjectUsingTaskElement>> _usingTaskElements;
private readonly List<KeyValuePair<string, ProjectUsingTaskElement>> _usingTaskElements;

/// <summary>
/// List of ProjectTargetElement's traversing into imports.
Expand Down Expand Up @@ -249,7 +249,7 @@ private Evaluator(
_data = data;
_itemGroupElements = new List<ProjectItemGroupElement>();
_itemDefinitionGroupElements = new List<ProjectItemDefinitionGroupElement>();
_usingTaskElements = new List<Pair<string, ProjectUsingTaskElement>>();
_usingTaskElements = new List<KeyValuePair<string, ProjectUsingTaskElement>>();
_targetElements = new List<ProjectTargetElement>();
_importsSeen = new Dictionary<string, ProjectImportElement>(StringComparer.OrdinalIgnoreCase);
_initialTargetsList = new List<string>();
Expand Down Expand Up @@ -913,7 +913,7 @@ private void PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
EvaluateImportGroupElement(currentProjectOrImport.DirectoryPath, importGroup);
break;
case ProjectUsingTaskElement usingTask:
_usingTaskElements.Add(new Pair<string, ProjectUsingTaskElement>(currentProjectOrImport.DirectoryPath, usingTask));
_usingTaskElements.Add(new KeyValuePair<string, ProjectUsingTaskElement>(currentProjectOrImport.DirectoryPath, usingTask));
break;
case ProjectChooseElement choose:
EvaluateChooseElement(choose);
Expand Down
Loading

0 comments on commit 9951075

Please sign in to comment.