Bring back pwsh.exe for framework dependent packages to support Start-Job (#16535)

* Bring back pwsh.exe for framework dependent packages to support Start-Job

* Update wix file

* Add release tests for fxd packages

* Fix tests

* Fix stage dependencies

* Address CR comments

* Fix typo

* Add value for the hashtable item
This commit is contained in:
Aditya Patwardhan
2021-12-02 15:05:54 -08:00
committed by GitHub
parent 1920b1b6ea
commit 2d27da40d8
5 changed files with 97 additions and 9 deletions
+4
View File
@@ -3137,6 +3137,9 @@
<Component Id="cmp408A3AF905EB47ADA35FBC5A6B1465A0">
<File Id="fil2146848B6ACB45FCA8E9C8FEE3BECDD8" KeyPath="yes" Source="$(var.ProductSourcePath)\_manifest\spdx_2.2\manifest.spdx.json" />
</Component>
<Component Id="cmp58D994EAF5F64D618ABC0E63DCD48C05">
<File Id="filFB88509DC8C044A28FF3B7CF61B1CE4F" KeyPath="yes" Source="$(var.ProductSourcePath)\_manifest\spdx_2.2\manifest.spdx.json.sha256" />
</Component>
</Directory>
</Directory>
<Component Id="cmpA6276F9EAB41411AAAEC496E67A3DBAE">
@@ -4170,6 +4173,7 @@
<ComponentRef Id="cmp0C4751F9D5C14419A45F234152D21DA9" />
<ComponentRef Id="cmpF96C036EAE3B436DB096888697193FAF" />
<ComponentRef Id="cmp789F545EA2CB4AC5A2688CF730A5F6B4" />
<ComponentRef Id="cmp58D994EAF5F64D618ABC0E63DCD48C05" />
</ComponentGroup>
</Fragment>
</Wix>
+3 -4
View File
@@ -439,10 +439,9 @@ Fix steps:
# Add --self-contained due to "warning NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used."
if ($Options.Runtime -like 'fxdependent*') {
$Arguments += "--no-self-contained"
# The UseAppHost = false property avoids creating ".exe" for the fxdependent packages.
# The ".exe" is not a cross-platform executable, but specific to the platform that it was built on.
# We do not need to ship that.
$Arguments += "/property:UseAppHost=false"
# The UseAppHost = true property creates ".exe" for the fxdependent packages.
# We need this in the package as Start-Job needs it.
$Arguments += "/property:UseAppHost=true"
}
else {
$Arguments += "--self-contained"
@@ -78,6 +78,31 @@ stages:
globalToolExeName: 'pwsh'
globalToolPackageName: 'PowerShell.Linux.x64'
- stage: ValidateFxdPackage
displayName: Validate Fxd Package
dependsOn: []
jobs:
- template: templates/release-ValidateFxdPackage.yml
parameters:
jobName: WinFxdPackage
displayName: Fxd Package Test Win
imageName: windows-latest
packageNamePattern: '**/*win-fxdependent.zip'
- template: templates/release-ValidateFxdPackage.yml
parameters:
jobName: FxdPackageWindDesktop
displayName: Fxd Package Test WinDesktop
imageName: windows-latest
packageNamePattern: '**/*win-fxdependentWinDesktop.zip'
- template: templates/release-ValidateFxdPackage.yml
parameters:
jobName: FxdPackageLinux
displayName: Fxd Package Test Linux
imageName: ubuntu-latest
packageNamePattern: '**/*fxdependent.tar.gz'
- stage: StaticPkgValidation
dependsOn: []
displayName: Static package validation
@@ -142,6 +167,8 @@ stages:
- StartDocker
- ManualValidation
- ReleaseAutomation
- ValidateFxdPackage
- ValidateGlobalTool
# The environment here is used for approval.
jobs:
@@ -0,0 +1,62 @@
parameters:
jobName: ""
displayName: ""
imageName: ""
packageNamePattern: ""
jobs:
- job: ${{ parameters.jobName }}
displayName: ${{ parameters.displayName }}
pool:
vmImage: ${{ parameters.imageName }}
steps:
- checkout: self
clean: true
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: PowerShellCore
pipeline: '696'
preferTriggeringPipeline: true
runVersion: latestFromBranch
runBranch: '$(Build.SourceBranch)'
artifact: finalResults
patterns: '${{ parameters.packageNamePattern }}'
path: '$(Pipeline.Workspace)/releasePipeline/finalResults'
- pwsh: |
Get-ChildItem -Path '$(Pipeline.Workspace)/releasePipeline/finalResults' -Recurse
displayName: Capture downloaded package
- pwsh: |
$destPath = New-Item '$(Pipeline.Workspace)/releasePipeline/finalResults/fxd' -ItemType Directory
$packageNameFilter = '${{ parameters.packageNamePattern }}'
if ($packageNameFilter.EndsWith('tar.gz')) {
$package = @(Get-ChildItem -Path '$(Pipeline.Workspace)/releasePipeline/finalResults/*.tar.gz')
Write-Verbose -Verbose "Package: $package"
if ($package.Count -ne 1) {
throw 'Only 1 package was expected.'
}
tar -xvf $package.FullName -C $destPath
}
else {
$package = @(Get-ChildItem -Path '$(Pipeline.Workspace)/releasePipeline/finalResults/*.zip')
Write-Verbose -Verbose "Package: $package"
if ($package.Count -ne 1) {
throw 'Only 1 package was expected.'
}
Expand-Archive -Path $package.FullName -Destination "$destPath" -Verbose
}
displayName: Expand fxd package
- pwsh: |
$packageNameFilter = '${{ parameters.packageNamePattern }}'
$pwshExeName = if ($packageNameFilter.EndsWith('tar.gz')) { 'pwsh' } else { 'pwsh.exe' }
$actualOutput = & $pwshExeName -c 'Start-Job -ScriptBlock { "1" } | Wait-Job | Receive-Job'
Write-Verbose -Verbose "Actual output: $actualOutput"
if ($actualOutput -ne 1) {
throw "Actual output is not as expected"
}
displayName: Test package
@@ -129,6 +129,7 @@ jobs:
"$($fullSymbolsFolder)\Modules\PSDiagnostics\PSDiagnostics.ps?1" = "Modules\PSDiagnostics"
"$($fullSymbolsFolder)\pwsh.dll" = ""
"$($fullSymbolsFolder)\System.Management.Automation.dll" = ""
"$($fullSymbolsFolder)\pwsh.exe" = ""
}
$itemsToExclude = @(
@@ -136,11 +137,6 @@ jobs:
"$($fullSymbolsFolder)\Microsoft.PowerShell.MarkdownRender.dll"
)
if ("$env:Architecture" -notlike 'fxdependent*')
{
$itemsToCopy += @{"$($fullSymbolsFolder)\pwsh.exe" = ""}
}
Write-Verbose -verbose "recusively copying $($itemsToCopyWithRecurse | out-string) to $filesToSignDirectory"
Copy-Item -Path $itemsToCopyWithRecurse -Destination $filesToSignDirectory -Recurse -verbose -exclude $itemsToExclude