Merged PR 30659: Backport #21238, #21239, #21408, #21415 - and update SDK + dependencies

and cgmanifest
This commit is contained in:
Patrick Meinecke 2024-04-05 19:47:03 +00:00
parent b0692c1f07
commit 89c9bb64ef
14 changed files with 56 additions and 43 deletions

View File

@ -1,5 +1,11 @@
{
"instanceUrl": "https://msazure.visualstudio.com",
"projectName": "One",
"areaPath": "One\\MGMT\\Compute\\Powershell\\Powershell\\PowerShell Core"
"areaPath": "One\\MGMT\\Compute\\Powershell\\Powershell\\PowerShell Core",
"notificationAliases": [
"adityap@microsoft.com",
"dongbow@microsoft.com",
"pmeinecke@microsoft.com",
"tplunk@microsoft.com"
]
}

View File

@ -1,14 +1,5 @@
name: UnifiedPackageBuild-$(Build.BuildId)
trigger:
branches:
include:
- master
- release*
pr:
branches:
include:
- master
- release*
trigger: none
parameters:
- name: ForceAzureBlobDelete
@ -194,7 +185,7 @@ extends:
parameters:
Architecture: x64
BuildConfiguration: minSize
JobName: build_windows_x64_minSize
JobName: build_windows_x64_minSize_release
- template: /.pipelines/templates/windows-hosted-build.yml@self
parameters:
Architecture: x86

View File

@ -5,7 +5,7 @@ steps:
- pwsh: |
$configPath = "${env:NugetConfigDir}/nuget.config"
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT2) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
New-NugetConfigFile -NugetFeedUrl $(PowerShellCore_PublicPackages) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedUserName) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
if(-not (Test-Path $configPath))
{
throw "nuget.config is not created"
@ -20,7 +20,7 @@ steps:
- pwsh: |
$configPath = "${env:NugetConfigDir}/nuget.config"
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
New-NugetConfigFile -NugetFeedUrl $(PowerShellCore_PublicPackages) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedUserName) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
if(-not (Test-Path $configPath))
{
throw "nuget.config is not created"

View File

@ -27,7 +27,7 @@ jobs:
value: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json
- name: ob_sdl_credscan_suppressionsFile
value: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
- name: BuildConfiguration
- name: BUILDCONFIGURATION
value: ${{ parameters.BuildConfiguration }}
- name: Runtime
value: ${{ parameters.Runtime }}
@ -66,7 +66,8 @@ jobs:
$runtime = $env:RUNTIME
$params = @{}
if ($env:BuildConfiguration -eq 'minSize') {
if ($env:BUILDCONFIGURATION -eq 'minSize') {
Write-Verbose -Message "Building for minimal size"
$params['ForMinimalSize'] = $true
}
@ -78,6 +79,11 @@ jobs:
$null = New-Item -ItemType Directory -Path $buildWithSymbolsPath -Force -Verbose
Start-PSBuild -Runtime $runtime -Configuration Release -Output $buildWithSymbolsPath @params -Clean -PSModuleRestore
$outputPath = Join-Path '$(ob_outputDirectory)' 'psoptions'
$null = New-Item -ItemType Directory -Path $outputPath -Force
$psOptPath = "$outputPath/psoptions.json"
Save-PSOptions -PSOptionsPath $psOptPath
Write-Verbose -Verbose "Verifying pdbs exist in build folder"
$pdbs = Get-ChildItem -Path $buildWithSymbolsPath -Recurse -Filter *.pdb
if ($pdbs.Count -eq 0) {
@ -90,7 +96,7 @@ jobs:
}
}
Write-Verbose -Verbose "Completed building PowerShell for '$env:BuildConfiguration' configuration"
Write-Verbose -Verbose "Completed building PowerShell for '$env:BUILDCONFIGURATION' configuration"
displayName: 'Build Linux - $(Runtime)'
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)

View File

@ -54,7 +54,17 @@ jobs:
$env:AzDevOpsFeedPAT2 = '$(AzDevOpsFeedPAT2)'
# Add -SkipReleaseChecks as a mitigation to unblock release.
# macos-10.15 does not allow creating a folder under root. Hence, moving the folder.
$(Build.SourcesDirectory)/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -ReleaseTag $(ReleaseTagVar) -Destination $(System.ArtifactsDirectory) -Symbols -location $(PowerShellRoot) -Build -ArtifactName macosBinResults -Runtime 'osx-${{ parameters.buildArchitecture }}' -SkipReleaseChecks
Import-Module ./build.psm1 -Force
Start-PSBuild -Runtime 'osx-${{ parameters.buildArchitecture }}' -Configuration Release -PSModuleRestore -Clean -Output $(OB_OUTPUTDIRECTORY)
$artifactName = "macosBinResults-${{ parameters.buildArchitecture }}"
$psOptPath = "$(OB_OUTPUTDIRECTORY)/psoptions.json"
Save-PSOptions -PSOptionsPath $psOptPath
# Since we are using custom pool for macOS, we need to use artifact.upload to publish the artifacts
Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName]$(OB_OUTPUTDIRECTORY)"
$env:AzDevOpsFeedPAT2 = $null
displayName: 'Build'
env:
@ -84,7 +94,7 @@ jobs:
- name: ob_sdl_codeql_compiled_enabled
value: false
- name: ob_sdl_sbom_packageName
value: 'Microsoft.Powershell.Windows.${{parameters.buildArchitecture}}'
value: 'Microsoft.Powershell.MacOS.${{parameters.buildArchitecture}}'
steps:
- checkout: self
@ -100,7 +110,7 @@ jobs:
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'macosBinResults'
artifact: 'macosBinResults-$(BuildArchitecture)'
path: '$(Pipeline.Workspace)\Symbols'
displayName: Download build
@ -115,12 +125,7 @@ jobs:
Write-Host "sending.. vso[task.setvariable variable=Runtime]$runtime"
Write-Host "##vso[task.setvariable variable=Runtime]$runtime"
$zipPath = Get-Item '$(Pipeline.Workspace)\Symbols\*symbol*${{ parameters.buildArchitecture }}*.zip' -Verbose
Write-Verbose -Verbose "Zip Path: $zipPath"
$expandedFolder = $zipPath.BaseName
Expand-Archive -Path $zipPath -Destination "$(Pipeline.Workspace)\$expandedFolder" -Force
$rootPath = "$(Pipeline.Workspace)\$expandedFolder"
$rootPath = "$(Pipeline.Workspace)\Symbols"
Write-Verbose -Verbose "Setting vso[task.setvariable variable=DropRootPath]$rootPath"
Write-Host "##vso[task.setvariable variable=DropRootPath]$rootPath"
displayName: Expand symbols zip

View File

@ -89,6 +89,11 @@ jobs:
$null = New-Item -ItemType Directory -Path $buildWithSymbolsPath -Force -Verbose
Start-PSBuild -Runtime $runtime -Configuration Release -Output $buildWithSymbolsPath -Clean -PSModuleRestore @params
$outputPath = Join-Path '$(ob_outputDirectory)' 'psoptions'
$null = New-Item -ItemType Directory -Path $outputPath -Force
$psOptPath = "$outputPath/psoptions.json"
Save-PSOptions -PSOptionsPath $psOptPath
Write-Verbose -Verbose "Verifying pdbs exist in build folder"
$pdbs = Get-ChildItem -Path $buildWithSymbolsPath -Recurse -Filter *.pdb
if ($pdbs.Count -eq 0) {

View File

@ -2238,6 +2238,7 @@ function Start-PSBootstrap {
# Install [fpm](https://github.com/jordansissel/fpm) and [ronn](https://github.com/rtomayko/ronn)
if ($Package) {
Install-GlobalGem -Sudo $sudo -GemName "dotenv" -GemVersion "2.8.1"
Install-GlobalGem -Sudo $sudo -GemName "ffi" -GemVersion "1.12.0"
Install-GlobalGem -Sudo $sudo -GemName "fpm" -GemVersion "1.11.0"
Install-GlobalGem -Sudo $sudo -GemName "ronn" -GemVersion "0.7.3"

View File

@ -1,5 +1,5 @@
{
"sdk": {
"version": "8.0.101"
"version": "8.0.203"
}
}

View File

@ -34,7 +34,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Include="System.Threading.AccessControl" Version="8.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.1" />
<PackageReference Include="System.Drawing.Common" Version="8.0.3" />
<PackageReference Include="JsonSchema.Net" Version="5.2.7" />
<!-- This section is to force the version of non-direct dependencies -->
<PackageReference Include="Json.More.Net" Version="1.9.3" />

View File

@ -16,6 +16,8 @@
<ItemGroup>
<!-- This section is to force the version of non-direct dependencies -->
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="8.0.3" />
<!-- the following package(s) are from https://github.com/dotnet/fxdac -->
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
@ -35,8 +37,7 @@
<PackageReference Include="System.Private.ServiceModel" Version="4.10.3" />
<PackageReference Include="System.Web.Services.Description" Version="4.10.3" />
<!-- the source could not be found for the following package(s) -->
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="5.0.17" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.3" />
</ItemGroup>
</Project>

View File

@ -10,12 +10,11 @@
<LangVersion>11.0</LangVersion>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<NoWarn>RS1035</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<!-- This section is to force the version of non-direct dependencies -->
<PackageReference Include="Microsoft.NETCore.Platforms" Version="1.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.24202.4" PrivateAssets="all" />
</ItemGroup>
</Project>

View File

@ -25,8 +25,8 @@
<ItemGroup>
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageReference Include="XunitXml.TestLogger" Version="3.1.17" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageReference Include="XunitXml.TestLogger" Version="3.1.20" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<!-- This section is to force the version of non-direct dependencies -->
<PackageReference Include="Validation" Version="2.4.22" />

View File

@ -1,5 +1,4 @@
{
"$schema": "https://json.schemastore.org/component-detection-manifest.json",
"Registrations": [
{
"Component": {
@ -86,7 +85,7 @@
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Bcl.AsyncInterfaces",
"Version": "5.0.0"
"Version": "8.0.0"
}
},
"DevelopmentDependency": false
@ -126,7 +125,7 @@
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Extensions.ObjectPool",
"Version": "5.0.17"
"Version": "8.0.3"
}
},
"DevelopmentDependency": false
@ -226,7 +225,7 @@
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Windows.Compatibility",
"Version": "8.0.1"
"Version": "8.0.3"
}
},
"DevelopmentDependency": false
@ -506,7 +505,7 @@
"Type": "nuget",
"Nuget": {
"Name": "System.Drawing.Common",
"Version": "8.0.1"
"Version": "8.0.3"
}
},
"DevelopmentDependency": false
@ -831,5 +830,6 @@
},
"DevelopmentDependency": false
}
]
],
"$schema": "https://json.schemastore.org/component-detection-manifest.json"
}

View File

@ -179,7 +179,6 @@ jobs:
verbosityLevel: standard
# write a status update every 5 minutes. Default is 1 minute
statusUpdateInterval: '00:05:00'
surrogateConfigurationFolder : $(surrogateFilePath)
env:
AzureServicesAuthConnectionString: RunAs=App;AppId=$(APIScanClient);TenantId=$(APIScanTenant);AppKey=$(APIScanSecret)