diff options
37 files changed, 260 insertions, 187 deletions
diff --git a/Directory.Build.props b/Directory.Build.props index ed94e7f27..956e48988 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,6 +2,7 @@ <PropertyGroup> <IsReferenceAssembly Condition="'$(IsReferenceAssembly)' == '' and '$([System.IO.Path]::GetFileName($(MSBuildProjectDirectory)))' == 'ref'">true</IsReferenceAssembly> <DisableImplicitNamespaceImports_DotNet>true</DisableImplicitNamespaceImports_DotNet> + <NetCoreAppToolCurrent>net7.0</NetCoreAppToolCurrent> </PropertyGroup> <PropertyGroup Condition=" '$(IsReferenceAssembly)' == 'true' "> <!-- Since .NET 5 reference assemblies are always produced --> diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 554c2f5e6..8154f3d64 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,14 +3,14 @@ <ProductDependencies> </ProductDependencies> <ToolsetDependencies> - <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22171.2"> + <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22255.2"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha> + <Sha>ba1c3aff4be864c493031d989259ef92aaa23fc3</Sha> <SourceBuild RepoName="arcade" ManagedOnly="true" /> </Dependency> - <Dependency Name="Microsoft.DotNet.ApiCompat" Version="7.0.0-beta.22171.2"> + <Dependency Name="Microsoft.DotNet.ApiCompat" Version="7.0.0-beta.22255.2"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha> + <Sha>ba1c3aff4be864c493031d989259ef92aaa23fc3</Sha> </Dependency> <Dependency Name="Microsoft.NET.Sdk.IL" Version="7.0.0-preview.5.22258.4"> <Uri>https://github.com/dotnet/runtime</Uri> diff --git a/eng/Versions.props b/eng/Versions.props index da7497713..f87aa3cd5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -18,7 +18,7 @@ <SystemReflectionMetadataVersion>5.0.0</SystemReflectionMetadataVersion> <MicrosoftBuildFrameworkVersion>17.0.0-preview-21267-01</MicrosoftBuildFrameworkVersion> <MicrosoftBuildUtilitiesCoreVersion>17.0.0-preview-21267-01</MicrosoftBuildUtilitiesCoreVersion> - <MicrosoftDotNetApiCompatVersion>7.0.0-beta.22171.2</MicrosoftDotNetApiCompatVersion> + <MicrosoftDotNetApiCompatVersion>7.0.0-beta.22255.2</MicrosoftDotNetApiCompatVersion> <MicrosoftDotNetCodeAnalysisVersion>6.0.0-beta.21271.1</MicrosoftDotNetCodeAnalysisVersion> <MicrosoftCodeAnalysisCSharpCodeStyleVersion>3.10.0-2.final</MicrosoftCodeAnalysisCSharpCodeStyleVersion> <MicrosoftCodeAnalysisVersion>4.0.1</MicrosoftCodeAnalysisVersion> diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index e784c9c00..5a59dcff2 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -4,12 +4,13 @@ set -e usage() { - echo "Usage: $0 [BuildArch] [CodeName] [lldbx.y] [--skipunmount] --rootfsdir <directory>]" + echo "Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir <directory>]" echo "BuildArch can be: arm(default), armel, arm64, x86" echo "CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine, alpine3.13 or alpine3.14. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." echo " for FreeBSD can be: freebsd12, freebsd13" echo " for illumos can be: illumos." echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine and FreeBSD" + echo "llvmx[.y] - optional, LLVM version for LLVM related packages." echo "--skipunmount - optional, will skip the unmount of rootfs folder." echo "--use-mirror - optional, use mirror URL to fetch resources, when available." exit 1 @@ -48,6 +49,7 @@ __AlpinePackages+=" gettext-dev" __AlpinePackages+=" icu-dev" __AlpinePackages+=" libunwind-dev" __AlpinePackages+=" lttng-ust-dev" +__AlpinePackages+=" compiler-rt-static" # CoreFX dependencies __UbuntuPackages+=" libcurl4-openssl-dev" @@ -164,6 +166,15 @@ while :; do no-lldb) unset __LLDB_Package ;; + llvm*) + version="$(echo "$lowerI" | tr -d '[:alpha:]-=')" + parts=(${version//./ }) + __LLVM_MajorVersion="${parts[0]}" + __LLVM_MinorVersion="${parts[1]}" + if [[ -z "$__LLVM_MinorVersion" && "$__LLVM_MajorVersion" -le 6 ]]; then + __LLVM_MinorVersion=0; + fi + ;; xenial) # Ubuntu 16.04 if [ "$__CodeName" != "jessie" ]; then __CodeName=xenial @@ -261,6 +272,10 @@ if [ "$__BuildArch" == "armel" ]; then fi __UbuntuPackages+=" ${__LLDB_Package:-}" +if [ ! -z "$__LLVM_MajorVersion" ]; then + __UbuntuPackages+=" libclang-common-${__LLVM_MajorVersion}${__LLVM_MinorVersion:+.$__LLVM_MinorVersion}-dev" +fi + if [ -z "$__RootfsDir" ] && [ ! -z "$ROOTFS_DIR" ]; then __RootfsDir=$ROOTFS_DIR fi diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh index 5c94e9863..abd045a32 100755 --- a/eng/common/dotnet-install.sh +++ b/eng/common/dotnet-install.sh @@ -52,7 +52,7 @@ done # Use uname to determine what the CPU is, see https://en.wikipedia.org/wiki/Uname#Examples cpuname=$(uname -m) case $cpuname in - aarch64) + arm64|aarch64) buildarch=arm64 ;; loongarch64) @@ -64,7 +64,7 @@ case $cpuname in armv*l) buildarch=arm ;; - i686) + i[3-6]86) buildarch=x86 ;; *) diff --git a/eng/common/init-tools-native.ps1 b/eng/common/init-tools-native.ps1 index db830c00a..413adea43 100644 --- a/eng/common/init-tools-native.ps1 +++ b/eng/common/init-tools-native.ps1 @@ -31,6 +31,10 @@ Wait time between retry attempts in seconds .PARAMETER GlobalJsonFile File path to global.json file +.PARAMETER PathPromotion +Optional switch to enable either promote native tools specified in the global.json to the path (in Azure Pipelines) +or break the build if a native tool is not found on the path (on a local dev machine) + .NOTES #> [CmdletBinding(PositionalBinding=$false)] @@ -41,7 +45,8 @@ Param ( [switch] $Force = $False, [int] $DownloadRetries = 5, [int] $RetryWaitTimeInSeconds = 30, - [string] $GlobalJsonFile + [string] $GlobalJsonFile, + [switch] $PathPromotion ) if (!$GlobalJsonFile) { @@ -77,53 +82,97 @@ try { ConvertFrom-Json | Select-Object -Expand 'native-tools' -ErrorAction SilentlyContinue if ($NativeTools) { - $NativeTools.PSObject.Properties | ForEach-Object { - $ToolName = $_.Name - $ToolVersion = $_.Value - $LocalInstallerArguments = @{ ToolName = "$ToolName" } - $LocalInstallerArguments += @{ InstallPath = "$InstallBin" } - $LocalInstallerArguments += @{ BaseUri = "$BaseUri" } - $LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" } - $LocalInstallerArguments += @{ Version = "$ToolVersion" } - - if ($Verbose) { - $LocalInstallerArguments += @{ Verbose = $True } - } - if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') { - if($Force) { - $LocalInstallerArguments += @{ Force = $True } - } - } - if ($Clean) { - $LocalInstallerArguments += @{ Clean = $True } - } - - Write-Verbose "Installing $ToolName version $ToolVersion" - Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'" - & $InstallerPath @LocalInstallerArguments - if ($LASTEXITCODE -Ne "0") { - $errMsg = "$ToolName installation failed" - if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) { - $showNativeToolsWarning = $true - if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) { - $showNativeToolsWarning = $false + if ($PathPromotion -eq $True) { + if ($env:SYSTEM_TEAMPROJECT) { # check to see if we're in an Azure pipelines build + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + + if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { + if ($ToolVersion -eq "latest") { + $ToolVersion = "" + } + $ArcadeToolsDirectory = "C:\arcade-tools" + if (Test-Path $ArcadeToolsDirectory -eq $False) { + Write-Error "Arcade tools directory '$ArcadeToolsDirectory' was not found; artifacts were not properly installed." + exit 1 } - if ($showNativeToolsWarning) { - Write-Warning $errMsg + $ToolDirectory = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending)[0] + if ([string]::IsNullOrWhiteSpace($ToolDirectory)) { + Write-Error "Unable to find directory for $ToolName $ToolVersion; please make sure the tool is installed on this image." + exit 1 } - $toolInstallationFailure = $true - } else { - # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 - Write-Host $errMsg - exit 1 + $BinPathFile = "$($ToolDirectory.FullName)\binpath.txt" + if (Test-Path -Path "$BinPathFile" -eq $False) { + Write-Error "Unable to find binpath.txt in '$($ToolDirectory.FullName)' ($ToolName $ToolVersion); artifact is either installed incorrectly or is not a bootstrappable tool." + exit 1 + } + $BinPath = Get-Content "$BinPathFile" + Write-Host "Adding $ToolName to the path ($(Convert-Path -Path $BinPath))..." + Write-Host "##vso[task.prependpath]$(Convert-Path -Path $BinPath)" + } + } + exit 0 + } else { + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + + if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { + Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "$ToolName not found on path. Please install $ToolName $ToolVersion before proceeding." + } } + exit 0 + } + } else { + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + $LocalInstallerArguments = @{ ToolName = "$ToolName" } + $LocalInstallerArguments += @{ InstallPath = "$InstallBin" } + $LocalInstallerArguments += @{ BaseUri = "$BaseUri" } + $LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" } + $LocalInstallerArguments += @{ Version = "$ToolVersion" } + + if ($Verbose) { + $LocalInstallerArguments += @{ Verbose = $True } + } + if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') { + if($Force) { + $LocalInstallerArguments += @{ Force = $True } + } + } + if ($Clean) { + $LocalInstallerArguments += @{ Clean = $True } + } + + Write-Verbose "Installing $ToolName version $ToolVersion" + Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'" + & $InstallerPath @LocalInstallerArguments + if ($LASTEXITCODE -Ne "0") { + $errMsg = "$ToolName installation failed" + if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) { + $showNativeToolsWarning = $true + if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) { + $showNativeToolsWarning = $false + } + if ($showNativeToolsWarning) { + Write-Warning $errMsg + } + $toolInstallationFailure = $true + } else { + # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 + Write-Host $errMsg + exit 1 + } + } + } + + if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) { + # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 + Write-Host 'Native tools bootstrap failed' + exit 1 } - } - - if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) { - # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 - Write-Host 'Native tools bootstrap failed' - exit 1 } } else { diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 index b1bca63ab..119a6c660 100644 --- a/eng/common/sdk-task.ps1 +++ b/eng/common/sdk-task.ps1 @@ -64,7 +64,7 @@ try { $GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty } if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) { - $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "16.10.0-preview2" -MemberType NoteProperty + $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.1.0" -MemberType NoteProperty } if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") { $xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true diff --git a/eng/common/templates/job/onelocbuild.yml b/eng/common/templates/job/onelocbuild.yml index 9d1e3042d..3bcd243c4 100644 --- a/eng/common/templates/job/onelocbuild.yml +++ b/eng/common/templates/job/onelocbuild.yml @@ -72,8 +72,8 @@ jobs: lclSource: ${{ parameters.LclSource }} lclPackageId: ${{ parameters.LclPackageId }} isCreatePrSelected: ${{ parameters.CreatePr }} + isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }} ${{ if eq(parameters.CreatePr, true) }}: - isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }} isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }} ${{ if eq(parameters.RepoType, 'gitHub') }}: isShouldReusePrSelected: ${{ parameters.ReusePr }} diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index d91bf9147..1cbb6a0c5 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -23,23 +23,33 @@ parameters: # Optional: whether the build's artifacts will be published using release pipelines or direct feed publishing publishUsingPipelines: false + # Optional: whether the build's artifacts will be published using release pipelines or direct feed publishing + publishAssetsImmediately: false + + artifactsPublishingAdditionalParameters: '' + + signingValidationAdditionalParameters: '' + jobs: - job: Asset_Registry_Publish dependsOn: ${{ parameters.dependsOn }} - displayName: Publish to Build Asset Registry + ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: + displayName: Publish Assets + ${{ else }}: + displayName: Publish to Build Asset Registry pool: ${{ parameters.pool }} variables: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - name: _BuildConfig - value: ${{ parameters.configuration }} - group: Publish-Build-Assets - group: AzureDevOps-Artifact-Feeds-Pats - name: runCodesignValidationInjection value: false + - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: + - template: /eng/common/templates/post-build/common-variables.yml steps: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: @@ -52,14 +62,13 @@ jobs: condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: NuGetAuthenticate@0 + - task: NuGetAuthenticate@0 - - task: PowerShell@2 - displayName: Enable cross-org NuGet feed authentication - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/enable-cross-org-publishing.ps1 - arguments: -token $(dn-bot-all-orgs-artifact-feeds-rw) + - task: PowerShell@2 + displayName: Enable cross-org NuGet feed authentication + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-all-orgs-artifact-feeds-rw) - task: PowerShell@2 displayName: Publish Build Assets @@ -70,7 +79,6 @@ jobs: /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} - /p:Configuration=$(_BuildConfig) /p:OfficialBuildId=$(Build.BuildNumber) condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} @@ -114,7 +122,25 @@ jobs: PathtoPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' PublishLocation: Container ArtifactName: ReleaseConfigs - + + - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: + - template: /eng/common/templates/post-build/setup-maestro-vars.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} + + - task: PowerShell@2 + displayName: Publish Using Darc + inputs: + filePath: $(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)' + -WaitPublishingFinish true + -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' + -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' + - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - template: /eng/common/templates/steps/publish-logs.yml parameters: diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index 4af724eb1..c2d51098d 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -7,6 +7,7 @@ parameters: binlogPath: artifacts/log/Debug/Build.binlog condition: '' dependsOn: '' + pool: '' jobs: - job: SourceIndexStage1 @@ -22,13 +23,17 @@ jobs: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - group: source-dot-net stage1 variables - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: NetCore1ESPool-Public - demands: ImageOverride -equals Build.Server.Amd64.VS2019.Open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: NetCore1ESPool-Internal - demands: ImageOverride -equals Build.Server.Amd64.VS2019 + ${{ if ne(parameters.pool, '') }}: + pool: ${{ parameters.pool }} + ${{ if eq(parameters.pool, '') }}: + pool: + ${{ if eq(variables['System.TeamProject'], 'public') }}: + name: NetCore1ESPool-Public + demands: ImageOverride -equals Build.Server.Amd64.VS2019.Open + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + name: NetCore1ESPool-Internal + demands: ImageOverride -equals Build.Server.Amd64.VS2019 + steps: - ${{ each preStep in parameters.preSteps }}: - ${{ preStep }} diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml index 554e71cfc..2cca53c2d 100644 --- a/eng/common/templates/jobs/jobs.yml +++ b/eng/common/templates/jobs/jobs.yml @@ -27,6 +27,13 @@ parameters: # Optional: Override automatically derived dependsOn value for "publish build assets" job publishBuildAssetsDependsOn: '' + # Optional: Publish the assets as soon as the publish to BAR stage is complete, rather doing so in a separate stage. + publishAssetsImmediately: false + + # Optional: If using publishAssetsImmediately and additional parameters are needed, can be used to send along additional parameters (normally sent to post-build.yml) + artifactsPublishingAdditionalParameters: '' + signingValidationAdditionalParameters: '' + # Optional: should run as a public build even in the internal project # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. runAsPublic: false @@ -68,7 +75,6 @@ jobs: ${{ parameter.key }}: ${{ parameter.value }} - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - ${{ if or(eq(parameters.enablePublishBuildAssets, true), eq(parameters.artifacts.publish.manifests, 'true'), ne(parameters.artifacts.publish.manifests, '')) }}: - template: ../job/publish-build-assets.yml parameters: @@ -94,4 +100,7 @@ jobs: runAsPublic: ${{ parameters.runAsPublic }} publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }} + publishAssetsImmediately: ${{ parameters.publishAssetsImmediately }} enablePublishBuildArtifacts: ${{ parameters.enablePublishBuildArtifacts }} + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + signingValidationAdditionalParameters: ${{ parameters.signingValidationAdditionalParameters }} diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 2f176571f..5a9056f6b 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -82,6 +82,11 @@ parameters: default: - Validate + # Optional: Call asset publishing rather than running in a separate stage + - name: publishAssetsImmediately + type: boolean + default: false + stages: - ${{ if or(eq( parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - stage: Validate @@ -99,7 +104,7 @@ stages: name: VSEngSS-MicroBuild2022-1ES demands: Cmd # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: + ${{ else }}: name: NetCore1ESPool-Internal demands: ImageOverride -equals Build.Server.Amd64.VS2019 @@ -136,7 +141,7 @@ stages: name: VSEngSS-MicroBuild2022-1ES demands: Cmd # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: + ${{ else }}: name: NetCore1ESPool-Internal demands: ImageOverride -equals Build.Server.Amd64.VS2019 steps: @@ -196,7 +201,7 @@ stages: name: VSEngSS-MicroBuild2022-1ES demands: Cmd # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: + ${{ else }}: name: NetCore1ESPool-Internal demands: ImageOverride -equals Build.Server.Amd64.VS2019 steps: @@ -235,43 +240,44 @@ stages: artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }} downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }} -- stage: publish_using_darc - ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - dependsOn: ${{ parameters.publishDependsOn }} - ${{ if and(ne(parameters.enableNugetValidation, 'true'), ne(parameters.enableSigningValidation, 'true'), ne(parameters.enableSourceLinkValidation, 'true'), ne(parameters.SDLValidationParameters.enable, 'true')) }}: - dependsOn: ${{ parameters.validateDependsOn }} - displayName: Publish using Darc - variables: - - template: common-variables.yml - jobs: - - job: - displayName: Publish Using Darc - timeoutInMinutes: 120 - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) +- ${{ if ne(parameters.publishAssetsImmediately, 'true') }}: + - stage: publish_using_darc + ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: + dependsOn: ${{ parameters.publishDependsOn }} + ${{ else }}: + dependsOn: ${{ parameters.validateDependsOn }} + displayName: Publish using Darc + variables: + - template: common-variables.yml + jobs: + - job: + displayName: Publish Using Darc + timeoutInMinutes: 120 + pool: + # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: name: VSEngSS-MicroBuild2022-1ES demands: Cmd # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: + ${{ else }}: name: NetCore1ESPool-Internal demands: ImageOverride -equals Build.Server.Amd64.VS2019 - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} + steps: + - template: setup-maestro-vars.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - task: NuGetAuthenticate@0 + - task: NuGetAuthenticate@0 - - task: PowerShell@2 - displayName: Publish Using Darc - inputs: - filePath: $(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)' - -WaitPublishingFinish true - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
\ No newline at end of file + - task: PowerShell@2 + displayName: Publish Using Darc + inputs: + filePath: $(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)' + -WaitPublishingFinish true + -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' + -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
\ No newline at end of file diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index f1e1cb539..797f05292 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -365,8 +365,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = # If the version of msbuild is going to be xcopied, # use this version. Version matches a package here: - # https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=16.10.0-preview2&view=overview - $defaultXCopyMSBuildVersion = '16.10.0-preview2' + # https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=17.1.0&view=overview + $defaultXCopyMSBuildVersion = '17.1.0' if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs } $vsMinVersionStr = if ($vsRequirements.version) { $vsRequirements.version } else { $vsMinVersionReqdStr } diff --git a/global.json b/global.json index b72593870..3912bc4f5 100644 --- a/global.json +++ b/global.json @@ -1,14 +1,14 @@ { "sdk": { - "version": "6.0.100", + "version": "7.0.100-preview.4.22252.9", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "6.0.100" + "dotnet": "7.0.100-preview.4.22252.9" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22171.2", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22255.2", "Microsoft.FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "7.0.0-preview.5.22258.4" } diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 0ddd2dec7..b17a972b0 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,7 +3,7 @@ <PropertyGroup> <RunAnalyzers>true</RunAnalyzers> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework> <Nullable>enable</Nullable> </PropertyGroup> </Project>
\ No newline at end of file diff --git a/src/ILLink.Tasks/ILLink.Tasks.csproj b/src/ILLink.Tasks/ILLink.Tasks.csproj index 7501ecb47..0b7da0f9e 100644 --- a/src/ILLink.Tasks/ILLink.Tasks.csproj +++ b/src/ILLink.Tasks/ILLink.Tasks.csproj @@ -3,7 +3,7 @@ <!-- Keep these in sync with ILLinkTasksAssembly in Microsoft.NET.ILLInk.Tasks.props. --> <!-- Keep the net#.0 TFM in sync with the Mono.Linker.csproj condition below. --> <!-- Keep the net#.0 TFM in sync with the code in LinkTask.cs in method ILLink.ILLinkPath. --> - <TargetFrameworks>net6.0;net472</TargetFrameworks> + <TargetFrameworks>$(NetCoreAppToolCurrent);net472</TargetFrameworks> <EnableDefaultCompileItems>false</EnableDefaultCompileItems> <Description>MSBuild tasks for running the IL Linker</Description> <IsPackable>true</IsPackable> @@ -36,7 +36,7 @@ </ItemGroup> <ItemGroup> - <ProjectReference Include="../linker/Mono.Linker.csproj" PrivateAssets="All" Condition=" '$(TargetFramework)' == 'net6.0' " /> + <ProjectReference Include="../linker/Mono.Linker.csproj" PrivateAssets="All" Condition=" '$(TargetFramework)' == '$(NetCoreAppToolCurrent)' " /> <PackageReference Condition="'$(UseCecilPackage)' == 'true'" Include="Mono.Cecil" Version="$(MonoCecilVersion)" PrivateAssets="All" Publish="True" /> <ProjectReference Condition="'$(UseCecilPackage)' != 'true'" Include="../../external/cecil/Mono.Cecil.csproj" PrivateAssets="All"> <!-- https://github.com/dotnet/sdk/issues/2280#issuecomment-392815466 --> diff --git a/src/ILLink.Tasks/LinkTask.cs b/src/ILLink.Tasks/LinkTask.cs index f4f70d4ab..6834bd993 100644 --- a/src/ILLink.Tasks/LinkTask.cs +++ b/src/ILLink.Tasks/LinkTask.cs @@ -256,7 +256,7 @@ namespace ILLink.Tasks var taskDirectory = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location); // The linker always runs on .NET Core, even when using desktop MSBuild to host ILLink.Tasks. - _illinkPath = Path.Combine (Path.GetDirectoryName (taskDirectory), "net6.0", "illink.dll"); + _illinkPath = Path.Combine (Path.GetDirectoryName (taskDirectory), "net7.0", "illink.dll"); return _illinkPath; } set => _illinkPath = value; diff --git a/src/ILLink.Tasks/build/Microsoft.NET.ILLink.Tasks.props b/src/ILLink.Tasks/build/Microsoft.NET.ILLink.Tasks.props index 9742dcea9..1634d6e2b 100644 --- a/src/ILLink.Tasks/build/Microsoft.NET.ILLink.Tasks.props +++ b/src/ILLink.Tasks/build/Microsoft.NET.ILLink.Tasks.props @@ -13,7 +13,7 @@ Copyright (c) .NET Foundation. All rights reserved. <PropertyGroup> <UsingILLinkTasksSdk>true</UsingILLinkTasksSdk> - <ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\net6.0\ILLink.Tasks.dll</ILLinkTasksAssembly> + <ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\net7.0\ILLink.Tasks.dll</ILLinkTasksAssembly> <ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\ILLink.Tasks.dll</ILLinkTasksAssembly> </PropertyGroup> diff --git a/test/Directory.Build.props b/test/Directory.Build.props index a014e1bac..107feee22 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -3,7 +3,7 @@ <PropertyGroup> <RunAnalyzers>false</RunAnalyzers> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework> <Nullable>disable</Nullable> </PropertyGroup> </Project>
\ No newline at end of file diff --git a/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs b/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs index 69b89381e..ba6f8e54c 100644 --- a/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs +++ b/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs @@ -26,9 +26,9 @@ namespace ILLink.RoslynAnalyzer.Tests public static readonly ReferenceAssemblies Net6PreviewAssemblies = new ReferenceAssemblies ( - "net6.0", - new PackageIdentity ("Microsoft.NETCore.App.Ref", "6.0.0-preview.7.21368.2"), - Path.Combine ("ref", "net6.0")) + "net7.0", + new PackageIdentity ("Microsoft.NETCore.App.Ref", "7.0.0-preview.2.22152.2"), + Path.Combine ("ref", "net7.0")) .WithNuGetConfigFilePath (Path.Combine (TestCaseUtils.GetRepoRoot (), "NuGet.config")); private static ImmutableArray<MetadataReference> s_net6Refs; @@ -161,11 +161,7 @@ namespace ILLink.RoslynAnalyzer.Tests var configDirectoryName = "Release"; #endif -#if NET6_0 - const string tfm = "net6.0"; -#else - const string tfm = "net5.0"; -#endif + const string tfm = "net7.0"; // Working directory is artifacts/bin/Mono.Linker.Tests/<config>/<tfm> var artifactsBinDir = Path.Combine (Directory.GetCurrentDirectory (), "..", "..", ".."); diff --git a/test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs b/test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs index 585944945..2c49d205c 100644 --- a/test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs +++ b/test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs @@ -263,7 +263,7 @@ namespace ILLink.RoslynAnalyzer.Tests } missingDiagnosticMessage = $"Warning '{expectedWarningCode}'. Expected to find warning containing:{string.Join (" ", expectedMessages.Select (m => "'" + m + "'"))}" + - $", but no such message was found.{ Environment.NewLine}"; + $", but no such message was found.{Environment.NewLine}"; return false; bool Matches (Diagnostic diagnostic) diff --git a/test/ILLink.RoslynAnalyzer.Tests/generated/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs b/test/ILLink.RoslynAnalyzer.Tests/generated/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs new file mode 100644 index 000000000..b61e47c93 --- /dev/null +++ b/test/ILLink.RoslynAnalyzer.Tests/generated/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs @@ -0,0 +1,5 @@ +// <auto-generated/> +#nullable enable +#pragma warning disable CS0162 // Unreachable code +#pragma warning disable CS0164 // Unreferenced label +#pragma warning disable CS0219 // Variable assigned but never used diff --git a/test/Mono.Linker.Tests.Cases.Expectations/Metadata/RequiresDynamicCodeAttribute.cs b/test/Mono.Linker.Tests.Cases.Expectations/Metadata/RequiresDynamicCodeAttribute.cs deleted file mode 100644 index d962da8d1..000000000 --- a/test/Mono.Linker.Tests.Cases.Expectations/Metadata/RequiresDynamicCodeAttribute.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#nullable enable - -namespace System.Diagnostics.CodeAnalysis -{ - /// <summary> - /// Indicates that the specified method requires the ability to generate new code at runtime, - /// for example through <see cref="System.Reflection"/>. - /// </summary> - /// <remarks> - /// This allows tools to understand which methods are unsafe to call when compiling ahead of time. - /// </remarks> - [AttributeUsage (AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class, Inherited = false)] - public sealed class RequiresDynamicCodeAttribute : Attribute - { - /// <summary> - /// Initializes a new instance of the <see cref="RequiresDynamicCodeAttribute"/> class - /// with the specified message. - /// </summary> - /// <param name="message"> - /// A message that contains information about the usage of dynamic code. - /// </param> - public RequiresDynamicCodeAttribute (string message) - { - Message = message; - } - - /// <summary> - /// Gets a message that contains information about the usage of dynamic code. - /// </summary> - public string Message { get; } - - /// <summary> - /// Gets or sets an optional URL that contains more information about the method, - /// why it requires dynamic code, and what options a consumer has to deal with it. - /// </summary> - public string? Url { get; set; } - } -} diff --git a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeTypeOnPropertyIsRemoved.cs b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeTypeOnPropertyIsRemoved.cs index 359e900a8..ee695fb08 100644 --- a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeTypeOnPropertyIsRemoved.cs +++ b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeTypeOnPropertyIsRemoved.cs @@ -21,7 +21,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed [Foo] [Kept] [KeptBackingField] - public string Value { [Foo] [Kept] get; [Foo] [Kept] set; } + public string Value { [Foo][Kept] get; [Foo][Kept] set; } } class FooAttribute : Attribute diff --git a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnEventIsKept.cs b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnEventIsKept.cs index 6b4437f36..27d50d3cd 100644 --- a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnEventIsKept.cs +++ b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnEventIsKept.cs @@ -29,7 +29,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed [KeptAttributeAttribute (typeof (FooAttribute))] [KeptEventAddMethod] [KeptEventRemoveMethod] - public event EventHandler<EventArgs> Something { [Foo] [KeptAttributeAttribute (typeof (FooAttribute))] add { } [Foo] [KeptAttributeAttribute (typeof (FooAttribute))] remove { } } + public event EventHandler<EventArgs> Something { [Foo][KeptAttributeAttribute (typeof (FooAttribute))] add { } [Foo][KeptAttributeAttribute (typeof (FooAttribute))] remove { } } } [Kept] diff --git a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnPropertyIsKept.cs b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnPropertyIsKept.cs index b255ffc23..f4a01cbfb 100644 --- a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnPropertyIsKept.cs +++ b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UsedAttributeTypeOnPropertyIsKept.cs @@ -23,7 +23,7 @@ namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed [Kept] [KeptBackingField] [KeptAttributeAttribute (typeof (FooAttribute))] - public string Value { [Foo] [Kept] [KeptAttributeAttribute (typeof (FooAttribute))] get; [Foo] [Kept] [KeptAttributeAttribute (typeof (FooAttribute))]set; } + public string Value { [Foo][Kept][KeptAttributeAttribute (typeof (FooAttribute))] get; [Foo][Kept][KeptAttributeAttribute (typeof (FooAttribute))] set; } } [Kept] diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/VirtualMethodHierarchyDataflowAnnotationValidation.cs b/test/Mono.Linker.Tests.Cases/DataFlow/VirtualMethodHierarchyDataflowAnnotationValidation.cs index 9747f7b6f..b7f4e0f32 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/VirtualMethodHierarchyDataflowAnnotationValidation.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/VirtualMethodHierarchyDataflowAnnotationValidation.cs @@ -245,7 +245,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow "'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the generic parameter 'T' of 'Mono.Linker.Tests.Cases.DataFlow.VirtualMethodHierarchyDataflowAnnotationValidation.DerivedClass.GenericBaseWithoutDerivedWith<T>()' " + "don't match overridden generic parameter 'T' of 'Mono.Linker.Tests.Cases.DataFlow.VirtualMethodHierarchyDataflowAnnotationValidation.BaseClass.GenericBaseWithoutDerivedWith<T>()'. " + "All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.")] - public override void GenericBaseWithoutDerivedWith<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicConstructors)]T> () { } + public override void GenericBaseWithoutDerivedWith<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicConstructors)] T> () { } [LogDoesNotContain ("DerivedClass.GenericBaseWithDerivedWith_")] public override void GenericBaseWithDerivedWith_<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicConstructors)] T> () { } diff --git a/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtor/UnusedTypeHasExplicitInterfacePropertyPreservedViaXml.cs b/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtor/UnusedTypeHasExplicitInterfacePropertyPreservedViaXml.cs index e3c174c61..044bcb27b 100644 --- a/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtor/UnusedTypeHasExplicitInterfacePropertyPreservedViaXml.cs +++ b/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtor/UnusedTypeHasExplicitInterfacePropertyPreservedViaXml.cs @@ -28,7 +28,7 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoKeptC class A : IBar, IFoo { [Kept] - int IFoo.Foo { [Kept] [ExpectBodyModified] get; [Kept] [ExpectBodyModified] set; } + int IFoo.Foo { [Kept][ExpectBodyModified] get; [Kept][ExpectBodyModified] set; } int IBar.Bar { get; set; } } diff --git a/test/Mono.Linker.Tests.Cases/Serialization/SerializationTypeRecursion.cs b/test/Mono.Linker.Tests.Cases/Serialization/SerializationTypeRecursion.cs index dfad711ba..af92529b4 100644 --- a/test/Mono.Linker.Tests.Cases/Serialization/SerializationTypeRecursion.cs +++ b/test/Mono.Linker.Tests.Cases/Serialization/SerializationTypeRecursion.cs @@ -54,18 +54,18 @@ namespace Mono.Linker.Tests.Cases.Serialization [Kept] [KeptBackingField] - public GetSetPropertyType p2 { [Kept]get; [Kept]set; } + public GetSetPropertyType p2 { [Kept] get; [Kept] set; } // removed PrivatePropertyType p3 { get; set; } [Kept] [KeptBackingField] - public PublicGetPrivateSetPropertyType p4 { [Kept]get; [Kept]private set; } + public PublicGetPrivateSetPropertyType p4 { [Kept] get; [Kept] private set; } [Kept] [KeptBackingField] - public PrivateGetPublicSetPropertyType p5 { [Kept]private get; [Kept]set; } + public PrivateGetPublicSetPropertyType p5 { [Kept] private get; [Kept] set; } [Kept] public RecursiveType f4; diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs index f1be225b9..809d0225f 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs @@ -33,7 +33,7 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding } [Kept] - public static void Test_2<[KeptAttributeAttribute (typeof (TestType3Attribute))] [TestType3 (typeof (ImplementationLibrary))] T> () + public static void Test_2<[KeptAttributeAttribute (typeof (TestType3Attribute))][TestType3 (typeof (ImplementationLibrary))] T> () { } diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBlock/MethodWithParametersSubstitutions.cs b/test/Mono.Linker.Tests.Cases/UnreachableBlock/MethodWithParametersSubstitutions.cs index 51e60defe..e1c7b9def 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBlock/MethodWithParametersSubstitutions.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBlock/MethodWithParametersSubstitutions.cs @@ -358,7 +358,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBlock [Kept] static void MethodWithParamAndVarArgs_Reached2 () { } - [Kept] [KeptMember (".ctor()")] class TestClass { } + [Kept][KeptMember (".ctor()")] class TestClass { } [Kept] struct TestStruct { } [Kept] diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBody/SimpleGetter.cs b/test/Mono.Linker.Tests.Cases/UnreachableBody/SimpleGetter.cs index 7cf0078e4..4ee1ebfcb 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBody/SimpleGetter.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBody/SimpleGetter.cs @@ -21,7 +21,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBody class Foo { [Kept] - public string Property { [Kept] [ExpectBodyModified] get; set; } + public string Property { [Kept][ExpectBodyModified] get; set; } } } }
\ No newline at end of file diff --git a/test/Mono.Linker.Tests.Cases/UnreachableBody/SimpleSetter.cs b/test/Mono.Linker.Tests.Cases/UnreachableBody/SimpleSetter.cs index 971477418..7dc74a98e 100644 --- a/test/Mono.Linker.Tests.Cases/UnreachableBody/SimpleSetter.cs +++ b/test/Mono.Linker.Tests.Cases/UnreachableBody/SimpleSetter.cs @@ -21,7 +21,7 @@ namespace Mono.Linker.Tests.Cases.UnreachableBody class Foo { [Kept] - public string Property { get; [Kept] [ExpectBodyModified] set; } + public string Property { get; [Kept][ExpectBodyModified] set; } } } }
\ No newline at end of file diff --git a/test/Mono.Linker.Tests/TestCasesRunner/ILCompiler.cs b/test/Mono.Linker.Tests/TestCasesRunner/ILCompiler.cs index 9bec9957a..063580f55 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/ILCompiler.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/ILCompiler.cs @@ -46,7 +46,7 @@ namespace Mono.Linker.Tests.TestCasesRunner process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; } - private string BuildArguments (CompilerOptions options) + private static string BuildArguments (CompilerOptions options) { var args = new StringBuilder (); #if NETCOREAPP diff --git a/test/Mono.Linker.Tests/TestCasesRunner/PathUtilities.cs b/test/Mono.Linker.Tests/TestCasesRunner/PathUtilities.cs index 8c8d3dbb9..4a02b50ac 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/PathUtilities.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/PathUtilities.cs @@ -14,7 +14,9 @@ namespace Mono.Linker.Tests.TestCasesRunner public const string ConfigDirectoryName = "Release"; #endif -#if NET6_0 +#if NET7_0 + public const string TFMDirectoryName = "net7.0"; +#elif NET6_0 public const string TFMDirectoryName = "net6.0"; #elif NET5_0 public const string TFMDirectoryName = "net5.0"; diff --git a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs index 991c1860e..51d534be4 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs @@ -336,7 +336,7 @@ namespace Mono.Linker.Tests.TestCasesRunner return CompileCSharpAssemblyWithDefaultCompiler (options); } - protected NPath CompileCSharpAssemblyWithExternalCompiler (string executable, CompilerOptions options, string compilerSpecificArguments) + protected static NPath CompileCSharpAssemblyWithExternalCompiler (string executable, CompilerOptions options, string compilerSpecificArguments) { var capturedOutput = new List<string> (); var process = new Process (); @@ -365,7 +365,7 @@ namespace Mono.Linker.Tests.TestCasesRunner return "mcs"; } - protected string OptionsToCompilerCommandLineArguments (CompilerOptions options, string compilerSpecificArguments) + protected static string OptionsToCompilerCommandLineArguments (CompilerOptions options, string compilerSpecificArguments) { var builder = new StringBuilder (); if (!string.IsNullOrEmpty (compilerSpecificArguments)) diff --git a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseSandbox.cs b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseSandbox.cs index 510f5a7a1..98528ae8d 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseSandbox.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseSandbox.cs @@ -19,7 +19,7 @@ namespace Mono.Linker.Tests.TestCasesRunner static NPath GetArtifactsTestPath () { - // Converts paths like /root-folder/linker/artifacts/bin/Mono.Linker.Tests/Debug/net6.0/illink.dll + // Converts paths like /root-folder/linker/artifacts/bin/Mono.Linker.Tests/Debug/<tfm>/illink.dll // to /root-folder/linker/artifacts/testcases/ string artifacts = Path.GetFullPath (Path.Combine (Path.GetDirectoryName (_linkerAssemblyPath), "..", "..", "..", "..")); string tests = Path.Combine (artifacts, "testcases"); |