diff --git a/.editorconfig b/.editorconfig
index b78e7a35b8..39f9dc14c9 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -105,8 +105,8 @@ dotnet_style_prefer_compound_assignment = true:warning # not default, default i
dotnet_diagnostic.IDE0074.severity = warning # not default, set in accordance to previous setting
# IDE0032: Use auto property
-dotnet_style_prefer_auto_properties = true:warning # not default, default is true:suggestion, increased severity to ensure it is used
-dotnet_diagnostic.IDE0032.severity = warning # not default, set in accordance to previous setting
+dotnet_style_prefer_auto_properties = true:suggestion # not default, default is true:suggestion, increased severity to ensure it is used
+dotnet_diagnostic.IDE0032.severity = suggestion # not default, set in accordance to previous setting
# Field preferences
dotnet_style_readonly_field = true:warning
diff --git a/.github/workflows/AzureDevOps.yml b/.github/workflows/AzureDevOps.yml
index d497856f1e..ec1dd85b71 100644
--- a/.github/workflows/AzureDevOps.yml
+++ b/.github/workflows/AzureDevOps.yml
@@ -4,20 +4,44 @@ on:
issues:
types:
[labeled] #, opened, edited, deleted, closed, reopened, labeled, unlabeled, assigned
+ issue_comment:
+ types: [created, edited, deleted]
+
+concurrency:
+ group: issue-${{ github.event.issue.number }}
+ cancel-in-progress: false
+
+# Extra permissions needed to login with Entra ID service principal via federated identity
+permissions:
+ id-token: write
+ issues: write
jobs:
updateAzDO:
if: github.event.label.name == 'sprint'
runs-on: ubuntu-latest
+ environment: ado
steps:
+ - name: Login to Azure
+ uses: azure/login@v2
+ with:
+ client-id: ${{ secrets.ENTRA_APP_CLIENT_ID }}
+ tenant-id: ${{ secrets.ENTRA_APP_TENANT_ID }}
+ allow-no-subscriptions: true
+ - name: Get Azure DevOps token
+ id: get_ado_token
+ run:
+ # The resource ID for Azure DevOps is always 499b84ac-1321-427f-aa17-267ca6975798
+ # https://learn.microsoft.com/azure/devops/integrate/get-started/authentication/service-principal-managed-identity
+ echo "ado_token=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv)" >> $GITHUB_ENV
- uses: pavelhorak/github-actions-issue-to-work-item@main
env:
- ado_token: "${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}"
+ ado_token: "${{ env.ado_token }}"
github_token: "${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}"
ado_organization: "${{ secrets.ADO_ORGANIZATION }}"
ado_project: "${{ secrets.ADO_PROJECT }}"
ado_area_path: "${{ secrets.ADO_AREA_PATH }}"
- ado_iteration_path: "${{ secrets.ADO_ITERATION_PATH }}" # this doesn't work: "@CurrentIteration('[DevDiv]\\.NET DevExp Prague')"
+ ado_iteration_path: "${{ secrets.ADO_ITERATION_PATH }}"
ado_wit: "User Story"
ado_new_state: "Committed"
ado_active_state: "In Progress"
diff --git a/Directory.Build.props b/Directory.Build.props
index 1d8854a6ba..94e7a2ac6d 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -45,18 +45,7 @@
preview
true
-
- $(NoWarn);CA1416;RS0037;CS1570;CS1572;CS1573;CS1574;CS1591
+ $(NoWarn);CA1416;RS0037
diff --git a/Directory.Build.targets b/Directory.Build.targets
index d38dee58b5..5aee4dd768 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -1,6 +1,10 @@
-
+
+
+ <_NetFrameworkHostedCompilersVersion Condition="'$(_NetFrameworkHostedCompilersVersion)' == ''">4.11.0-3.24280.3
+
+
-
+
https://github.com/dotnet/diagnostics
- 33d8bf23a6566cd3fb9055acfc9f1141391d5421
+ 513150c2f25077b1fcb194407e53c433c975f39b
-
+
https://github.com/dotnet/source-build-externals
- 7db00527ef8fbbe61f67e9295beebddf187efff8
+ 2cef086137a68586fdd69848261e2a8cf8c48b73
-
+
https://github.com/dotnet/source-build-reference-packages
- 9ae78a4e6412926d19ba97cfed159bf9de70b538
+ cc732c57199f725857c201da146525e3be6bc504
@@ -33,8 +33,8 @@
30ab651fcb4354552bd4891619a0bdd81e0ebdbf
-
- https://github.com/dotnet/core-setup
+
+ https://github.com/dotnet/runtime
7d57652f33493fa022125b7f63aad0d70c52d810
@@ -44,14 +44,14 @@
-
+
https://github.com/dotnet/arcade
- 7507f80c8db285bbc9939c1dff522a761cf4edc0
+ 60ae233c3d77f11c5fdb53e570b64d503b13ba59
-
+
https://github.com/dotnet/arcade
- 7507f80c8db285bbc9939c1dff522a761cf4edc0
+ 60ae233c3d77f11c5fdb53e570b64d503b13ba59
@@ -62,9 +62,9 @@
https://github.com/dotnet/symreader-converter
c5ba7c88f92e2dde156c324a8c8edc04d9fa4fe0
-
+
https://github.com/dotnet/arcade
- 7507f80c8db285bbc9939c1dff522a761cf4edc0
+ 60ae233c3d77f11c5fdb53e570b64d503b13ba59
diff --git a/eng/Versions.props b/eng/Versions.props
index 76f8b0f8b1..d7260e0cea 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -8,8 +8,13 @@
is trying to parse that version and will consider any version with more than 4 `.` in it as invalid.
-->
true
- 17.11.0
- preview
+
+ false
+ 17.12.0
+ release
@@ -35,11 +40,11 @@
3.11.0-beta1.23525.2
3.11.0-beta1.23525.2
17.7.0
- 0.2.0-preview.24307.1
- 3.0.0
+ 0.2.0-preview.24416.1
+ 3.1.0
2.0.0
17.9.0-beta.24058.4
- 17.11.3
+ 17.12.5
17.10.34924.118
$(MicrosoftVisualStudioDiagnosticsUtilitiesVersion)
17.10.525-preview.1
@@ -66,9 +71,10 @@
17.9.0
- 3.3.1
- 3.3.1
+ 3.4.3
+ 3.4.3
1.0.3-preview
+
2.4.2
2.4.5
2.4.2
@@ -81,9 +87,9 @@
These versions need to be "statically" readable because we read this file as xml in our build and tests.
-->
- [3.3.1]
- [3.3.1]
- [3.2.2]
+ [3.4.3]
+ [3.4.3]
+ [3.3.1]
[2.2.10]
[2.2.10]
[1.4.0]
@@ -91,9 +97,9 @@
See Invoke-TestAssetsBuild in scripts/build.ps1. Exact versions are used to avoid Nuget substituting them by closest match, if we make a typo.
These versions need to be "statically" readable because we read this file as xml in our build and tests. -->
- [17.10.0-release-24177-07]
- [17.9.0]
- [17.8.0]
+ [17.10.0]
+ [17.10.0]
+ [17.9.0]
[17.6.2]
[16.11.0]
[15.9.2]
diff --git a/eng/common/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1
index c07f6a5260..2b0a5c9e66 100644
--- a/eng/common/SetupNugetSources.ps1
+++ b/eng/common/SetupNugetSources.ps1
@@ -1,32 +1,31 @@
# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
-#
-# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. This credential
-# is added via the standard environment variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS. See
-# https://github.com/microsoft/artifacts-credprovider/tree/v1.1.1?tab=readme-ov-file#environment-variables for more details
+#
+# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
#
# See example call for this script below.
#
# - task: PowerShell@2
-# displayName: Setup Internal Feeds
+# displayName: Setup Private Feeds Credentials
# condition: eq(variables['Agent.OS'], 'Windows_NT')
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
-# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config
-# - task: NuGetAuthenticate@1
-#
+# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
+# env:
+# Token: $(dn-bot-dnceng-artifact-feeds-rw)
+#
# Note that the NuGetAuthenticate task should be called after SetupNugetSources.
# This ensures that:
# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt)
-# - The credential provider is installed
+# - The credential provider is installed.
#
# This logic is also abstracted into enable-internal-sources.yml.
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)][string]$ConfigFile,
- [string]$Password
+ $Password
)
$ErrorActionPreference = "Stop"
@@ -35,23 +34,12 @@ Set-StrictMode -Version 2.0
. $PSScriptRoot\tools.ps1
-$feedEndpoints = $null
-
-# If a credential is provided, ensure that we don't overwrite the current set of
-# credentials that may have been provided by a previous call to the credential provider.
-if ($Password -and $null -ne $env:VSS_NUGET_EXTERNAL_FEED_ENDPOINTS) {
- $feedEndpoints = $env:VSS_NUGET_EXTERNAL_FEED_ENDPOINTS | ConvertFrom-Json
-} elseif ($Password) {
- $feedEndpoints = @{ endpointCredentials = @() }
-}
-
# Add source entry to PackageSources
-function AddPackageSource($sources, $SourceName, $SourceEndPoint, $pwd) {
+function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) {
$packageSource = $sources.SelectSingleNode("add[@key='$SourceName']")
- if ($null -eq $packageSource)
+ if ($packageSource -eq $null)
{
- Write-Host "`tAdding package source" $SourceName
$packageSource = $doc.CreateElement("add")
$packageSource.SetAttribute("key", $SourceName)
$packageSource.SetAttribute("value", $SourceEndPoint)
@@ -61,33 +49,63 @@ function AddPackageSource($sources, $SourceName, $SourceEndPoint, $pwd) {
Write-Host "Package source $SourceName already present."
}
- if ($pwd) {
- $feedEndpoints.endpointCredentials = AddCredential -endpointCredentials $feedEndpoints.endpointCredentials -source $SourceEndPoint -pwd $pwd
- }
+ AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd
}
-# Add a new feed endpoint credential
-function AddCredential([array]$endpointCredentials, $source, $pwd) {
- $endpointCredentials += @{
- endpoint = $source;
- password = $pwd
+# Add a credential node for the specified source
+function AddCredential($creds, $source, $username, $pwd) {
+ # If no cred supplied, don't do anything.
+ if (!$pwd) {
+ return;
}
- return $endpointCredentials
+
+ # Looks for credential configuration for the given SourceName. Create it if none is found.
+ $sourceElement = $creds.SelectSingleNode($Source)
+ if ($sourceElement -eq $null)
+ {
+ $sourceElement = $doc.CreateElement($Source)
+ $creds.AppendChild($sourceElement) | Out-Null
+ }
+
+ # Add the node to the credential if none is found.
+ $usernameElement = $sourceElement.SelectSingleNode("add[@key='Username']")
+ if ($usernameElement -eq $null)
+ {
+ $usernameElement = $doc.CreateElement("add")
+ $usernameElement.SetAttribute("key", "Username")
+ $sourceElement.AppendChild($usernameElement) | Out-Null
+ }
+ $usernameElement.SetAttribute("value", $Username)
+
+ # Add the to the credential if none is found.
+ # Add it as a clear text because there is no support for encrypted ones in non-windows .Net SDKs.
+ # -> https://github.com/NuGet/Home/issues/5526
+ $passwordElement = $sourceElement.SelectSingleNode("add[@key='ClearTextPassword']")
+ if ($passwordElement -eq $null)
+ {
+ $passwordElement = $doc.CreateElement("add")
+ $passwordElement.SetAttribute("key", "ClearTextPassword")
+ $sourceElement.AppendChild($passwordElement) | Out-Null
+ }
+
+ $passwordElement.SetAttribute("value", $pwd)
}
-function InsertMaestroInternalFeedCredentials($Sources, $pwd) {
- $maestroInternalSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")
+function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) {
+ $maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")
- ForEach ($PackageSource in $maestroInternalSources) {
- Write-Host "`tAdding credential for Maestro's feed:" $PackageSource.Key
- $feedEndpoints.endpointCredentials = AddCredential -endpointCredentials $feedEndpoints.endpointCredentials -source $PackageSource.value -pwd $pwd
+ Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds."
+
+ ForEach ($PackageSource in $maestroPrivateSources) {
+ Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key
+ AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd
}
}
-function EnableInternalPackageSources($DisabledPackageSources) {
- $maestroInternalSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]")
- ForEach ($DisabledPackageSource in $maestroInternalSources) {
- Write-Host "`tEnsuring internal source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource"
+function EnablePrivatePackageSources($DisabledPackageSources) {
+ $maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]")
+ ForEach ($DisabledPackageSource in $maestroPrivateSources) {
+ Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource"
# Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries
$DisabledPackageSources.RemoveChild($DisabledPackageSource)
}
@@ -105,27 +123,38 @@ $doc.Load($filename)
# Get reference to or create one if none exist already
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
-if ($null -eq $sources) {
+if ($sources -eq $null) {
$sources = $doc.CreateElement("packageSources")
$doc.DocumentElement.AppendChild($sources) | Out-Null
}
+$creds = $null
+if ($Password) {
+ # Looks for a node. Create it if none is found.
+ $creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
+ if ($creds -eq $null) {
+ $creds = $doc.CreateElement("packageSourceCredentials")
+ $doc.DocumentElement.AppendChild($creds) | Out-Null
+ }
+}
+
# Check for disabledPackageSources; we'll enable any darc-int ones we find there
$disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources")
-if ($null -ne $disabledSources) {
+if ($disabledSources -ne $null) {
Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node"
- EnableInternalPackageSources -DisabledPackageSources $disabledSources
+ EnablePrivatePackageSources -DisabledPackageSources $disabledSources
}
-if ($Password) {
- InsertMaestroInternalFeedCredentials -Sources $sources -pwd $Password
-}
+$userName = "dn-bot"
+
+# Insert credential nodes for Maestro's private feeds
+InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password
# 3.1 uses a different feed url format so it's handled differently here
$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']")
-if ($null -ne $dotnet31Source) {
- AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json" -pwd $Password
- AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json" -pwd $Password
+if ($dotnet31Source -ne $null) {
+ AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password
+ AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password
}
$dotnetVersions = @('5','6','7','8')
@@ -133,18 +162,10 @@ $dotnetVersions = @('5','6','7','8')
foreach ($dotnetVersion in $dotnetVersions) {
$feedPrefix = "dotnet" + $dotnetVersion;
$dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']")
- if ($dotnetSource) {
- AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedprefix-internal/nuget/v3/index.json" -pwd $Password
- AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v3/index.json" -pwd $Password
+ if ($dotnetSource -ne $null) {
+ AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password
+ AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password
}
}
$doc.Save($filename)
-
-# If any credentials were added or altered, update the VSS_NUGET_EXTERNAL_FEED_ENDPOINTS environment variable
-if ($null -ne $feedEndpoints) {
- # ci is set to true so vso logging commands will be used.
- $ci = $true
- Write-PipelineSetVariable -Name 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' -Value $($feedEndpoints | ConvertTo-Json) -IsMultiJobVariable $false
- Write-PipelineSetVariable -Name 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED' -Value "False" -IsMultiJobVariable $false
-}
\ No newline at end of file
diff --git a/eng/common/SetupNugetSources.sh b/eng/common/SetupNugetSources.sh
index 16c1e29ea3..b493479a1d 100644
--- a/eng/common/SetupNugetSources.sh
+++ b/eng/common/SetupNugetSources.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# This script adds internal feeds required to build commits that depend on intenral package sources. For instance,
+# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
#
diff --git a/eng/common/core-templates/job/job.yml b/eng/common/core-templates/job/job.yml
index 7df5852797..c732bee9f4 100644
--- a/eng/common/core-templates/job/job.yml
+++ b/eng/common/core-templates/job/job.yml
@@ -24,12 +24,11 @@ parameters:
enablePublishTestResults: false
enablePublishUsingPipelines: false
enableBuildRetry: false
- disableComponentGovernance: ''
- componentGovernanceIgnoreDirectories: ''
mergeTestResults: false
testRunTitle: ''
testResultsFormat: ''
name: ''
+ componentGovernanceSteps: []
preSteps: []
artifactPublishSteps: []
runAsPublic: false
@@ -170,17 +169,8 @@ jobs:
uploadRichNavArtifacts: ${{ coalesce(parameters.richCodeNavigationUploadArtifacts, false) }}
continueOnError: true
- - template: /eng/common/core-templates/steps/component-governance.yml
- parameters:
- is1ESPipeline: ${{ parameters.is1ESPipeline }}
- ${{ if eq(parameters.disableComponentGovernance, '') }}:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.runAsPublic, 'false'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dotnet/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/microsoft/'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}:
- disableComponentGovernance: false
- ${{ else }}:
- disableComponentGovernance: true
- ${{ else }}:
- disableComponentGovernance: ${{ parameters.disableComponentGovernance }}
- componentGovernanceIgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
+ - ${{ each step in parameters.componentGovernanceSteps }}:
+ - ${{ step }}
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
@@ -190,14 +180,6 @@ jobs:
continueOnError: ${{ parameters.continueOnError }}
env:
TeamName: $(_TeamName)
- - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}:
- - template: /eng/common/core-templates/steps/generate-sbom.yml
- parameters:
- is1ESPipeline: ${{ parameters.is1ESPipeline }}
- PackageVersion: ${{ parameters.packageVersion}}
- BuildDropPath: ${{ parameters.buildDropPath }}
- IgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
- publishArtifacts: false
# Publish test results
- ${{ if or(and(eq(parameters.enablePublishTestResults, 'true'), eq(parameters.testResultsFormat, '')), eq(parameters.testResultsFormat, 'xunit')) }}:
diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml
index 8fe9299542..3d3356e319 100644
--- a/eng/common/core-templates/job/publish-build-assets.yml
+++ b/eng/common/core-templates/job/publish-build-assets.yml
@@ -87,13 +87,15 @@ jobs:
- task: NuGetAuthenticate@1
- - task: PowerShell@2
+ - task: AzureCLI@2
displayName: Publish Build Assets
inputs:
- filePath: eng\common\sdk-task.ps1
+ azureSubscription: "Darc: Maestro Production"
+ scriptType: ps
+ scriptLocation: scriptPath
+ scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1
arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet
/p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests'
- /p:BuildAssetRegistryToken=$(MaestroAccessToken)
/p:MaestroApiEndpoint=https://maestro.dot.net
/p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }}
/p:OfficialBuildId=$(Build.BuildNumber)
@@ -111,38 +113,19 @@ jobs:
Add-Content -Path $filePath -Value "$(DefaultChannels)"
Add-Content -Path $filePath -Value $(IsStableBuild)
- - template: /eng/common/core-templates/steps/publish-build-artifacts.yml
- parameters:
- is1ESPipeline: ${{ parameters.is1ESPipeline }}
- args:
- displayName: Publish ReleaseConfigs Artifact
- pathToPublish: '$(Build.StagingDirectory)/ReleaseConfigs'
- publishLocation: Container
- artifactName: ReleaseConfigs
-
- - task: powershell@2
- displayName: Check if SymbolPublishingExclusionsFile.txt exists
- inputs:
- targetType: inline
- script: |
$symbolExclusionfile = "$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt"
- if(Test-Path -Path $symbolExclusionfile)
+ if (Test-Path -Path $symbolExclusionfile)
{
Write-Host "SymbolExclusionFile exists"
- Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]true"
- }
- else{
- Write-Host "Symbols Exclusion file does not exist"
- Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]false"
+ Copy-Item -Path $symbolExclusionfile -Destination "$(Build.StagingDirectory)/ReleaseConfigs"
}
- template: /eng/common/core-templates/steps/publish-build-artifacts.yml
parameters:
is1ESPipeline: ${{ parameters.is1ESPipeline }}
args:
- displayName: Publish SymbolPublishingExclusionsFile Artifact
- condition: eq(variables['SymbolExclusionFile'], 'true')
- pathToPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt'
+ displayName: Publish ReleaseConfigs Artifact
+ pathToPublish: '$(Build.StagingDirectory)/ReleaseConfigs'
publishLocation: Container
artifactName: ReleaseConfigs
@@ -153,14 +136,17 @@ jobs:
PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
is1ESPipeline: ${{ parameters.is1ESPipeline }}
- - task: PowerShell@2
+ - task: AzureCLI@2
displayName: Publish Using Darc
inputs:
- filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
- arguments: -BuildId $(BARBuildId)
+ azureSubscription: "Darc: Maestro Production"
+ scriptType: ps
+ scriptLocation: scriptPath
+ scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
+ arguments: >
+ -BuildId $(BARBuildId)
-PublishingInfraVersion 3
- -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
- -MaestroToken '$(MaestroApiAccessToken)'
+ -AzdoToken '$(System.AccessToken)'
-WaitPublishingFinish true
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
diff --git a/eng/common/core-templates/job/source-index-stage1.yml b/eng/common/core-templates/job/source-index-stage1.yml
index 8328e52ab1..205fb5b3a3 100644
--- a/eng/common/core-templates/job/source-index-stage1.yml
+++ b/eng/common/core-templates/job/source-index-stage1.yml
@@ -34,10 +34,12 @@ jobs:
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
- image: windows.vs2022.amd64.open
+ image: 1es-windows-2022-open
+ os: windows
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool)
- image: windows.vs2022.amd64
+ image: 1es-windows-2022
+ os: windows
steps:
- ${{ if eq(parameters.is1ESPipeline, '') }}:
@@ -69,23 +71,11 @@ jobs:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: AzureCLI@2
- displayName: Get stage 1 auth token
+ displayName: Log in to Azure and upload stage1 artifacts to source index
inputs:
azureSubscription: 'SourceDotNet Stage1 Publish'
addSpnToEnvironment: true
scriptType: 'ps'
scriptLocation: 'inlineScript'
inlineScript: |
- echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$env:servicePrincipalId"
- echo "##vso[task.setvariable variable=ARM_ID_TOKEN]$env:idToken"
- echo "##vso[task.setvariable variable=ARM_TENANT_ID]$env:tenantId"
-
- - script: |
- echo "Client ID: $(ARM_CLIENT_ID)"
- echo "ID Token: $(ARM_ID_TOKEN)"
- echo "Tenant ID: $(ARM_TENANT_ID)"
- az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN)
- displayName: "Login to Azure"
-
- - script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1
- displayName: Upload stage1 artifacts to source index
+ $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1
diff --git a/eng/common/core-templates/post-build/common-variables.yml b/eng/common/core-templates/post-build/common-variables.yml
index b9ede10bf0..d5627a994a 100644
--- a/eng/common/core-templates/post-build/common-variables.yml
+++ b/eng/common/core-templates/post-build/common-variables.yml
@@ -8,8 +8,6 @@ variables:
# Default Maestro++ API Endpoint and API Version
- name: MaestroApiEndPoint
value: "https://maestro.dot.net"
- - name: MaestroApiAccessToken
- value: $(MaestroAccessToken)
- name: MaestroApiVersion
value: "2020-02-20"
diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml
index fb15c40c03..454fd75c7a 100644
--- a/eng/common/core-templates/post-build/post-build.yml
+++ b/eng/common/core-templates/post-build/post-build.yml
@@ -300,14 +300,17 @@ stages:
- task: NuGetAuthenticate@1
- - task: PowerShell@2
+ - task: AzureCLI@2
displayName: Publish Using Darc
inputs:
- filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
- arguments: -BuildId $(BARBuildId)
+ azureSubscription: "Darc: Maestro Production"
+ scriptType: ps
+ scriptLocation: scriptPath
+ scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
+ arguments: >
+ -BuildId $(BARBuildId)
-PublishingInfraVersion ${{ parameters.publishingInfraVersion }}
- -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
- -MaestroToken '$(MaestroApiAccessToken)'
+ -AzdoToken '$(System.AccessToken)'
-WaitPublishingFinish true
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
diff --git a/eng/common/core-templates/post-build/setup-maestro-vars.yml b/eng/common/core-templates/post-build/setup-maestro-vars.yml
index 8d56b57267..f7602980db 100644
--- a/eng/common/core-templates/post-build/setup-maestro-vars.yml
+++ b/eng/common/core-templates/post-build/setup-maestro-vars.yml
@@ -15,19 +15,20 @@ steps:
artifactName: ReleaseConfigs
checkDownloadedFiles: true
- - task: PowerShell@2
+ - task: AzureCLI@2
name: setReleaseVars
displayName: Set Release Configs Vars
inputs:
- targetType: inline
- pwsh: true
- script: |
+ azureSubscription: "Darc: Maestro Production"
+ scriptType: pscore
+ scriptLocation: inlineScript
+ inlineScript: |
try {
if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') {
$Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt
$BarId = $Content | Select -Index 0
- $Channels = $Content | Select -Index 1
+ $Channels = $Content | Select -Index 1
$IsStableBuild = $Content | Select -Index 2
$AzureDevOpsProject = $Env:System_TeamProject
@@ -35,15 +36,16 @@ steps:
$AzureDevOpsBuildId = $Env:Build_BuildId
}
else {
- $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}"
+ . $(Build.SourcesDirectory)\eng\common\tools.ps1
+ $darc = Get-Darc
+ $buildInfo = & $darc get-build `
+ --id ${{ parameters.BARBuildId }} `
+ --extended `
+ --output-format json `
+ --ci `
+ | convertFrom-Json
- $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]'
- $apiHeaders.Add('Accept', 'application/json')
- $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}")
-
- $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
-
- $BarId = $Env:BARBuildId
+ $BarId = ${{ parameters.BARBuildId }}
$Channels = $Env:PromoteToMaestroChannels -split ","
$Channels = $Channels -join "]["
$Channels = "[$Channels]"
@@ -69,6 +71,4 @@ steps:
exit 1
}
env:
- MAESTRO_API_TOKEN: $(MaestroApiAccessToken)
- BARBuildId: ${{ parameters.BARBuildId }}
PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }}
diff --git a/eng/common/core-templates/steps/component-governance.yml b/eng/common/core-templates/steps/component-governance.yml
index df449a34c1..cf0649aa95 100644
--- a/eng/common/core-templates/steps/component-governance.yml
+++ b/eng/common/core-templates/steps/component-governance.yml
@@ -2,7 +2,8 @@ parameters:
disableComponentGovernance: false
componentGovernanceIgnoreDirectories: ''
is1ESPipeline: false
-
+ displayName: 'Component Detection'
+
steps:
- ${{ if eq(parameters.disableComponentGovernance, 'true') }}:
- script: echo "##vso[task.setvariable variable=skipComponentGovernanceDetection]true"
@@ -10,5 +11,6 @@ steps:
- ${{ if ne(parameters.disableComponentGovernance, 'true') }}:
- task: ComponentGovernanceComponentDetection@0
continueOnError: true
+ displayName: ${{ parameters.displayName }}
inputs:
- ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
\ No newline at end of file
+ ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
diff --git a/eng/common/core-templates/steps/enable-internal-sources.yml b/eng/common/core-templates/steps/enable-internal-sources.yml
index 80deddafb1..64f881bffc 100644
--- a/eng/common/core-templates/steps/enable-internal-sources.yml
+++ b/eng/common/core-templates/steps/enable-internal-sources.yml
@@ -6,30 +6,42 @@ parameters:
- name: is1ESPipeline
type: boolean
default: false
+# Legacy parameters to allow for PAT usage
+- name: legacyCredential
+ type: string
+ default: ''
steps:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate.
- # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that
- # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token.
- - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
+ - ${{ if ne(parameters.legacyCredential, '') }}:
- task: PowerShell@2
displayName: Setup Internal Feeds
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
- arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config
- - task: NuGetAuthenticate@1
+ arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
+ env:
+ Token: ${{ parameters.legacyCredential }}
+ # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate.
+ # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that
+ # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token.
- ${{ else }}:
- - template: /eng/common/templates/steps/get-federated-access-token.yml
- parameters:
- federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }}
- outputVariableName: 'dnceng-artifacts-feeds-read-access-token'
- - task: PowerShell@2
- displayName: Setup Internal Feeds
- inputs:
- filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
- arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token)
- # This is required in certain scenarios to install the ADO credential provider.
- # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others
- # (e.g. dotnet msbuild).
- - task: NuGetAuthenticate@1
+ - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
+ - task: PowerShell@2
+ displayName: Setup Internal Feeds
+ inputs:
+ filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
+ arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config
+ - ${{ else }}:
+ - template: /eng/common/templates/steps/get-federated-access-token.yml
+ parameters:
+ federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }}
+ outputVariableName: 'dnceng-artifacts-feeds-read-access-token'
+ - task: PowerShell@2
+ displayName: Setup Internal Feeds
+ inputs:
+ filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
+ arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token)
+ # This is required in certain scenarios to install the ADO credential provider.
+ # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others
+ # (e.g. dotnet msbuild).
+ - task: NuGetAuthenticate@1
diff --git a/eng/common/core-templates/steps/get-federated-access-token.yml b/eng/common/core-templates/steps/get-federated-access-token.yml
index c8c49cc0e8..3a4d4410c4 100644
--- a/eng/common/core-templates/steps/get-federated-access-token.yml
+++ b/eng/common/core-templates/steps/get-federated-access-token.yml
@@ -3,6 +3,14 @@ parameters:
type: string
- name: outputVariableName
type: string
+- name: is1ESPipeline
+ type: boolean
+- name: stepName
+ type: string
+ default: 'getFederatedAccessToken'
+- name: condition
+ type: string
+ default: ''
# Resource to get a token for. Common values include:
# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps
# - 'https://storage.azure.com/' for storage
@@ -10,10 +18,16 @@ parameters:
- name: resource
type: string
default: '499b84ac-1321-427f-aa17-267ca6975798'
+- name: isStepOutputVariable
+ type: boolean
+ default: false
steps:
- task: AzureCLI@2
displayName: 'Getting federated access token for feeds'
+ name: ${{ parameters.stepName }}
+ ${{ if ne(parameters.condition, '') }}:
+ condition: ${{ parameters.condition }}
inputs:
azureSubscription: ${{ parameters.federatedServiceConnection }}
scriptType: 'pscore'
@@ -25,4 +39,4 @@ steps:
exit 1
}
Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value"
- Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken"
\ No newline at end of file
+ Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken"
\ No newline at end of file
diff --git a/eng/common/core-templates/steps/publish-logs.yml b/eng/common/core-templates/steps/publish-logs.yml
index 8c5ea77b58..80788c5231 100644
--- a/eng/common/core-templates/steps/publish-logs.yml
+++ b/eng/common/core-templates/steps/publish-logs.yml
@@ -32,7 +32,6 @@ steps:
'$(MaestroAccessToken)'
'$(dn-bot-all-orgs-artifact-feeds-rw)'
'$(akams-client-id)'
- '$(akams-client-secret)'
'$(microsoft-symbol-server-pat)'
'$(symweb-symbol-server-pat)'
'$(dn-bot-all-orgs-build-rw-code-rw)'
diff --git a/eng/common/core-templates/steps/source-build.yml b/eng/common/core-templates/steps/source-build.yml
index 16c778d92c..2915d29bb7 100644
--- a/eng/common/core-templates/steps/source-build.yml
+++ b/eng/common/core-templates/steps/source-build.yml
@@ -121,7 +121,9 @@ steps:
# a nupkg cache of input packages (a local feed).
# This path must match the upstream cache path in property 'CurrentRepoSourceBuiltNupkgCacheDir'
# in src\Microsoft.DotNet.Arcade.Sdk\tools\SourceBuild\SourceBuildArcade.targets
-- task: ComponentGovernanceComponentDetection@0
- displayName: Component Detection (Exclude upstream cache)
- inputs:
- ignoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache'
+- template: /eng/common/core-templates/steps/component-governance.yml
+ parameters:
+ displayName: Component Detection (Exclude upstream cache)
+ is1ESPipeline: ${{ parameters.is1ESPipeline }}
+ componentGovernanceIgnoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache'
+ disableComponentGovernance: ${{ eq(variables['System.TeamProject'], 'public') }}
diff --git a/eng/common/cross/arm/sources.list.bionic b/eng/common/cross/arm/sources.list.bionic
deleted file mode 100644
index 2109557409..0000000000
--- a/eng/common/cross/arm/sources.list.bionic
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
diff --git a/eng/common/cross/arm/sources.list.focal b/eng/common/cross/arm/sources.list.focal
deleted file mode 100644
index 4de2600c17..0000000000
--- a/eng/common/cross/arm/sources.list.focal
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
diff --git a/eng/common/cross/arm/sources.list.jammy b/eng/common/cross/arm/sources.list.jammy
deleted file mode 100644
index 6bb0453029..0000000000
--- a/eng/common/cross/arm/sources.list.jammy
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
diff --git a/eng/common/cross/arm/sources.list.jessie b/eng/common/cross/arm/sources.list.jessie
deleted file mode 100644
index 4d142ac9b1..0000000000
--- a/eng/common/cross/arm/sources.list.jessie
+++ /dev/null
@@ -1,3 +0,0 @@
-# Debian (sid) # UNSTABLE
-deb http://ftp.debian.org/debian/ sid main contrib non-free
-deb-src http://ftp.debian.org/debian/ sid main contrib non-free
diff --git a/eng/common/cross/arm/sources.list.xenial b/eng/common/cross/arm/sources.list.xenial
deleted file mode 100644
index 56fbb36a59..0000000000
--- a/eng/common/cross/arm/sources.list.xenial
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
diff --git a/eng/common/cross/arm/sources.list.zesty b/eng/common/cross/arm/sources.list.zesty
deleted file mode 100644
index ea2c14a787..0000000000
--- a/eng/common/cross/arm/sources.list.zesty
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.bionic b/eng/common/cross/arm64/sources.list.bionic
deleted file mode 100644
index 2109557409..0000000000
--- a/eng/common/cross/arm64/sources.list.bionic
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.buster b/eng/common/cross/arm64/sources.list.buster
deleted file mode 100644
index 7194ac64a9..0000000000
--- a/eng/common/cross/arm64/sources.list.buster
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://deb.debian.org/debian buster main
-deb-src http://deb.debian.org/debian buster main
-
-deb http://deb.debian.org/debian-security/ buster/updates main
-deb-src http://deb.debian.org/debian-security/ buster/updates main
-
-deb http://deb.debian.org/debian buster-updates main
-deb-src http://deb.debian.org/debian buster-updates main
-
-deb http://deb.debian.org/debian buster-backports main contrib non-free
-deb-src http://deb.debian.org/debian buster-backports main contrib non-free
diff --git a/eng/common/cross/arm64/sources.list.focal b/eng/common/cross/arm64/sources.list.focal
deleted file mode 100644
index 4de2600c17..0000000000
--- a/eng/common/cross/arm64/sources.list.focal
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.jammy b/eng/common/cross/arm64/sources.list.jammy
deleted file mode 100644
index 6bb0453029..0000000000
--- a/eng/common/cross/arm64/sources.list.jammy
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.stretch b/eng/common/cross/arm64/sources.list.stretch
deleted file mode 100644
index 0e12157743..0000000000
--- a/eng/common/cross/arm64/sources.list.stretch
+++ /dev/null
@@ -1,12 +0,0 @@
-deb http://deb.debian.org/debian stretch main
-deb-src http://deb.debian.org/debian stretch main
-
-deb http://deb.debian.org/debian-security/ stretch/updates main
-deb-src http://deb.debian.org/debian-security/ stretch/updates main
-
-deb http://deb.debian.org/debian stretch-updates main
-deb-src http://deb.debian.org/debian stretch-updates main
-
-deb http://deb.debian.org/debian stretch-backports main contrib non-free
-deb-src http://deb.debian.org/debian stretch-backports main contrib non-free
-
diff --git a/eng/common/cross/arm64/sources.list.xenial b/eng/common/cross/arm64/sources.list.xenial
deleted file mode 100644
index 56fbb36a59..0000000000
--- a/eng/common/cross/arm64/sources.list.xenial
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
diff --git a/eng/common/cross/arm64/sources.list.zesty b/eng/common/cross/arm64/sources.list.zesty
deleted file mode 100644
index ea2c14a787..0000000000
--- a/eng/common/cross/arm64/sources.list.zesty
+++ /dev/null
@@ -1,11 +0,0 @@
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
-
-deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
-deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
diff --git a/eng/common/cross/armel/sources.list.jessie b/eng/common/cross/armel/sources.list.jessie
deleted file mode 100644
index 3d9c3059d8..0000000000
--- a/eng/common/cross/armel/sources.list.jessie
+++ /dev/null
@@ -1,3 +0,0 @@
-# Debian (jessie) # Stable
-deb http://ftp.debian.org/debian/ jessie main contrib non-free
-deb-src http://ftp.debian.org/debian/ jessie main contrib non-free
diff --git a/eng/common/cross/armv6/sources.list.bookworm b/eng/common/cross/armv6/sources.list.bookworm
deleted file mode 100644
index 1016113526..0000000000
--- a/eng/common/cross/armv6/sources.list.bookworm
+++ /dev/null
@@ -1,2 +0,0 @@
-deb http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi
-deb-src http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi
diff --git a/eng/common/cross/armv6/sources.list.buster b/eng/common/cross/armv6/sources.list.buster
deleted file mode 100644
index f27fc4fb34..0000000000
--- a/eng/common/cross/armv6/sources.list.buster
+++ /dev/null
@@ -1,2 +0,0 @@
-deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
-deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh
index 7455dcb6af..4b5e8d7166 100644
--- a/eng/common/cross/build-rootfs.sh
+++ b/eng/common/cross/build-rootfs.sh
@@ -30,7 +30,8 @@ __IllumosArch=arm7
__HaikuArch=arm
__QEMUArch=arm
__UbuntuArch=armhf
-__UbuntuRepo="http://ports.ubuntu.com/"
+__UbuntuRepo=
+__UbuntuSuites="updates security backports"
__LLDB_Package="liblldb-3.9-dev"
__SkipUnmount=0
@@ -71,7 +72,7 @@ __AlpinePackages+=" krb5-dev"
__AlpinePackages+=" openssl-dev"
__AlpinePackages+=" zlib-dev"
-__FreeBSDBase="13.2-RELEASE"
+__FreeBSDBase="13.3-RELEASE"
__FreeBSDPkg="1.17.0"
__FreeBSDABI="13"
__FreeBSDPackages="libunwind"
@@ -129,6 +130,7 @@ __AlpineKeys='
616db30d:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnpUpyWDWjlUk3smlWeA0\nlIMW+oJ38t92CRLHH3IqRhyECBRW0d0aRGtq7TY8PmxjjvBZrxTNDpJT6KUk4LRm\na6A6IuAI7QnNK8SJqM0DLzlpygd7GJf8ZL9SoHSH+gFsYF67Cpooz/YDqWrlN7Vw\ntO00s0B+eXy+PCXYU7VSfuWFGK8TGEv6HfGMALLjhqMManyvfp8hz3ubN1rK3c8C\nUS/ilRh1qckdbtPvoDPhSbTDmfU1g/EfRSIEXBrIMLg9ka/XB9PvWRrekrppnQzP\nhP9YE3x/wbFc5QqQWiRCYyQl/rgIMOXvIxhkfe8H5n1Et4VAorkpEAXdsfN8KSVv\nLSMazVlLp9GYq5SUpqYX3KnxdWBgN7BJoZ4sltsTpHQ/34SXWfu3UmyUveWj7wp0\nx9hwsPirVI00EEea9AbP7NM2rAyu6ukcm4m6ATd2DZJIViq2es6m60AE6SMCmrQF\nwmk4H/kdQgeAELVfGOm2VyJ3z69fQuywz7xu27S6zTKi05Qlnohxol4wVb6OB7qG\nLPRtK9ObgzRo/OPumyXqlzAi/Yvyd1ZQk8labZps3e16bQp8+pVPiumWioMFJDWV\nGZjCmyMSU8V6MB6njbgLHoyg2LCukCAeSjbPGGGYhnKLm1AKSoJh3IpZuqcKCk5C\n8CM1S15HxV78s9dFntEqIokCAwEAAQ==
'
__Keyring=
+__KeyringFile="/usr/share/keyrings/ubuntu-archive-keyring.gpg"
__SkipSigCheck=0
__UseMirror=0
@@ -162,6 +164,7 @@ while :; do
__UbuntuArch=armel
__UbuntuRepo="http://ftp.debian.org/debian/"
__CodeName=jessie
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
;;
armv6)
__BuildArch=armv6
@@ -169,10 +172,12 @@ while :; do
__QEMUArch=arm
__UbuntuRepo="http://raspbian.raspberrypi.org/raspbian/"
__CodeName=buster
+ __KeyringFile="/usr/share/keyrings/raspbian-archive-keyring.gpg"
__LLDB_Package="liblldb-6.0-dev"
+ __UbuntuSuites=
- if [[ -e "/usr/share/keyrings/raspbian-archive-keyring.gpg" ]]; then
- __Keyring="--keyring /usr/share/keyrings/raspbian-archive-keyring.gpg"
+ if [[ -e "$__KeyringFile" ]]; then
+ __Keyring="--keyring $__KeyringFile"
fi
;;
riscv64)
@@ -181,13 +186,8 @@ while :; do
__AlpinePackages="${__AlpinePackages// lldb-dev/}"
__QEMUArch=riscv64
__UbuntuArch=riscv64
- __UbuntuRepo="http://deb.debian.org/debian"
__UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}"
unset __LLDB_Package
-
- if [[ -e "/usr/share/keyrings/debian-archive-keyring.gpg" ]]; then
- __Keyring="--keyring /usr/share/keyrings/debian-archive-keyring.gpg --include=debian-archive-keyring"
- fi
;;
ppc64le)
__BuildArch=ppc64le
@@ -288,8 +288,17 @@ while :; do
__CodeName=jammy
fi
;;
+ noble) # Ubuntu 24.04
+ if [[ "$__CodeName" != "jessie" ]]; then
+ __CodeName=noble
+ fi
+ if [[ -n "$__LLDB_Package" ]]; then
+ __LLDB_Package="liblldb-18-dev"
+ fi
+ ;;
jessie) # Debian 8
__CodeName=jessie
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -298,6 +307,7 @@ while :; do
stretch) # Debian 9
__CodeName=stretch
__LLDB_Package="liblldb-6.0-dev"
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -306,6 +316,7 @@ while :; do
buster) # Debian 10
__CodeName=buster
__LLDB_Package="liblldb-6.0-dev"
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -313,6 +324,7 @@ while :; do
;;
bullseye) # Debian 11
__CodeName=bullseye
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -320,6 +332,7 @@ while :; do
;;
bookworm) # Debian 12
__CodeName=bookworm
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -327,6 +340,7 @@ while :; do
;;
sid) # Debian sid
__CodeName=sid
+ __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg"
if [[ -z "$__UbuntuRepo" ]]; then
__UbuntuRepo="http://ftp.debian.org/debian/"
@@ -436,6 +450,10 @@ fi
__UbuntuPackages+=" ${__LLDB_Package:-}"
+if [[ -z "$__UbuntuRepo" ]]; then
+ __UbuntuRepo="http://ports.ubuntu.com/"
+fi
+
if [[ -n "$__LLVM_MajorVersion" ]]; then
__UbuntuPackages+=" libclang-common-${__LLVM_MajorVersion}${__LLVM_MinorVersion:+.$__LLVM_MinorVersion}-dev"
fi
@@ -587,18 +605,18 @@ elif [[ "$__CodeName" == "illumos" ]]; then
fi
echo "Building binutils. Please wait.."
if [[ "$__hasWget" == 1 ]]; then
- wget -O- https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf -
+ wget -O- https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz | tar -xJf -
else
- curl -SL https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf -
+ curl -SL https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz | tar -xJf -
fi
mkdir build-binutils && cd build-binutils
- ../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir"
+ ../binutils-2.42/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.11" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir"
make -j "$JOBS" && make install && cd ..
echo "Building gcc. Please wait.."
if [[ "$__hasWget" == 1 ]]; then
- wget -O- https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf -
+ wget -O- https://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz | tar -xJf -
else
- curl -SL https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf -
+ curl -SL https://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz | tar -xJf -
fi
CFLAGS="-fPIC"
CXXFLAGS="-fPIC"
@@ -606,7 +624,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then
CFLAGS_FOR_TARGET="-fPIC"
export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET
mkdir build-gcc && cd build-gcc
- ../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \
+ ../gcc-13.3.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.11" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \
--with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \
--disable-libquadmath-support --disable-shared --enable-tls
make -j "$JOBS" && make install && cd ..
@@ -614,7 +632,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then
if [[ "$__UseMirror" == 1 ]]; then
BaseUrl=https://pkgsrc.smartos.skylime.net
fi
- BaseUrl="$BaseUrl/packages/SmartOS/trunk/${__illumosArch}/All"
+ BaseUrl="$BaseUrl/packages/SmartOS/2019Q4/${__illumosArch}/All"
echo "Downloading manifest"
if [[ "$__hasWget" == 1 ]]; then
wget "$BaseUrl"
@@ -732,8 +750,18 @@ elif [[ -n "$__CodeName" ]]; then
fi
# shellcheck disable=SC2086
+ echo running debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo"
debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo"
- cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list"
+
+ mkdir -p "$__RootfsDir/etc/apt/sources.list.d/"
+ cat > "$__RootfsDir/etc/apt/sources.list.d/$__CodeName.sources" < 0 ]]; do
diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh
index a2fba47038..7b9d97e3bd 100755
--- a/eng/common/dotnet-install.sh
+++ b/eng/common/dotnet-install.sh
@@ -71,6 +71,9 @@ case $cpuname in
i[3-6]86)
buildarch=x86
;;
+ riscv64)
+ buildarch=riscv64
+ ;;
*)
echo "Unknown CPU $cpuname detected, treating it as x64"
buildarch=x64
diff --git a/eng/common/native/CommonLibrary.psm1 b/eng/common/native/CommonLibrary.psm1
index ca38268c44..f71f6af6cd 100644
--- a/eng/common/native/CommonLibrary.psm1
+++ b/eng/common/native/CommonLibrary.psm1
@@ -277,7 +277,8 @@ function Get-MachineArchitecture {
if (($ProcessorArchitecture -Eq "AMD64") -Or
($ProcessorArchitecture -Eq "IA64") -Or
($ProcessorArchitecture -Eq "ARM64") -Or
- ($ProcessorArchitecture -Eq "LOONGARCH64")) {
+ ($ProcessorArchitecture -Eq "LOONGARCH64") -Or
+ ($ProcessorArchitecture -Eq "RISCV64")) {
return "x64"
}
return "x86"
diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh
index 62900e12b2..9a0e1f2b45 100644
--- a/eng/common/native/init-compiler.sh
+++ b/eng/common/native/init-compiler.sh
@@ -19,11 +19,9 @@ case "$compiler" in
# clangx.y or clang-x.y
version="$(echo "$compiler" | tr -d '[:alpha:]-=')"
majorVersion="${version%%.*}"
- [ -z "${version##*.*}" ] && minorVersion="${version#*.}"
- if [ -z "$minorVersion" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -le 6 ]; then
- minorVersion=0;
- fi
+ # LLVM based on v18 released in early 2024, with two releases per year
+ maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 6)))"
compiler=clang
;;
@@ -31,7 +29,9 @@ case "$compiler" in
# gccx.y or gcc-x.y
version="$(echo "$compiler" | tr -d '[:alpha:]-=')"
majorVersion="${version%%.*}"
- [ -z "${version##*.*}" ] && minorVersion="${version#*.}"
+
+ # GCC based on v14 released in early 2024, with one release per year
+ maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 12)))"
compiler=gcc
;;
esac
@@ -49,12 +49,10 @@ check_version_exists() {
desired_version=-1
# Set up the environment to be used for building with the desired compiler.
- if command -v "$compiler-$1.$2" > /dev/null; then
- desired_version="-$1.$2"
- elif command -v "$compiler$1$2" > /dev/null; then
- desired_version="$1$2"
- elif command -v "$compiler-$1$2" > /dev/null; then
- desired_version="-$1$2"
+ if command -v "$compiler-$1" > /dev/null; then
+ desired_version="-$1"
+ elif command -v "$compiler$1" > /dev/null; then
+ desired_version="$1"
fi
echo "$desired_version"
@@ -75,7 +73,7 @@ set_compiler_version_from_CC() {
fi
# gcc and clang often display 3 part versions. However, gcc can show only 1 part in some environments.
- IFS=. read -r majorVersion minorVersion _ < /dev/null; then
- echo "Error: No usable version of $compiler found."
+ echo "Error: No compatible version of $compiler was found within the range of $minVersion to $maxVersion. Please upgrade your toolchain or specify the compiler explicitly using CLR_CC and CLR_CXX environment variables."
exit 1
fi
CC="$(command -v "$compiler" 2> /dev/null)"
CXX="$(command -v "$cxxCompiler" 2> /dev/null)"
set_compiler_version_from_CC
- else
- if [ "$compiler" = "clang" ] && [ "$majorVersion" -lt 5 ] && { [ "$build_arch" = "arm" ] || [ "$build_arch" = "armel" ]; }; then
- # If a major version was provided explicitly, and it was too old, find a newer compiler instead
- if ! command -v "$compiler" > /dev/null; then
- echo "Error: Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH."
- exit 1
- fi
-
- CC="$(command -v "$compiler" 2> /dev/null)"
- CXX="$(command -v "$cxxCompiler" 2> /dev/null)"
- set_compiler_version_from_CC
- fi
fi
else
- desired_version="$(check_version_exists "$majorVersion" "$minorVersion")"
+ desired_version="$(check_version_exists "$majorVersion")"
if [ "$desired_version" = "-1" ]; then
- echo "Error: Could not find specific version of $compiler: $majorVersion $minorVersion."
+ echo "Error: Could not find specific version of $compiler: $majorVersion."
exit 1
fi
fi
diff --git a/eng/common/post-build/nuget-validation.ps1 b/eng/common/post-build/nuget-validation.ps1
index 9c81aa4391..e5de00c898 100644
--- a/eng/common/post-build/nuget-validation.ps1
+++ b/eng/common/post-build/nuget-validation.ps1
@@ -5,6 +5,13 @@ param(
[Parameter(Mandatory=$true)][string] $PackagesPath # Path to where the packages to be validated are
)
+# `tools.ps1` checks $ci to perform some actions. Since the post-build
+# scripts don't necessarily execute in the same agent that run the
+# build.ps1/sh script this variable isn't automatically set.
+$ci = $true
+$disableConfigureToolsetImport = $true
+. $PSScriptRoot\..\tools.ps1
+
try {
& $PSScriptRoot\nuget-verification.ps1 ${PackagesPath}\*.nupkg
}
diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1
index e831d5c1d2..90b58e32a8 100644
--- a/eng/common/post-build/publish-using-darc.ps1
+++ b/eng/common/post-build/publish-using-darc.ps1
@@ -2,7 +2,6 @@ param(
[Parameter(Mandatory=$true)][int] $BuildId,
[Parameter(Mandatory=$true)][int] $PublishingInfraVersion,
[Parameter(Mandatory=$true)][string] $AzdoToken,
- [Parameter(Mandatory=$true)][string] $MaestroToken,
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net',
[Parameter(Mandatory=$true)][string] $WaitPublishingFinish,
[Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters,
@@ -36,13 +35,14 @@ try {
}
& $darc add-build-to-channel `
- --id $buildId `
- --publishing-infra-version $PublishingInfraVersion `
- --default-channels `
- --source-branch main `
- --azdev-pat $AzdoToken `
- --bar-uri $MaestroApiEndPoint `
- --password $MaestroToken `
+ --id $buildId `
+ --publishing-infra-version $PublishingInfraVersion `
+ --default-channels `
+ --source-branch main `
+ --azdev-pat "$AzdoToken" `
+ --bar-uri "$MaestroApiEndPoint" `
+ --ci `
+ --verbose `
@optionalParams
if ($LastExitCode -ne 0) {
diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml
index 5920952c5b..8da477dd69 100644
--- a/eng/common/templates/job/job.yml
+++ b/eng/common/templates/job/job.yml
@@ -1,5 +1,11 @@
parameters:
enablePublishBuildArtifacts: false
+ disableComponentGovernance: ''
+ componentGovernanceIgnoreDirectories: ''
+# Sbom related params
+ enableSbom: true
+ PackageVersion: 9.0.0
+ BuildDropPath: '$(Build.SourcesDirectory)/artifacts'
jobs:
- template: /eng/common/core-templates/job/job.yml
@@ -13,6 +19,26 @@ jobs:
steps:
- ${{ each step in parameters.steps }}:
- ${{ step }}
+
+ componentGovernanceSteps:
+ - template: /eng/common/templates/steps/component-governance.yml
+ parameters:
+ ${{ if eq(parameters.disableComponentGovernance, '') }}:
+ ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.runAsPublic, 'false'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dotnet/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/microsoft/'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}:
+ disableComponentGovernance: false
+ ${{ else }}:
+ disableComponentGovernance: true
+ ${{ else }}:
+ disableComponentGovernance: ${{ parameters.disableComponentGovernance }}
+ componentGovernanceIgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
+
+ - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}:
+ - template: /eng/common/templates/steps/generate-sbom.yml
+ parameters:
+ PackageVersion: ${{ parameters.packageVersion }}
+ BuildDropPath: ${{ parameters.buildDropPath }}
+ publishArtifacts: false
+
artifactPublishSteps:
- ${{ if ne(parameters.artifacts.publish, '') }}:
diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1
index 0febe696db..9574f4eb9d 100644
--- a/eng/common/tools.ps1
+++ b/eng/common/tools.ps1
@@ -653,7 +653,7 @@ function GetNuGetPackageCachePath() {
$env:NUGET_PACKAGES = Join-Path $env:UserProfile '.nuget\packages\'
} else {
$env:NUGET_PACKAGES = Join-Path $RepoRoot '.packages\'
- $env:RESTORENOCACHE = $true
+ $env:RESTORENOHTTPCACHE = $true
}
}
diff --git a/eng/common/tools.sh b/eng/common/tools.sh
index a4f5d1b776..00473c9f91 100644
--- a/eng/common/tools.sh
+++ b/eng/common/tools.sh
@@ -347,14 +347,14 @@ function InitializeBuildTool {
fi
}
-# Set RestoreNoCache as a workaround for https://github.com/NuGet/Home/issues/3116
+# Set RestoreNoHttpCache as a workaround for https://github.com/NuGet/Home/issues/3116
function GetNuGetPackageCachePath {
if [[ -z ${NUGET_PACKAGES:-} ]]; then
if [[ "$use_global_nuget_cache" == true ]]; then
- export NUGET_PACKAGES="$HOME/.nuget/packages"
+ export NUGET_PACKAGES="$HOME/.nuget/packages/"
else
- export NUGET_PACKAGES="$repo_root/.packages"
- export RESTORENOCACHE=true
+ export NUGET_PACKAGES="$repo_root/.packages/"
+ export RESTORENOHTTPCACHE=true
fi
fi
diff --git a/eng/verify-nupkgs-exe-version.ps1 b/eng/verify-nupkgs-exe-version.ps1
deleted file mode 100644
index 7535b9aef3..0000000000
--- a/eng/verify-nupkgs-exe-version.ps1
+++ /dev/null
@@ -1,8 +0,0 @@
-Get-ChildItem S:\p\vstest3\artifacts\packages\Debug\Shipping -Filter vstest.console.exe -Recurse -Force | ForEach-Object {
- if ($_.VersionInfo.ProductVersion.Contains("+")) {
- throw "Some files contain '+' in the ProductVersion, this breaks DTAAgent in AzDO."
- }
- else {
- "$_ version $($_.VersionInfo.ProductVersion) is ok."
- }
-}
\ No newline at end of file
diff --git a/eng/verify-nupkgs-exe.ps1 b/eng/verify-nupkgs-exe.ps1
deleted file mode 100644
index 459a4dcb43..0000000000
--- a/eng/verify-nupkgs-exe.ps1
+++ /dev/null
@@ -1,90 +0,0 @@
-$exclusions = @{
- "CodeCoverage\CodeCoverage.exe" = "x86"
- "Dynamic Code Coverage Tools\CodeCoverage.exe" = "x86"
- "amd64\CodeCoverage.exe" = "x64"
-
- "IntelliTrace.exe" = "x86"
- "ProcessSnapshotCleanup.exe" = "x86-64"
- "TDEnvCleanup.exe" = "x86"
-
- "TestPlatform\SettingsMigrator.exe" = "x86"
-
- "dump\DumpMinitool.exe" = "x86-64"
-
- "QTAgent32.exe" = "x86"
- "QTAgent32_35.exe" = "x86"
- "QTAgent32_40.exe" = "x86"
- "QTDCAgent32.exe" = "x86"
-
- "V1\VSTestVideoRecorder.exe" = "x86"
- "VideoRecorder\VSTestVideoRecorder.exe" = "x86"
-}
-
-$errs = @()
-Get-ChildItem S:\p\vstest3\artifacts\packages\Debug\Shipping -Filter *.exe -Recurse -Force | ForEach-Object {
- $m = & "C:\Program Files\Microsoft Visual Studio\2022\IntPreview\VC\Tools\MSVC\14.38.32919\bin\HostX86\x86\dumpbin.exe" /headers $_.FullName | Select-String "machine \((.*)\)"
- if (-not $m.Matches.Success) {
- $err = "Did not find the platform of the exe $fullName)."
- }
-
- $platform = $m.Matches.Groups[1].Value
- $fullName = $_.FullName
- $name = $_.Name
-
- if ("x86" -eq $platform) {
- $corFlags = "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\CorFlags.exe"
- $corFlagsOutput = & $corFlags $fullName
- # this is an native x86 exe or a .net x86 that requires of prefers 32bit
- $platform = if ($corFlagsOutput -like "*does not have a valid managed header*" -or $corFlagsOutput -like "*32BITREQ : 1*" -or $corFlagsOutput -like "*32BITPREF : 1*") {
- # this is an native x86 exe or a .net x86 that requires of prefers 32bit
- "x86" } else {
- # this is a x86 executable that is built as AnyCpu and does not prefer 32-bit so it will run as x64 on 64-bit system.
- "x86-64" }
- }
-
- if (($pair = $exclusions.GetEnumerator() | Where-Object { $fullName -like "*$($_.Name)" })) {
- if (1 -lt $($pair).Count) {
- $err = "Too many paths matched the query, only one match is allowed. Matches: $($pair.Name)"
- $errs += $err
- Write-Host -ForegroundColor Red Error: $err
- }
-
- if ($platform -ne $pair.Value) {
- $err = "$fullName must have architecture $($pair.Value), but it was $platform."
- $errs += $err
- Write-Host -ForegroundColor Red Error: $err
- }
- }
- elseif ("x86" -eq $platform) {
- if ($name -notlike "*x86*") {
- $err = "$fullName has architecture $platform, and must contain x86 in the name of the executable."
- $errs += $err
- Write-Host -ForegroundColor Red Error: $err
- }
- }
- elseif ($platform -in "x64", "x86-64") {
- if ($name -like "*x86*" -or $name -like "*arm64*") {
- $err = "$fullName has architecture $platform, and must NOT contain x86 or arm64 in the name of the executable."
- $errs += $err
- Write-Host -ForegroundColor Red Error: $err
- }
- }
- elseif ("arm64" -eq $platform) {
- if ($name -notlike "*arm64*") {
- $err = "$fullName has architecture $platform, and must contain arm64 in the name of the executable."
- $errs += $err
- Write-Host -ForegroundColor Red Error: $err
- }
- }
- else {
- $err = "$fullName has unknown architecture $platform."
- $errs += $err
- Write-Host -ForegroundColor Red $err
- }
-
- "Success: $name is $platform - $fullName"
-}
-
-if ($errs) {
- throw "Fail!:`n$($errs -join "`n")"
-}
\ No newline at end of file
diff --git a/eng/verify-nupkgs.ps1 b/eng/verify-nupkgs.ps1
index c87d4ceaab..b3698ce7cc 100644
--- a/eng/verify-nupkgs.ps1
+++ b/eng/verify-nupkgs.ps1
@@ -19,9 +19,9 @@ function Verify-Nuget-Packages {
$expectedNumOfFiles = @{
"Microsoft.CodeCoverage" = 59;
"Microsoft.NET.Test.Sdk" = 15;
- "Microsoft.TestPlatform" = 607;
+ "Microsoft.TestPlatform" = 608;
"Microsoft.TestPlatform.Build" = 20;
- "Microsoft.TestPlatform.CLI" = 470;
+ "Microsoft.TestPlatform.CLI" = 471;
"Microsoft.TestPlatform.Extensions.TrxLogger" = 34;
"Microsoft.TestPlatform.ObjectModel" = 92;
"Microsoft.TestPlatform.AdapterUtilities" = 75;
@@ -98,9 +98,9 @@ function Verify-Nuget-Packages {
}
}
finally {
- if ($null -ne $unzipNugetPackageDir -and (Test-Path $unzipNugetPackageDir)) {
- Remove-Item -Force -Recurse $unzipNugetPackageDir | Out-Null
- }
+ # if ($null -ne $unzipNugetPackageDir -and (Test-Path $unzipNugetPackageDir)) {
+ # Remove-Item -Force -Recurse $unzipNugetPackageDir | Out-Null
+ # }
}
}
@@ -109,6 +109,7 @@ function Verify-Nuget-Packages {
}
Write-Host "Completed Verify-Nuget-Packages."
+ $unzipNugetPackageDirs
}
function Unzip {
@@ -156,4 +157,150 @@ function Verify-Version {
Match-VersionAgainstBranch -vsTestVersion $vsTestProductVersion -branchName $currentBranch -errors $errors
}
-Verify-Nuget-Packages
+function Verify-NugetPackageExe {
+ param(
+ [Parameter(Mandatory)]
+ [ValidateSet("Debug", "Release")]
+ [string] $configuration,
+ $UnzipNugetPackages
+ )
+
+
+ $exclusions = @{
+ "CodeCoverage\CodeCoverage.exe" = "x86"
+ "Dynamic Code Coverage Tools\CodeCoverage.exe" = "x86"
+ "amd64\CodeCoverage.exe" = "x64"
+
+ "IntelliTrace.exe" = "x86"
+ "ProcessSnapshotCleanup.exe" = "x86-64"
+ "TDEnvCleanup.exe" = "x86"
+
+ "TestPlatform\SettingsMigrator.exe" = "x86"
+
+ "dump\DumpMinitool.exe" = "x86-64"
+
+ "QTAgent32.exe" = "x86"
+ "QTAgent32_35.exe" = "x86"
+ "QTAgent32_40.exe" = "x86"
+ "QTDCAgent32.exe" = "x86"
+
+ "V1\VSTestVideoRecorder.exe" = "x86"
+ "VideoRecorder\VSTestVideoRecorder.exe" = "x86"
+ }
+
+ $errs = @()
+ $exes = $UnzipNugetPackages | Get-ChildItem -Filter *.exe -Recurse -Force
+ if (0 -eq @($exes).Length) {
+ throw "No exe files were found."
+ }
+
+ # use wow programfiles because they always point to x64 programfiles where VS is installed
+ $dumpBin = Get-ChildItem -Recurse -Force -Filter dumpbin.exe -path "$env:ProgramW6432\Microsoft Visual Studio\2022\Enterprise" | Select-Object -First 1
+ if (-not $dumpBin) {
+ throw "Did not find dumpbin.exe in '$env:ProgramW6432\Microsoft Visual Studio\2022\Enterprise'."
+ }
+
+ $corFlags = Get-ChildItem -Recurse -Force -Filter CorFlags.exe -path "${env:ProgramFiles(x86)}\Microsoft SDKs\Windows" | Select-Object -First 1
+ if (-not $corFlags) {
+ throw "Did not find CorFlags.exe in '${env:ProgramFiles(x86)}\Microsoft SDKs\Windows'."
+ }
+
+ $exes | ForEach-Object {
+ $m = & $dumpBin /headers $_.FullName | Select-String "machine \((.*)\)"
+ if (-not $m.Matches.Success) {
+ $err = "Did not find the platform of the exe $fullName)."
+ }
+
+ $platform = $m.Matches.Groups[1].Value
+ $fullName = $_.FullName
+ $name = $_.Name
+
+ if ("x86" -eq $platform) {
+ $corFlagsOutput = & $corFlags $fullName
+ # this is an native x86 exe or a .net x86 that requires of prefers 32bit
+ $platform = if ($corFlagsOutput -like "*does not have a valid managed header*" -or $corFlagsOutput -like "*32BITREQ : 1*" -or $corFlagsOutput -like "*32BITPREF : 1*") {
+ # this is an native x86 exe or a .net x86 that requires of prefers 32bit
+ "x86" } else {
+ # this is a x86 executable that is built as AnyCpu and does not prefer 32-bit so it will run as x64 on 64-bit system.
+ "x86-64" }
+ }
+
+ if (($pair = $exclusions.GetEnumerator() | Where-Object { $fullName -like "*$($_.Name)" })) {
+ if (1 -lt $($pair).Count) {
+ $err = "Too many paths matched the query, only one match is allowed. Matches: $($pair.Name)"
+ $errs += $err
+ Write-Host -ForegroundColor Red Error: $err
+ }
+
+ if ($platform -ne $pair.Value) {
+ $err = "$fullName must have architecture $($pair.Value), but it was $platform."
+ $errs += $err
+ Write-Host -ForegroundColor Red Error: $err
+ }
+ }
+ elseif ("x86" -eq $platform) {
+ if ($name -notlike "*x86*") {
+ $err = "$fullName has architecture $platform, and must contain x86 in the name of the executable."
+ $errs += $err
+ Write-Host -ForegroundColor Red Error: $err
+ }
+ }
+ elseif ($platform -in "x64", "x86-64") {
+ if ($name -like "*x86*" -or $name -like "*arm64*") {
+ $err = "$fullName has architecture $platform, and must NOT contain x86 or arm64 in the name of the executable."
+ $errs += $err
+ Write-Host -ForegroundColor Red Error: $err
+ }
+ }
+ elseif ("arm64" -eq $platform) {
+ if ($name -notlike "*arm64*") {
+ $err = "$fullName has architecture $platform, and must contain arm64 in the name of the executable."
+ $errs += $err
+ Write-Host -ForegroundColor Red Error: $err
+ }
+ }
+ else {
+ $err = "$fullName has unknown architecture $platform."
+ $errs += $err
+ Write-Host -ForegroundColor Red $err
+ }
+
+ "Success: $name is $platform - $fullName"
+ }
+
+ if ($errs) {
+ throw "Fail!:`n$($errs -join "`n")"
+ }
+}
+
+function Verify-NugetPackageVersion {
+ param(
+ [Parameter(Mandatory)]
+ [ValidateSet("Debug", "Release")]
+ [string] $configuration,
+ $UnzipNugetPackages
+ )
+
+ # look for vstest.console.dll because unified build for .NET does not produce vstest.console.exe
+ $exes = $UnzipNugetPackages | Get-ChildItem -Filter vstest.console.dll -Recurse -Force
+ if (0 -eq @($exes).Length) {
+ throw "No vstest.console.dll files were found."
+ }
+
+ $exes | ForEach-Object {
+ if ($_.VersionInfo.ProductVersion.Contains("+")) {
+ throw "$_ contains '+' in the ProductVersion $($_.VersionInfo.ProductVersion), this breaks DTAAgent in AzDO."
+ }
+ else {
+ "$_ version $($_.VersionInfo.ProductVersion) is ok."
+ }
+ }
+
+}
+
+
+$unzipNugetPackages = Verify-Nuget-Packages
+Start-sleep -Seconds 10
+# skipped, it is hard to find the right dumpbin.exe and corflags tools on server
+# Verify-NugetPackageExe -configuration $configuration -UnzipNugetPackages $unzipNugetPackages
+Verify-NugetPackageVersion -configuration $configuration -UnzipNugetPackages $unzipNugetPackages
diff --git a/global.json b/global.json
index 5d25f929eb..7ef6d61a2c 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "9.0.100-preview.4.24267.66",
+ "version": "9.0.100-preview.5.24307.3",
"rollForward": "minor",
"allowPrerelease": false,
"architecture": "x64"
@@ -11,17 +11,17 @@
"2.1.30",
"3.1.32",
"5.0.17",
- "6.0.29",
- "7.0.18",
- "8.0.4"
+ "6.0.32",
+ "7.0.20",
+ "8.0.7"
],
"dotnet/x86": [
"2.1.30",
"3.1.32",
"5.0.17",
- "6.0.29",
- "7.0.18",
- "8.0.4"
+ "6.0.32",
+ "7.0.20",
+ "8.0.7"
]
},
"vs": {
@@ -29,9 +29,9 @@
},
"xcopy-msbuild": "17.8.5",
"vswhere": "2.2.7",
- "dotnet": "9.0.100-preview.4.24267.66"
+ "dotnet": "9.0.100-preview.5.24307.3"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24306.4"
+ "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.2"
}
}
diff --git a/playground/Directory.Build.props b/playground/Directory.Build.props
index 60fd349d0a..6f5b8d7bf3 100644
--- a/playground/Directory.Build.props
+++ b/playground/Directory.Build.props
@@ -2,6 +2,6 @@
- true
+ true
diff --git a/playground/TestPlatform.Playground/Program.cs b/playground/TestPlatform.Playground/Program.cs
index 142b324cb3..0cebf6d996 100644
--- a/playground/TestPlatform.Playground/Program.cs
+++ b/playground/TestPlatform.Playground/Program.cs
@@ -105,7 +105,7 @@ static void Main()
// var processStartInfo = new ProcessStartInfo
// {
// FileName = console,
- // Arguments = $"{string.Join(" ", sources)} --settings:{settingsFile} --listtests",
+ // Arguments = $"{string.Join(" ", sources)} --settings:{settingsFile} --logger:trx;LogFileName=my.trx;WarnOnFileOverwrite=false",
// UseShellExecute = false,
// };
// EnvironmentVariables.Variables.ToList().ForEach(processStartInfo.Environment.Add);
diff --git a/playground/TestPlatform.Playground/TestPlatform.Playground.csproj b/playground/TestPlatform.Playground/TestPlatform.Playground.csproj
index f20a1bd4d8..9a5dcbffbe 100644
--- a/playground/TestPlatform.Playground/TestPlatform.Playground.csproj
+++ b/playground/TestPlatform.Playground/TestPlatform.Playground.csproj
@@ -32,6 +32,7 @@
+
@@ -74,6 +75,7 @@
+
diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props
index 60fd349d0a..6f5b8d7bf3 100644
--- a/samples/Directory.Build.props
+++ b/samples/Directory.Build.props
@@ -2,6 +2,6 @@
- true
+ true
diff --git a/shared/NullableAttributes.cs b/shared/NullableAttributes.cs
index ded53a2c9f..845ee9bdfa 100644
--- a/shared/NullableAttributes.cs
+++ b/shared/NullableAttributes.cs
@@ -96,7 +96,7 @@ internal sealed class MemberNotNullAttribute : Attribute
///
/// The field or property member that is promised to be not-null.
///
- public MemberNotNullAttribute(string member) => Members = new[] { member };
+ public MemberNotNullAttribute(string member) => Members = [member];
/// Initializes the attribute with the list of field and property members.
///
@@ -122,7 +122,7 @@ internal sealed class MemberNotNullWhenAttribute : Attribute
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
- Members = new[] { member };
+ Members = [member];
}
/// Initializes the attribute with the specified return value condition and list of field and property members.
diff --git a/src/AttachVS/AttachVS.csproj b/src/AttachVS/AttachVS.csproj
index 621a7d9654..480945c0e3 100644
--- a/src/AttachVS/AttachVS.csproj
+++ b/src/AttachVS/AttachVS.csproj
@@ -4,7 +4,7 @@
Exe
net7;net472
AttachVS
- true
+ true
diff --git a/src/DataCollectors/DumpMinitool.arm64/DumpMinitool.arm64.csproj b/src/DataCollectors/DumpMinitool.arm64/DumpMinitool.arm64.csproj
index 1efec3f46e..1163b54034 100644
--- a/src/DataCollectors/DumpMinitool.arm64/DumpMinitool.arm64.csproj
+++ b/src/DataCollectors/DumpMinitool.arm64/DumpMinitool.arm64.csproj
@@ -11,7 +11,7 @@
so order here matters. -->
AnyCPU
false
- true
+ true
-
+
+
-
+
+
-
+
Microsoft.TestPlatform.CLI.sourcebuild.product.nuspec
true
- false
+ false
$(OutputPath)
Microsoft.TestPlatform.CLI
vstest visual-studio unittest testplatform mstest microsoft test testing
diff --git a/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.nuspec b/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.nuspec
index 7af61c0a59..e5d37dcb48 100644
--- a/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.nuspec
+++ b/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.nuspec
@@ -45,6 +45,7 @@
+
diff --git a/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.sourcebuild.nuspec b/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.sourcebuild.nuspec
index 3f1469375e..163cd961fd 100644
--- a/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.sourcebuild.nuspec
+++ b/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.sourcebuild.nuspec
@@ -71,6 +71,8 @@
+
+
diff --git a/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.sourcebuild.product.nuspec b/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.sourcebuild.product.nuspec
index 5541bce3eb..e53eaba922 100644
--- a/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.sourcebuild.product.nuspec
+++ b/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.sourcebuild.product.nuspec
@@ -44,6 +44,7 @@
+
diff --git a/src/package/Microsoft.TestPlatform/Microsoft.TestPlatform.nuspec b/src/package/Microsoft.TestPlatform/Microsoft.TestPlatform.nuspec
index 0903b475db..921d46e25c 100644
--- a/src/package/Microsoft.TestPlatform/Microsoft.TestPlatform.nuspec
+++ b/src/package/Microsoft.TestPlatform/Microsoft.TestPlatform.nuspec
@@ -448,16 +448,16 @@
-
+
-
+
-
+
@@ -541,6 +541,7 @@
+
diff --git a/src/package/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI.csproj b/src/package/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI.csproj
index f711b8068a..c2fb1120e9 100644
--- a/src/package/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI.csproj
+++ b/src/package/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI.csproj
@@ -11,7 +11,7 @@
- true
+ true
false
false
false
diff --git a/src/testhost.x86/AppDomainEngineInvoker.cs b/src/testhost.x86/AppDomainEngineInvoker.cs
index 0401e6bc32..f26ac8557b 100644
--- a/src/testhost.x86/AppDomainEngineInvoker.cs
+++ b/src/testhost.x86/AppDomainEngineInvoker.cs
@@ -93,8 +93,7 @@ private AppDomain CreateNewAppDomain(string testSourcePath)
///
/// Create the Engine Invoker in new AppDomain based on test source path
///
- /// Test Source to run/discover tests for
- /// Merged config file if there is any merging of test config and test host config
+ /// The appdomain in which the invoker should be created.
///
private static IEngineInvoker CreateInvokerInAppDomain(AppDomain appDomain)
{
@@ -106,7 +105,7 @@ private static IEngineInvoker CreateInvokerInAppDomain(AppDomain appDomain)
false,
BindingFlags.Default,
null,
- new object?[] { CultureInfo.DefaultThreadCurrentUICulture?.Name, Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) },
+ [CultureInfo.DefaultThreadCurrentUICulture?.Name, Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)],
null,
null);
@@ -247,7 +246,7 @@ public CustomAssemblySetup(string uiCulture, string testPlatformPath)
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CreateSpecificCulture(uiCulture);
}
- _resolverPaths = new string[] { testPlatformPath, Path.Combine(testPlatformPath, "Extensions") };
+ _resolverPaths = [testPlatformPath, Path.Combine(testPlatformPath, "Extensions")];
_resolvedAssemblies = new Dictionary();
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
}
diff --git a/src/testhost.x86/UnitTestClient.cs b/src/testhost.x86/UnitTestClient.cs
index b28b0f4ce8..de0f39cfa6 100644
--- a/src/testhost.x86/UnitTestClient.cs
+++ b/src/testhost.x86/UnitTestClient.cs
@@ -55,6 +55,6 @@ internal static string[] SplitArguments(string commandLine)
parmChars[index] = '\n';
}
- return (new string(parmChars)).Split(new[] { '\n' });
+ return (new string(parmChars)).Split(['\n']);
}
}
diff --git a/src/vstest.console/CommandLine/Executor.cs b/src/vstest.console/CommandLine/Executor.cs
index beb8185b71..951a4166e1 100644
--- a/src/vstest.console/CommandLine/Executor.cs
+++ b/src/vstest.console/CommandLine/Executor.cs
@@ -141,7 +141,7 @@ internal int Execute(params string[]? args)
if (args == null || args.Length == 0 || args.Any(StringUtils.IsNullOrWhiteSpace))
{
Output.Error(true, CommandLineResources.NoArgumentsProvided);
- args = new string[] { HelpArgumentProcessor.CommandName };
+ args = [HelpArgumentProcessor.CommandName];
exitCode = 1;
}
diff --git a/src/vstest.console/InProcessVsTestConsoleWrapper.cs b/src/vstest.console/InProcessVsTestConsoleWrapper.cs
index 8ba865f64c..5dbdd0ea61 100644
--- a/src/vstest.console/InProcessVsTestConsoleWrapper.cs
+++ b/src/vstest.console/InProcessVsTestConsoleWrapper.cs
@@ -126,7 +126,8 @@ internal InProcessVsTestConsoleWrapper(
ProcessHelper.ExternalEnvironmentVariables = environmentVariableBaseline;
string someExistingFile = typeof(InProcessVsTestConsoleWrapper).Assembly.Location;
- var args = new VsTestConsoleProcessManager(someExistingFile).BuildArguments(consoleParameters);
+ using var manager = new VsTestConsoleProcessManager(someExistingFile);
+ var args = manager.BuildArguments(consoleParameters);
// Skip vstest.console path, we are already running in process, so it would just end up
// being understood as test dll to run. (it is present even though we don't provide
// dotnet path, because it is a .dll file).
diff --git a/src/vstest.console/Internal/ConsoleLogger.cs b/src/vstest.console/Internal/ConsoleLogger.cs
index 5df4885ebc..7d6ef0278f 100644
--- a/src/vstest.console/Internal/ConsoleLogger.cs
+++ b/src/vstest.console/Internal/ConsoleLogger.cs
@@ -909,6 +909,20 @@ public MinimalTestResult(TestResult testResult)
Outcome = testResult.Outcome;
StartTime = testResult.StartTime;
EndTime = testResult.EndTime;
+
+ // When the test framework (e.g. xUnit 2.x.x) does not report start or end time
+ // we assign it to UTC now when constructing the test result. But that does not
+ // work for our logger, because we take the earliest StartTime and oldest EndTime
+ // to calculate the duration and this makes the first test to be "missing" from the
+ // duration.
+ //
+ // Instead we subtract the duration to get a more accurate result. We also
+ // don't compare the times for equality because the times in the TestResult are assigned
+ // on two different lines so they don't have to be the same.
+ if (EndTime - StartTime < testResult.Duration)
+ {
+ StartTime = EndTime - testResult.Duration;
+ }
}
public TestCase TestCase { get; }
diff --git a/src/vstest.console/Internal/FilePatternParser.cs b/src/vstest.console/Internal/FilePatternParser.cs
index 918d7a3805..804739ca7e 100644
--- a/src/vstest.console/Internal/FilePatternParser.cs
+++ b/src/vstest.console/Internal/FilePatternParser.cs
@@ -27,7 +27,7 @@ public class FilePatternParser
{
private readonly Matcher _matcher;
private readonly IFileHelper _fileHelper;
- private readonly char[] _wildCardCharacters = { '*' };
+ private readonly char[] _wildCardCharacters = ['*'];
public FilePatternParser()
: this(new Matcher(), new FileHelper())
diff --git a/src/vstest.console/Internal/MSBuildLogger.cs b/src/vstest.console/Internal/MSBuildLogger.cs
index 7a087592eb..691236db32 100644
--- a/src/vstest.console/Internal/MSBuildLogger.cs
+++ b/src/vstest.console/Internal/MSBuildLogger.cs
@@ -78,7 +78,15 @@ private void TestMessageHandler(object? sender, TestRunMessageEventArgs e)
SendMessage($"output-info", e.Message);
break;
case TestMessageLevel.Warning:
- SendMessage($"output-warning", e.Message);
+ // Downgrade xUnit skip warning to info, otherwise any skipped test will report warning, which is often upgraded to error.
+ if (e.Message.EndsWith("[SKIP]"))
+ {
+ SendMessage($"output-info", e.Message);
+ }
+ else
+ {
+ SendMessage($"output-warning", e.Message);
+ }
break;
case TestMessageLevel.Error:
SendMessage($"output-error", e.Message);
diff --git a/src/vstest.console/Processors/CollectArgumentProcessor.cs b/src/vstest.console/Processors/CollectArgumentProcessor.cs
index 2a6ea0761f..c050e85f22 100644
--- a/src/vstest.console/Processors/CollectArgumentProcessor.cs
+++ b/src/vstest.console/Processors/CollectArgumentProcessor.cs
@@ -241,7 +241,7 @@ private static bool DoesDataCollectorSettingsExist(string friendlyName,
internal static void AddDataCollectorToRunSettings(string arguments, IRunSettingsProvider runSettingsManager, IFileHelper fileHelper)
{
- AddDataCollectorToRunSettings(new string[] { arguments }, runSettingsManager, fileHelper, string.Empty);
+ AddDataCollectorToRunSettings([arguments], runSettingsManager, fileHelper, string.Empty);
}
internal static void AddDataCollectorToRunSettings(string[] arguments, IRunSettingsProvider runSettingsManager, IFileHelper fileHelper, string exceptionMessage)
diff --git a/src/vstest.console/Processors/EnableBlameArgumentProcessor.cs b/src/vstest.console/Processors/EnableBlameArgumentProcessor.cs
index 139eb92e86..6afdcd808e 100644
--- a/src/vstest.console/Processors/EnableBlameArgumentProcessor.cs
+++ b/src/vstest.console/Processors/EnableBlameArgumentProcessor.cs
@@ -176,8 +176,6 @@ public void Initialize(string? argument)
///
/// Initialize blame.
///
- /// Enable dump.
- /// Blame parameters.
private void InitializeBlame(bool enableCrashDump, bool enableHangDump, bool monitorPostMortemDebugger, Dictionary? collectDumpParameters)
{
// Add Blame Logger
@@ -333,9 +331,6 @@ private static void AddMonitorPostMortemDebuggerNode(Dictionary
///
/// Adds node in outer node.
///
- /// Parameters.
- /// Xml document.
- /// Outer node.
private static void AddNode(Dictionary? parameters, XmlDocument xmlDocument, XmlElement outernode, string nodeName)
{
var dumpNode = xmlDocument.CreateElement(nodeName);
diff --git a/src/vstest.console/Processors/EnableCodeCoverageArgumentProcessor.cs b/src/vstest.console/Processors/EnableCodeCoverageArgumentProcessor.cs
index 783e2d967c..db2ce05372 100644
--- a/src/vstest.console/Processors/EnableCodeCoverageArgumentProcessor.cs
+++ b/src/vstest.console/Processors/EnableCodeCoverageArgumentProcessor.cs
@@ -77,7 +77,8 @@ internal class EnableCodeCoverageArgumentExecutor : IArgumentExecutor
internal const string FriendlyName = "Code Coverage";
private static readonly string XPathSeperator = "/";
- private static readonly string[] NodeNames = new string[] { Constants.RunSettingsName, Constants.DataCollectionRunSettingsName, Constants.DataCollectorsSettingName, Constants.DataCollectorSettingName };
+ private static readonly string[] NodeNames = [Constants.RunSettingsName, Constants.DataCollectionRunSettingsName, Constants.DataCollectorsSettingName, Constants.DataCollectorSettingName
+ ];
#region Default CodeCoverage Settings String
@@ -191,7 +192,6 @@ public ArgumentProcessorResult Execute()
///
/// Updates with code coverage settings if not configured.
///
- /// The run settings document.
private void UpdateWithCodeCoverageSettingsIfNotConfigured()
{
var runsettingsXml = _runSettingsManager.ActiveRunSettings?.SettingsXml;
@@ -258,7 +258,7 @@ private static string GetMissingNodesTextIfAny(string existingPath, string fullp
{
var xmlText = "{0}";
var nonExistingPath = fullpath.Substring(existingPath.Length);
- var requiredNodeNames = nonExistingPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ var requiredNodeNames = nonExistingPath.Split(['/'], StringSplitOptions.RemoveEmptyEntries);
var format = "<{0}>{1}{0}>";
foreach (var nodeName in requiredNodeNames)
diff --git a/src/vstest.console/Processors/EnableDiagArgumentProcessor.cs b/src/vstest.console/Processors/EnableDiagArgumentProcessor.cs
index c5cee215fe..d3bc5e6a6b 100644
--- a/src/vstest.console/Processors/EnableDiagArgumentProcessor.cs
+++ b/src/vstest.console/Processors/EnableDiagArgumentProcessor.cs
@@ -101,6 +101,7 @@ internal class EnableDiagArgumentExecutor : IArgumentExecutor
/// Default constructor.
///
/// The file helper.
+ /// Process helper
public EnableDiagArgumentExecutor(IFileHelper fileHelper, IProcessHelper processHelper)
{
_fileHelper = fileHelper;
diff --git a/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs b/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs
index f6580388e6..8bd9581d09 100644
--- a/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs
+++ b/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs
@@ -107,6 +107,8 @@ internal class ListFullyQualifiedTestsArgumentExecutor : IArgumentExecutor
///
/// The options.
///
+ /// Runsettings provider.
+ /// Test request manager.
public ListFullyQualifiedTestsArgumentExecutor(
CommandLineOptions options,
IRunSettingsProvider runSettingsProvider,
@@ -121,6 +123,9 @@ public ListFullyQualifiedTestsArgumentExecutor(
///
/// The options.
///
+ /// Runsettings provider.
+ /// Test request manager.
+ /// Output such as console.
internal ListFullyQualifiedTestsArgumentExecutor(
CommandLineOptions options,
IRunSettingsProvider runSettingsProvider,
diff --git a/src/vstest.console/Processors/ListTestsArgumentProcessor.cs b/src/vstest.console/Processors/ListTestsArgumentProcessor.cs
index a8e3a84d7c..18dcba4914 100644
--- a/src/vstest.console/Processors/ListTestsArgumentProcessor.cs
+++ b/src/vstest.console/Processors/ListTestsArgumentProcessor.cs
@@ -111,6 +111,8 @@ internal class ListTestsArgumentExecutor : IArgumentExecutor
///
/// The options.
///
+ /// Runsettings provider.
+ /// Test request manager.
public ListTestsArgumentExecutor(
CommandLineOptions options,
IRunSettingsProvider runSettingsProvider,
@@ -125,6 +127,9 @@ public ListTestsArgumentExecutor(
///
/// The options.
///
+ /// Run setting provider.
+ /// Output such as console.
+ /// Test request manager
internal ListTestsArgumentExecutor(
CommandLineOptions options,
IRunSettingsProvider runSettingsProvider,
diff --git a/src/vstest.console/Processors/ResultsDirectoryArgumentProcessor.cs b/src/vstest.console/Processors/ResultsDirectoryArgumentProcessor.cs
index 3855941ce0..b7e03835fd 100644
--- a/src/vstest.console/Processors/ResultsDirectoryArgumentProcessor.cs
+++ b/src/vstest.console/Processors/ResultsDirectoryArgumentProcessor.cs
@@ -83,7 +83,7 @@ internal class ResultsDirectoryArgumentExecutor : IArgumentExecutor
/// Default constructor.
///
/// The options.
- /// The test platform
+ /// Runsettings manager.
public ResultsDirectoryArgumentExecutor(CommandLineOptions options, IRunSettingsProvider runSettingsManager)
{
ValidateArg.NotNull(options, nameof(options));
diff --git a/src/vstest.console/Processors/TestAdapterLoadingStrategyArgumentProcessor.cs b/src/vstest.console/Processors/TestAdapterLoadingStrategyArgumentProcessor.cs
index 92b4a73e74..91ee48d550 100644
--- a/src/vstest.console/Processors/TestAdapterLoadingStrategyArgumentProcessor.cs
+++ b/src/vstest.console/Processors/TestAdapterLoadingStrategyArgumentProcessor.cs
@@ -100,7 +100,9 @@ internal class TestAdapterLoadingStrategyArgumentExecutor : IArgumentExecutor
/// Default constructor.
///
/// The options.
- /// The test platform
+ /// Run setting manager.
+ /// Output such as console.
+ /// File helper
public TestAdapterLoadingStrategyArgumentExecutor(CommandLineOptions options, IRunSettingsProvider runSettingsManager, IOutput output, IFileHelper fileHelper)
{
_commandLineOptions = options ?? throw new ArgumentNullException(nameof(options));
@@ -195,7 +197,7 @@ private void ForceIsolation()
private void ValidateTestAdapterPaths(TestAdapterLoadingStrategy strategy)
{
- var testAdapterPaths = _commandLineOptions.TestAdapterPath ?? new string[0];
+ var testAdapterPaths = _commandLineOptions.TestAdapterPath ?? [];
if (!_commandLineOptions.TestAdapterPathsSet)
{
testAdapterPaths = TestAdapterPathArgumentExecutor.SplitPaths(_runSettingsManager.QueryRunSettingsNode(TestAdapterPathArgumentExecutor.RunSettingsPath)).Union(testAdapterPaths).Distinct().ToArray();
diff --git a/src/vstest.console/Processors/TestAdapterPathArgumentProcessor.cs b/src/vstest.console/Processors/TestAdapterPathArgumentProcessor.cs
index 2c1ab3f7b0..8ae3214634 100644
--- a/src/vstest.console/Processors/TestAdapterPathArgumentProcessor.cs
+++ b/src/vstest.console/Processors/TestAdapterPathArgumentProcessor.cs
@@ -96,7 +96,7 @@ internal class TestAdapterPathArgumentExecutor : IArgumentExecutor
///
/// Separators for multiple paths in argument.
///
- internal readonly static char[] ArgumentSeparators = new[] { ';' };
+ internal readonly static char[] ArgumentSeparators = [';'];
public const string RunSettingsPath = "RunConfiguration.TestAdaptersPaths";
@@ -104,7 +104,9 @@ internal class TestAdapterPathArgumentExecutor : IArgumentExecutor
/// Default constructor.
///
/// The options.
- /// The test platform
+ /// Run setting manager.
+ /// Output such as console.
+ /// File helper
public TestAdapterPathArgumentExecutor(CommandLineOptions options, IRunSettingsProvider runSettingsManager, IOutput output, IFileHelper fileHelper)
{
_commandLineOptions = options ?? throw new ArgumentNullException(nameof(options));
@@ -132,7 +134,7 @@ public void Initialize(string? argument)
// VSTS task add double quotes around TestAdapterpath. For example if user has given TestAdapter path C:\temp,
// Then VSTS task will add TestAdapterPath as "/TestAdapterPath:\"C:\Temp\"".
// Remove leading and trailing ' " ' chars...
- argument = argument.Trim().Trim(new char[] { '\"' });
+ argument = argument.Trim().Trim(['\"']);
// Get test adapter paths from RunSettings.
var testAdapterPathsInRunSettings = _runSettingsManager.QueryRunSettingsNode(RunSettingsPath);
@@ -167,6 +169,6 @@ public ArgumentProcessorResult Execute()
/// Paths.
internal static string[] SplitPaths(string? paths)
{
- return paths.IsNullOrWhiteSpace() ? new string[0] : paths.Split(ArgumentSeparators, StringSplitOptions.RemoveEmptyEntries);
+ return paths.IsNullOrWhiteSpace() ? [] : paths.Split(ArgumentSeparators, StringSplitOptions.RemoveEmptyEntries);
}
}
diff --git a/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs b/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs
index 321df61125..81f6123af8 100644
--- a/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs
+++ b/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs
@@ -23,14 +23,12 @@ internal class ArgumentProcessorFactory
private Dictionary? _commandToProcessorMap;
private Dictionary? _specialCommandToProcessorMap;
+ ///
/// Initializes the argument processor factory.
///
///
/// The argument Processors.
///
- ///
- /// The feature flag support.
- ///
///
/// This is not public because the static Create method should be used to access the instance.
///
@@ -298,7 +296,7 @@ public static IArgumentProcessor WrapLazyProcessorToInitializeOnInstantiation(IA
/// Decorates a lazy argument processor so that the real processor is initialized when the lazy value is obtained.
///
/// The lazy processor.
- /// The argument with which the real processor should be initialized.
+ /// The argument with which the real processor should be initialized.
/// The decorated lazy processor.
private static IArgumentProcessor WrapLazyProcessorToInitializeOnInstantiation(
IArgumentProcessor processor,
diff --git a/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs b/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs
index a5744648cd..99f9130d39 100644
--- a/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs
+++ b/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs
@@ -8,8 +8,8 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.Processors.Utilities;
internal class ArgumentProcessorUtilities
{
- public static readonly char[] SemiColonArgumentSeparator = { ';' };
- public static readonly char[] EqualNameValueSeparator = { '=' };
+ public static readonly char[] SemiColonArgumentSeparator = [';'];
+ public static readonly char[] EqualNameValueSeparator = ['='];
///
/// Get argument list from raw argument using argument separator.
diff --git a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
index 4a8134cd03..f93857b671 100644
--- a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
+++ b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
@@ -78,6 +78,13 @@ internal class TestRequestManager : ITestRequestManager
/// Assumption: There can only be one active discovery request.
///
private IDiscoveryRequest? _currentDiscoveryRequest;
+ ///
+ /// Guards cancellation of the current discovery request, by resetting when the request is received,
+ /// because the request needs time to setup and populate the _currentTestRunRequest. This might take a relatively
+ /// long time when the machine is slow, because the setup is called as an async task, so it needs to be processed by thread pool
+ /// and there might be a queue of existing tasks.
+ ///
+ private readonly ManualResetEvent _discoveryStarting = new(true);
///
/// Maintains the current active test run attachments processing cancellation token source.
@@ -163,106 +170,119 @@ public void DiscoverTests(
ITestDiscoveryEventsRegistrar discoveryEventsRegistrar,
ProtocolConfig protocolConfig)
{
- EqtTrace.Info("TestRequestManager.DiscoverTests: Discovery tests started.");
-
- // TODO: Normalize rest of the data on the request as well
- discoveryPayload.Sources = KnownPlatformSourceFilter.FilterKnownPlatformSources(discoveryPayload.Sources?.Distinct().ToList());
- discoveryPayload.RunSettings ??= "";
-
- var runsettings = discoveryPayload.RunSettings;
-
- if (discoveryPayload.TestPlatformOptions != null)
+ try
{
- _telemetryOptedIn = discoveryPayload.TestPlatformOptions.CollectMetrics;
- }
+ // Flag that that discovery is being initialized, so all requests to cancel discovery will wait till we set the discovery up.
+ _discoveryStarting.Reset();
- var requestData = GetRequestData(protocolConfig);
- if (UpdateRunSettingsIfRequired(
- runsettings,
- discoveryPayload.Sources.ToList(),
- discoveryEventsRegistrar,
- isDiscovery: true,
- out string updatedRunsettings,
- out IDictionary sourceToArchitectureMap,
- out IDictionary sourceToFrameworkMap))
- {
- runsettings = updatedRunsettings;
- }
+ // Make sure to run the run request inside a lock as the below section is not thread-safe.
+ // There can be only one discovery or execution request at a given point in time.
+ lock (_syncObject)
+ {
+ EqtTrace.Info("TestRequestManager.DiscoverTests: Discovery tests started.");
- var sourceToSourceDetailMap = discoveryPayload.Sources.Select(source => new SourceDetail
- {
- Source = source,
- Architecture = sourceToArchitectureMap[source],
- Framework = sourceToFrameworkMap[source],
- }).ToDictionary(k => k.Source!);
+ // TODO: Normalize rest of the data on the request as well
+ discoveryPayload.Sources = KnownPlatformSourceFilter.FilterKnownPlatformSources(discoveryPayload.Sources?.Distinct().ToList());
+ discoveryPayload.RunSettings ??= "";
- var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(runsettings);
- var batchSize = runConfiguration.BatchSize;
- var testCaseFilterFromRunsettings = runConfiguration.TestCaseFilter;
+ var runsettings = discoveryPayload.RunSettings;
- if (requestData.IsTelemetryOptedIn)
- {
- // Collect metrics.
- CollectMetrics(requestData, runConfiguration);
+ if (discoveryPayload.TestPlatformOptions != null)
+ {
+ _telemetryOptedIn = discoveryPayload.TestPlatformOptions.CollectMetrics;
+ }
- // Collect commands.
- LogCommandsTelemetryPoints(requestData);
- }
+ var requestData = GetRequestData(protocolConfig);
+ if (UpdateRunSettingsIfRequired(
+ runsettings,
+ discoveryPayload.Sources.ToList(),
+ discoveryEventsRegistrar,
+ isDiscovery: true,
+ out string updatedRunsettings,
+ out IDictionary sourceToArchitectureMap,
+ out IDictionary sourceToFrameworkMap))
+ {
+ runsettings = updatedRunsettings;
+ }
- // Create discovery request.
- var criteria = new DiscoveryCriteria(
- discoveryPayload.Sources,
- batchSize,
- _commandLineOptions.TestStatsEventTimeout,
- runsettings,
- discoveryPayload.TestSessionInfo)
- {
- TestCaseFilter = _commandLineOptions.TestCaseFilterValue
- ?? testCaseFilterFromRunsettings
- };
+ var sourceToSourceDetailMap = discoveryPayload.Sources.Select(source => new SourceDetail
+ {
+ Source = source,
+ Architecture = sourceToArchitectureMap[source],
+ Framework = sourceToFrameworkMap[source],
+ }).ToDictionary(k => k.Source!);
- // Make sure to run the run request inside a lock as the below section is not thread-safe.
- // There can be only one discovery or execution request at a given point in time.
- lock (_syncObject)
- {
- try
- {
- EqtTrace.Info("TestRequestManager.DiscoverTests: Synchronization context taken");
+ var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(runsettings);
+ var batchSize = runConfiguration.BatchSize;
+ var testCaseFilterFromRunsettings = runConfiguration.TestCaseFilter;
- _currentDiscoveryRequest = _testPlatform.CreateDiscoveryRequest(
- requestData,
- criteria,
- discoveryPayload.TestPlatformOptions,
- sourceToSourceDetailMap,
- new EventRegistrarToWarningLoggerAdapter(discoveryEventsRegistrar));
- discoveryEventsRegistrar?.RegisterDiscoveryEvents(_currentDiscoveryRequest);
+ if (requestData.IsTelemetryOptedIn)
+ {
+ // Collect metrics.
+ CollectMetrics(requestData, runConfiguration);
- // Notify start of discovery start.
- _testPlatformEventSource.DiscoveryRequestStart();
+ // Collect commands.
+ LogCommandsTelemetryPoints(requestData);
+ }
- // Start the discovery of tests and wait for completion.
- _currentDiscoveryRequest.DiscoverAsync();
- _currentDiscoveryRequest.WaitForCompletion();
- }
- finally
- {
- if (_currentDiscoveryRequest != null)
+ // Create discovery request.
+ var criteria = new DiscoveryCriteria(
+ discoveryPayload.Sources,
+ batchSize,
+ _commandLineOptions.TestStatsEventTimeout,
+ runsettings,
+ discoveryPayload.TestSessionInfo)
{
- // Dispose the discovery request and unregister for events.
- discoveryEventsRegistrar?.UnregisterDiscoveryEvents(_currentDiscoveryRequest);
- _currentDiscoveryRequest.Dispose();
- _currentDiscoveryRequest = null;
- }
+ TestCaseFilter = _commandLineOptions.TestCaseFilterValue
+ ?? testCaseFilterFromRunsettings
+ };
- EqtTrace.Info("TestRequestManager.DiscoverTests: Discovery tests completed.");
- _testPlatformEventSource.DiscoveryRequestStop();
- // Posts the discovery complete event.
- _metricsPublisher.Result.PublishMetrics(
- TelemetryDataConstants.TestDiscoveryCompleteEvent,
- requestData.MetricsCollection.Metrics!);
+ try
+ {
+ EqtTrace.Info("TestRequestManager.DiscoverTests: Synchronization context taken");
+
+ _currentDiscoveryRequest = _testPlatform.CreateDiscoveryRequest(
+ requestData,
+ criteria,
+ discoveryPayload.TestPlatformOptions,
+ sourceToSourceDetailMap,
+ new EventRegistrarToWarningLoggerAdapter(discoveryEventsRegistrar));
+ // Discovery started, allow cancellations to proceed.
+ _currentDiscoveryRequest.OnDiscoveryStart += (s, e) => _discoveryStarting.Set();
+ discoveryEventsRegistrar?.RegisterDiscoveryEvents(_currentDiscoveryRequest);
+
+ // Notify start of discovery start.
+ _testPlatformEventSource.DiscoveryRequestStart();
+
+ // Start the discovery of tests and wait for completion.
+ _currentDiscoveryRequest.DiscoverAsync();
+ _currentDiscoveryRequest.WaitForCompletion();
+ }
+ finally
+ {
+ if (_currentDiscoveryRequest != null)
+ {
+ // Dispose the discovery request and unregister for events.
+ discoveryEventsRegistrar?.UnregisterDiscoveryEvents(_currentDiscoveryRequest);
+ _currentDiscoveryRequest.Dispose();
+ _currentDiscoveryRequest = null;
+ }
+
+ EqtTrace.Info("TestRequestManager.DiscoverTests: Discovery tests completed.");
+ _testPlatformEventSource.DiscoveryRequestStop();
+
+ // Posts the discovery complete event.
+ _metricsPublisher.Result.PublishMetrics(
+ TelemetryDataConstants.TestDiscoveryCompleteEvent,
+ requestData.MetricsCollection.Metrics!);
+ }
}
}
+ finally
+ {
+ _discoveryStarting.Set();
+ }
}
///
@@ -624,6 +644,12 @@ public void CancelTestRun()
public void CancelDiscovery()
{
EqtTrace.Info("TestRequestManager.CancelDiscovery: Sending cancel request.");
+
+ // Wait for discovery request to initialize, before cancelling it, otherwise the
+ // _currentDiscoveryRequest might be null, because discovery did not have enough time to
+ // initialize and did not manage to populate _currentDiscoveryRequest yet, leading to hanging run
+ // that "ignores" the cancellation.
+ _discoveryStarting.WaitOne(3000);
_currentDiscoveryRequest?.Abort();
}
@@ -1278,7 +1304,6 @@ private void RunTests(
/// This method either looks at runsettings directly when running as a server (DesignMode / IDE / via VSTestConsoleWrapper, or how you wanna call it)
/// or uses the pre-parsed runsettings when in console mode.
///
- ///
///
private bool IsFrameworkSetByRunSettings(
XPathNavigator navigator,
@@ -1314,7 +1339,6 @@ private bool IsFrameworkSetByRunSettings(
/// This method either looks at runsettings directly when running as a server (DesignMode / IDE / via VSTestConsoleWrapper, or how you wanna call it)
/// or uses the pre-parsed runsettings when in console mode.
///
- ///
///
private bool IsPlatformSetByRunSettings(
XPathNavigator navigator, out Architecture chosenPlatform)
diff --git a/temp/testhost/testhost-9.0.runtimeconfig.json b/temp/testhost/testhost-9.0.runtimeconfig.json
new file mode 100644
index 0000000000..146e13202e
--- /dev/null
+++ b/temp/testhost/testhost-9.0.runtimeconfig.json
@@ -0,0 +1,9 @@
+{
+ "runtimeOptions": {
+ "tfm": "net9.0",
+ "framework": {
+ "name": "Microsoft.NETCore.App",
+ "version": "9.0.0-preview.0"
+ }
+ }
+}
diff --git a/test/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests/EventLogDataCollectorTests.cs b/test/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests/EventLogDataCollectorTests.cs
index abf09de509..43923342e1 100644
--- a/test/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests/EventLogDataCollectorTests.cs
+++ b/test/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests/EventLogDataCollectorTests.cs
@@ -95,11 +95,11 @@ public void InitializeShouldThrowExceptionIfLoggerIsNull()
[TestMethod]
public void InitializeShouldInitializeDefaultEventLogNames()
{
- List eventLogNames = new()
- {
+ List eventLogNames =
+ [
"System",
"Application"
- };
+ ];
_eventLogDataCollector.Initialize(null, _mockDataCollectionEvents.Object, _mockDataCollectionSink, _mockDataCollectionLogger.Object, _dataCollectionEnvironmentContext);
@@ -113,11 +113,11 @@ public void InitializeShouldInitializeCustomEventLogNamesIfSpecifiedInConfigurat
string configurationString =
@"";
- List eventLogNames = new()
- {
+ List eventLogNames =
+ [
"MyEventName",
"MyEventName2"
- };
+ ];
XmlDocument expectedXmlDoc = new();
expectedXmlDoc.LoadXml(configurationString);
@@ -131,12 +131,12 @@ public void InitializeShouldInitializeCustomEventLogNamesIfSpecifiedInConfigurat
[TestMethod]
public void InitializeShouldInitializeDefaultLogEntryTypes()
{
- List entryTypes = new()
- {
+ List entryTypes =
+ [
EventLogEntryType.Error,
EventLogEntryType.Warning,
EventLogEntryType.FailureAudit
- };
+ ];
_eventLogDataCollector.Initialize(null, _mockDataCollectionEvents.Object, _mockDataCollectionSink, _mockDataCollectionLogger.Object, _dataCollectionEnvironmentContext);
@@ -150,10 +150,7 @@ public void InitializeShouldInitializeEntryTypesIfSpecifiedInConfiguration()
string configurationString =
@"";
- List entryTypes = new()
- {
- EventLogEntryType.Error
- };
+ List entryTypes = [EventLogEntryType.Error];
XmlDocument expectedXmlDoc = new();
expectedXmlDoc.LoadXml(configurationString);
@@ -169,10 +166,7 @@ public void InitializeShouldInitializeEventSourcesIfSpecifiedInConfiguration()
string configurationString =
@"";
- List eventSources = new()
- {
- "MyEventSource"
- };
+ List eventSources = ["MyEventSource"];
XmlDocument expectedXmlDoc = new();
expectedXmlDoc.LoadXml(configurationString);
diff --git a/test/Directory.Build.props b/test/Directory.Build.props
index 60fd349d0a..6f5b8d7bf3 100644
--- a/test/Directory.Build.props
+++ b/test/Directory.Build.props
@@ -2,6 +2,6 @@
- true
+ true
diff --git a/test/Intent/Runner.cs b/test/Intent/Runner.cs
index 6edf62eb0f..cbe7706cba 100644
--- a/test/Intent/Runner.cs
+++ b/test/Intent/Runner.cs
@@ -62,7 +62,7 @@ public static void Run(IEnumerable paths, IRunLogger logger)
// Declaring type cannot be really null for types you define in C#
// without doing any reflection magic.
var instance = Activator.CreateInstance(method.DeclaringType!);
- var testResult = method.Invoke(instance, Array.Empty