From be410a26a1f8120978c7572a69ccb576c7000b13 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 18:40:47 +0000 Subject: [PATCH 01/20] add symlink creation and removal to package scripts --- tools/packaging/packaging.strings.psd1 | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tools/packaging/packaging.strings.psd1 b/tools/packaging/packaging.strings.psd1 index 8fcb4e93fc5..6d245636687 100644 --- a/tools/packaging/packaging.strings.psd1 +++ b/tools/packaging/packaging.strings.psd1 @@ -11,6 +11,14 @@ if [ ! -f /etc/shells ] ; then else grep -q "^{0}$" /etc/shells || echo "{0}" >> /etc/shells fi +if [ -f /lib64/libssl.so.1.1 ] ; then + ln -s /lib64/libssl.so.1.1 {1}/libssl.so.1.0.0 + ls -s /lib64/libcrypto.so.1.1.1 {1}/libcrypto.so.1.0.0 +else + ln -s /lib64/libssl.so.10 {1}/libssl.so.1.0.0 + ls -s /lib64/libcrypto.so.10 {1}/libcrypto.so.1.0.0 +fi + '@ RedHatAfterRemoveScript = @' @@ -20,6 +28,8 @@ if [ "$1" = 0 ] ; then grep -v '^{0}$' /etc/shells > $TmpFile cp -f $TmpFile /etc/shells rm -f $TmpFile + rm -f {1}/libssl.so.1.0.0 + rm -f {1}/libcrypto.so.1.0.0 fi fi '@ @@ -38,14 +48,50 @@ case "$1" in exit 0 ;; esac + +if [ -f /usr/lib/x86_64-linux-gnu/libssl.so.1.1 ] ; then + ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 {1}/libssl.so.1.0.0 + ls -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 {1}/libcrypto.so.1.0.0 +elif [ -f /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 ] ; then + ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 {1}/libssl.so.1.0.0 + ls -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 {1}/libcrypto.so.1.0.0 +else + ln -s /lib64/libssl.so.10 {1}/libssl.so.1.0.0 + ls -s /lib64/libcrypto.so.10 {1}/libcrypto.so.1.0.0 +fi + '@ +<#endregion + 'debian\.9' { + New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2" -Path "$Staging/libssl.so.1.0.0" > $null + New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2" -Path "$Staging/libcrypto.so.1.0.0" > $null + } + 'debian\.(10|11)' { + New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libssl.so.1.1" -Path "$Staging/libssl.so.1.0.0" > $null + New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1" -Path "$Staging/libcrypto.so.1.0.0" > $null + } + default { + # Default to old behavior before this change + New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.10" -Path "$Staging/libssl.so.1.0.0" > $null + New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.10" -Path "$Staging/libcrypto.so.1.0.0" > $null + + 'centos\.8' { + New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.1.1" -Path "$Staging/libssl.so.1.0.0" > $null + New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.1.1.1" -Path "$Staging/libcrypto.so.1.0.0" > $null + } + default { + New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.10" -Path "$Staging/libssl.so.1.0.0" > $null + New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.10" -Path "$Staging/libcrypto.so.1.0.0" > $null +#> UbuntuAfterRemoveScript = @' #!/bin/sh set -e case "$1" in (remove) remove-shell "{0}" + rm -f {1}/libssl.so.1.0.0 + rm -f {1}/libcrypto.so.1.0.0 ;; esac '@ From 38b2bcdfabec4db3c0452365f4126736f5002948 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 18:41:09 +0000 Subject: [PATCH 02/20] remove symlink creation from package files --- tools/packaging/packaging.psm1 | 75 ++++++---------------------------- 1 file changed, 12 insertions(+), 63 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index e9ede940673..ef21c7ffbf9 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -6,8 +6,8 @@ $RepoRoot = (Resolve-Path -Path "$PSScriptRoot/../..").Path $packagingStrings = Import-PowerShellDataFile "$PSScriptRoot\packaging.strings.psd1" Import-Module "$PSScriptRoot\..\Xml" -ErrorAction Stop -Force -$DebianDistributions = @("ubuntu.16.04", "ubuntu.18.04", "ubuntu.20.04", "debian.9", "debian.10", "debian.11") -$RedhatDistributions = @("rhel.7","centos.8") +$DebianDistributions = @("deb") +$RedhatDistributions = @("rh") $script:netCoreRuntime = 'net6.0' $script:iconFileName = "Powershell_black_64.png" $script:iconPath = Join-Path -path $PSScriptRoot -ChildPath "../../assets/$iconFileName" -Resolve @@ -904,8 +904,7 @@ function New-UnixPackage { if ($PSCmdlet.ShouldProcess("Create package file system")) { # Generate After Install and After Remove scripts - $AfterScriptInfo = New-AfterScripts -Link $Link -Distribution $DebDistro - New-PSSymbolicLinks -Distribution $DebDistro -Staging $Staging + $AfterScriptInfo = New-AfterScripts -Link $Link -Distribution $DebDistro -Destination $Destination # there is a weird bug in fpm # if the target of the powershell symlink exists, `fpm` aborts @@ -1362,7 +1361,11 @@ function New-AfterScripts [Parameter(Mandatory)] [string] - $Distribution + $Distribution, + + [Parameter(Mandatory)] + [string] + $Destination ) Write-Verbose -Message "AfterScript Distribution: $Distribution" -Verbose @@ -1370,14 +1373,14 @@ function New-AfterScripts if ($Environment.IsRedHatFamily) { $AfterInstallScript = [io.path]::GetTempFileName() $AfterRemoveScript = [io.path]::GetTempFileName() - $packagingStrings.RedHatAfterInstallScript -f "$Link" | Out-File -FilePath $AfterInstallScript -Encoding ascii - $packagingStrings.RedHatAfterRemoveScript -f "$Link" | Out-File -FilePath $AfterRemoveScript -Encoding ascii + $packagingStrings.RedHatAfterInstallScript -f "$Link", $Destination | Out-File -FilePath $AfterInstallScript -Encoding ascii + $packagingStrings.RedHatAfterRemoveScript -f "$Link", $Destination | Out-File -FilePath $AfterRemoveScript -Encoding ascii } elseif ($Environment.IsDebianFamily -or $Environment.IsSUSEFamily) { $AfterInstallScript = [io.path]::GetTempFileName() $AfterRemoveScript = [io.path]::GetTempFileName() - $packagingStrings.UbuntuAfterInstallScript -f "$Link" | Out-File -FilePath $AfterInstallScript -Encoding ascii - $packagingStrings.UbuntuAfterRemoveScript -f "$Link" | Out-File -FilePath $AfterRemoveScript -Encoding ascii + $packagingStrings.UbuntuAfterInstallScript -f "$Link", $Destination | Out-File -FilePath $AfterInstallScript -Encoding ascii + $packagingStrings.UbuntuAfterRemoveScript -f "$Link", $Destination | Out-File -FilePath $AfterRemoveScript -Encoding ascii } elseif ($Environment.IsMacOS) { # NOTE: The macos pkgutil doesn't support uninstall actions so we did not implement it. @@ -1392,60 +1395,6 @@ function New-AfterScripts } } -function New-PSSymbolicLinks -{ - param( - [Parameter(Mandatory)] - [string] - $Distribution, - - [Parameter(Mandatory)] - [string] - $Staging - ) - - Write-Verbose -Message "PSSymLinks-Distribution: $Distribution" -Verbose - - if ($Environment.IsRedHatFamily) { - switch -regex ($Distribution) - { - # add two symbolic links to system shared libraries that libmi.so is dependent on to handle - # platform specific changes. This is the only set of platforms needed for this currently - # as Ubuntu has these specific library files in the platform and macOS builds for itself - # against the correct versions. - 'centos\.8' { - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.1.1" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.1.1.1" -Path "$Staging/libcrypto.so.1.0.0" > $null - } - default { - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.10" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.10" -Path "$Staging/libcrypto.so.1.0.0" > $null - } - } - } - elseif ($Environment.IsDebianFamily -or $Environment.IsSUSEFamily) { - switch -regex ($Distribution) - { - # add two symbolic links to system shared libraries that libmi.so is dependent on to handle - # platform specific changes. This appears to be a change in Debian 9; Debian 8 did not need these - # symlinks. - 'debian\.9' { - New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2" -Path "$Staging/libcrypto.so.1.0.0" > $null - } - 'debian\.(10|11)' { - New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libssl.so.1.1" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1" -Path "$Staging/libcrypto.so.1.0.0" > $null - } - default { - # Default to old behavior before this change - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.10" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.10" -Path "$Staging/libcrypto.so.1.0.0" > $null - } - } - } -} - function New-ManGzip { param( From 3ed54263a6f649f88151d23fb669a16f101de437 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 19:01:24 +0000 Subject: [PATCH 03/20] add linux packaging CI --- .vsts-ci/linux.yml | 4 ++ .vsts-ci/linux/templates/packaging.yml | 75 ++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .vsts-ci/linux/templates/packaging.yml diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index be7de6d8fc5..7979173a0c0 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -89,6 +89,10 @@ stages: parameters: pool: ubuntu-16.04 + - template: linux/templates/packaging.yml + parameters: + pool: ubuntu-16.04 + - stage: CodeCovTestPackage displayName: CodeCoverage and Test Packages dependsOn: [] # by specifying an empty array, this stage doesn't depend on the stage before it diff --git a/.vsts-ci/linux/templates/packaging.yml b/.vsts-ci/linux/templates/packaging.yml new file mode 100644 index 00000000000..01d5ef6bff3 --- /dev/null +++ b/.vsts-ci/linux/templates/packaging.yml @@ -0,0 +1,75 @@ +parameters: + pool: 'ubuntu-18.04' + parentJobs: [] + name: 'Deb' + +jobs: +- job: ${{ parameters.name }}_packaging + dependsOn: + ${{ parameters.parentJobs }} + pool: + vmImage: ${{ parameters.pool }} + + displayName: ${{ parameters.name }} packaging + + steps: + - pwsh: | + Get-ChildItem -Path env: + displayName: Capture Environment + condition: succeededOrFailed() + + - task: DownloadBuildArtifacts@0 + displayName: 'Download build artifacts' + inputs: + downloadType: specific + itemPattern: | + build/**/* + downloadPath: '$(System.ArtifactsDirectory)' + + - pwsh: | + Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse + displayName: 'Capture Artifacts Directory' + continueOnError: true + + - pwsh: | + Import-Module .\tools\ci.psm1 + Invoke-CIInstall -SkipUser + displayName: Bootstrap + + - pwsh: | + Import-Module ./build.psm1 + displayName: 'Capture Artifacts Directory' + continueOnError: true + + - task: ExtractFiles@1 + displayName: 'Extract Build ZIP' + inputs: + archiveFilePatterns: '$(System.ArtifactsDirectory)/build/build.zip' + destinationFolder: '$(System.ArtifactsDirectory)/bins' + + - bash: | + find "$(System.ArtifactsDirectory)/bins" -type d -exec chmod +rwx {} \; + find "$(System.ArtifactsDirectory)/bins" -type f -exec chmod +rw {} \; + displayName: 'Fix permissions' + continueOnError: true + + - pwsh: | + Get-ChildItem "$(System.ArtifactsDirectory)\bins\*" -Recurse -ErrorAction SilentlyContinue + displayName: 'Capture Extracted Build ZIP' + continueOnError: true + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + $options = (Get-PSOptions) + $rootPath = '$(System.ArtifactsDirectory)\bins' + $originalRootPath = Split-Path -path $options.Output + $path = Join-Path -path $rootPath -ChildPath (split-path -leaf -path $originalRootPath) + $pwshPath = Join-Path -path $path -ChildPath 'pwsh' + chmod a+x $pwshPath + $options.Output = $pwshPath + Set-PSOptions $options + Invoke-CIFinish + displayName: Packaging Tests + condition: succeeded() + From 4f27d7c66915cd5d5a0cd4bd5007bcd3d9d5a94a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 19:10:49 +0000 Subject: [PATCH 04/20] fix bootstrap --- .vsts-ci/linux/templates/packaging.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vsts-ci/linux/templates/packaging.yml b/.vsts-ci/linux/templates/packaging.yml index 01d5ef6bff3..de89b204b72 100644 --- a/.vsts-ci/linux/templates/packaging.yml +++ b/.vsts-ci/linux/templates/packaging.yml @@ -32,8 +32,8 @@ jobs: continueOnError: true - pwsh: | - Import-Module .\tools\ci.psm1 - Invoke-CIInstall -SkipUser + Import-Module .\build.psm1 + Start-PSBootstrap -Package displayName: Bootstrap - pwsh: | From d6628afe7b345b9a65aa48382ba30c8d3b806225 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 19:21:13 +0000 Subject: [PATCH 05/20] remove symlink for tar --- tools/packaging/packaging.psm1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index ef21c7ffbf9..32f88a1d562 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -577,10 +577,6 @@ function New-TarballPackage { $Staging = "$PSScriptRoot/staging" New-StagingFolder -StagingPath $Staging -PackageSourcePath $PackageSourcePath - if (-not $ExcludeSymbolicLinks.IsPresent) { - New-PSSymbolicLinks -Distribution 'ubuntu.16.04' -Staging $Staging - } - if (Get-Command -Name tar -CommandType Application -ErrorAction Ignore) { if ($Force -or $PSCmdlet.ShouldProcess("Create tarball package")) { $options = "-czf" From ab6ed7dc436868536c968b8600ff0fc3a7fe1125 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 19:24:56 +0000 Subject: [PATCH 06/20] move packaging to its own stage --- .vsts-ci/linux.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index 7979173a0c0..c613636ceb3 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -89,6 +89,10 @@ stages: parameters: pool: ubuntu-16.04 +- stage: PackageLinux + displayName: Package Linux + dependsOn: ["BuildLinux"] # by specifying an empty array, this stage doesn't depend on the stage before it + jobs: - template: linux/templates/packaging.yml parameters: pool: ubuntu-16.04 From 42b389637c8ce7c3650f6660f287a454b133a249 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 19:38:30 +0000 Subject: [PATCH 07/20] publish packages --- .vsts-ci/linux/templates/packaging.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.vsts-ci/linux/templates/packaging.yml b/.vsts-ci/linux/templates/packaging.yml index de89b204b72..f36b794a50e 100644 --- a/.vsts-ci/linux/templates/packaging.yml +++ b/.vsts-ci/linux/templates/packaging.yml @@ -73,3 +73,21 @@ jobs: displayName: Packaging Tests condition: succeeded() + - pwsh: | + Get-ChildItem '${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.deb' -Recurse | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=deb;artifactname=deb]$packagePath" + } + Get-ChildItem '${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.rpm' -Recurse | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" + } + Get-ChildItem '${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.tar.gz' -Recurse | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" + } + displayName: Upload packages + From b0d943777a60080339ad32b71f2a0d211970d8e5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 19:38:48 +0000 Subject: [PATCH 08/20] conditionally insert template --- .vsts-ci/templates/ci-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vsts-ci/templates/ci-build.yml b/.vsts-ci/templates/ci-build.yml index 9dc43bc8ebf..b88aa1b7c3d 100644 --- a/.vsts-ci/templates/ci-build.yml +++ b/.vsts-ci/templates/ci-build.yml @@ -20,7 +20,8 @@ jobs: displayName: Set Build Name for Non-PR condition: ne(variables['Build.Reason'], 'PullRequest') - - template: /tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml + - ${{ if ne(variables['AzDevOpsFeed'], '') }}: + - template: /tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml - pwsh: | if (Test-Path -Path $HOME/.dotnet) { From b1c038ac41381ce20c18d670ebe2eb9eeff052b0 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 19:39:21 +0000 Subject: [PATCH 09/20] build RPM --- tools/ci.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 41e972b9bcf..4b71321e56f 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -713,7 +713,7 @@ function New-LinuxPackage # Only build packages for PowerShell/PowerShell repository # branches, not pull requests - $packages = @(Start-PSPackage @packageParams -SkipReleaseChecks) + $packages = @(Start-PSPackage @packageParams -SkipReleaseChecks -Type deb, rpm, tar) foreach($package in $packages) { if (Test-Path $package) From 5f260336c8565d5ba63276e1cd30fa54f6b15652 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 20:06:59 +0000 Subject: [PATCH 10/20] remove distro restrictions --- tools/packaging/packaging.psm1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 32f88a1d562..5f20f595f5c 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -836,9 +836,6 @@ function New-UnixPackage { } $packageVersion = Get-LinuxPackageSemanticVersion -Version $Version - if (!$Environment.IsRedHatFamily -and !$Environment.IsSUSEFamily) { - throw ($ErrorMessage -f "Redhat or SUSE Family") - } } "osxpkg" { $packageVersion = $Version From b113c2facaa59763e5645ab54a69d6da5340efcb Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 20:20:32 +0000 Subject: [PATCH 11/20] remove more distribution restrictions --- tools/packaging/packaging.psm1 | 41 ++++++++-------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 5f20f595f5c..aa557f3dd66 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1257,42 +1257,18 @@ function Get-FpmArguments return $Arguments } -function Test-Distribution -{ - param( - [String] - $Distribution - ) - - if ( $Environment.IsDebianFamily -and !$Distribution ) - { - throw "$Distribution is required for a Debian based distribution." - } - - if ( $Environment.IsDebianFamily -and $Script:DebianDistributions -notcontains $Distribution) - { - throw "$Distribution should be one of the following: $Script:DebianDistributions" - } - - if ( $Environment.IsRedHatFamily -and $Script:RedHatDistributions -notcontains $Distribution) - { - throw "$Distribution should be one of the following: $Script:RedHatDistributions" - } - - return $true -} function Get-PackageDependencies { param( [String] - [ValidateScript({Test-Distribution -Distribution $_})] + [ValidateSet('rh','deb')] $Distribution ) End { # These should match those in the Dockerfiles, but exclude tools like Git, which, and curl $Dependencies = @() - if ($Environment.IsDebianFamily) { + if ($Distribution -eq 'deb') { $Dependencies = @( "libc6", "libgcc1", @@ -1303,17 +1279,18 @@ function Get-PackageDependencies "libssl1.1|libssl1.0.2|libssl1.0.0" ) - } elseif ($Environment.IsRedHatFamily) { + } elseif ($Distribution -eq 'rh') { $Dependencies = @( "openssl-libs", "libicu" ) - } elseif ($Environment.IsSUSEFamily) { - $Dependencies = @( - "libopenssl1_0_0", - "libicu" - ) } + # elseif ($Environment.IsSUSEFamily) { + # $Dependencies = @( + # "libopenssl1_0_0", + # "libicu" + # ) + # } return $Dependencies } From 010b54a8b5c1bb3ac2906c6adb4d79ae451c4206 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 20:40:35 +0000 Subject: [PATCH 12/20] fix quotes --- .vsts-ci/linux/templates/packaging.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vsts-ci/linux/templates/packaging.yml b/.vsts-ci/linux/templates/packaging.yml index f36b794a50e..b825bafffbb 100644 --- a/.vsts-ci/linux/templates/packaging.yml +++ b/.vsts-ci/linux/templates/packaging.yml @@ -74,17 +74,17 @@ jobs: condition: succeeded() - pwsh: | - Get-ChildItem '${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.deb' -Recurse | ForEach-Object { + Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.deb" -Recurse | ForEach-Object { $packagePath = $_.FullName Write-Host "Uploading $packagePath" Write-Host "##vso[artifact.upload containerfolder=deb;artifactname=deb]$packagePath" } - Get-ChildItem '${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.rpm' -Recurse | ForEach-Object { + Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.rpm" -Recurse | ForEach-Object { $packagePath = $_.FullName Write-Host "Uploading $packagePath" Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" } - Get-ChildItem '${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.tar.gz' -Recurse | ForEach-Object { + Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.tar.gz" -Recurse | ForEach-Object { $packagePath = $_.FullName Write-Host "Uploading $packagePath" Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" From 2a04d88397f7e75643f2c759a527708cfd3395d2 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 20:43:46 +0000 Subject: [PATCH 13/20] remove space --- .vsts-ci/linux/templates/packaging.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.vsts-ci/linux/templates/packaging.yml b/.vsts-ci/linux/templates/packaging.yml index b825bafffbb..145173cb5da 100644 --- a/.vsts-ci/linux/templates/packaging.yml +++ b/.vsts-ci/linux/templates/packaging.yml @@ -90,4 +90,3 @@ jobs: Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" } displayName: Upload packages - From b952c0d658e37e3db5dade5a990cd61372a4a832 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 21:05:02 +0000 Subject: [PATCH 14/20] publish on PRs --- tools/ci.psm1 | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 4b71321e56f..013598a581e 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -725,21 +725,18 @@ function New-LinuxPackage Write-Error -Message "Package NOT found: $package" } - if($isFullBuild) + if ($package -isnot [System.IO.FileInfo]) { - if ($package -isnot [System.IO.FileInfo]) - { - $packageObj = Get-Item $package - Write-Error -Message "The PACKAGE is not a FileInfo object" - } - else - { - $packageObj = $package - } - - Write-Log -message "Artifacts directory: ${env:BUILD_ARTIFACTSTAGINGDIRECTORY}" - Copy-Item $packageObj.FullName -Destination "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}" -Force + $packageObj = Get-Item $package + Write-Error -Message "The PACKAGE is not a FileInfo object" } + else + { + $packageObj = $package + } + + Write-Log -message "Artifacts directory: ${env:BUILD_ARTIFACTSTAGINGDIRECTORY}" + Copy-Item $packageObj.FullName -Destination "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}" -Force } if ($IsLinux) From eb720f005aeaf75451c429f10030718812982908 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 21:49:54 +0000 Subject: [PATCH 15/20] fix link creation --- .vsts-ci/linux/templates/packaging.yml | 2 +- tools/packaging/packaging.strings.psd1 | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.vsts-ci/linux/templates/packaging.yml b/.vsts-ci/linux/templates/packaging.yml index 145173cb5da..229a91322ac 100644 --- a/.vsts-ci/linux/templates/packaging.yml +++ b/.vsts-ci/linux/templates/packaging.yml @@ -1,7 +1,7 @@ parameters: pool: 'ubuntu-18.04' parentJobs: [] - name: 'Deb' + name: 'Linux' jobs: - job: ${{ parameters.name }}_packaging diff --git a/tools/packaging/packaging.strings.psd1 b/tools/packaging/packaging.strings.psd1 index 6d245636687..365cfdcc9e3 100644 --- a/tools/packaging/packaging.strings.psd1 +++ b/tools/packaging/packaging.strings.psd1 @@ -12,11 +12,11 @@ else grep -q "^{0}$" /etc/shells || echo "{0}" >> /etc/shells fi if [ -f /lib64/libssl.so.1.1 ] ; then - ln -s /lib64/libssl.so.1.1 {1}/libssl.so.1.0.0 - ls -s /lib64/libcrypto.so.1.1.1 {1}/libcrypto.so.1.0.0 + ln -f -s /lib64/libssl.so.1.1 {1}/libssl.so.1.0.0 + ln -f -s /lib64/libcrypto.so.1.1.1 {1}/libcrypto.so.1.0.0 else - ln -s /lib64/libssl.so.10 {1}/libssl.so.1.0.0 - ls -s /lib64/libcrypto.so.10 {1}/libcrypto.so.1.0.0 + ln -f -s /lib64/libssl.so.10 {1}/libssl.so.1.0.0 + ln -f -s /lib64/libcrypto.so.10 {1}/libcrypto.so.1.0.0 fi '@ @@ -50,14 +50,14 @@ case "$1" in esac if [ -f /usr/lib/x86_64-linux-gnu/libssl.so.1.1 ] ; then - ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 {1}/libssl.so.1.0.0 - ls -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 {1}/libcrypto.so.1.0.0 + ln -f -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 {1}/libssl.so.1.0.0 + ln -f -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 {1}/libcrypto.so.1.0.0 elif [ -f /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 ] ; then - ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 {1}/libssl.so.1.0.0 - ls -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 {1}/libcrypto.so.1.0.0 + ln -f -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 {1}/libssl.so.1.0.0 + ln -f -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 {1}/libcrypto.so.1.0.0 else - ln -s /lib64/libssl.so.10 {1}/libssl.so.1.0.0 - ls -s /lib64/libcrypto.so.10 {1}/libcrypto.so.1.0.0 + ln -f -s /lib64/libssl.so.10 {1}/libssl.so.1.0.0 + ln -f -s /lib64/libcrypto.so.10 {1}/libcrypto.so.1.0.0 fi '@ From 962895d1f1a57f22094f403e4d25b24a7d5e6f08 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 17:01:05 -0700 Subject: [PATCH 16/20] Update .vsts-ci/linux/templates/packaging.yml --- .vsts-ci/linux/templates/packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vsts-ci/linux/templates/packaging.yml b/.vsts-ci/linux/templates/packaging.yml index 229a91322ac..530232cbf67 100644 --- a/.vsts-ci/linux/templates/packaging.yml +++ b/.vsts-ci/linux/templates/packaging.yml @@ -1,5 +1,5 @@ parameters: - pool: 'ubuntu-18.04' + pool: 'ubuntu-16.04' parentJobs: [] name: 'Linux' From 408a1e35ad31dd9cd6c8e70559ba703d0ee93041 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 17:01:41 -0700 Subject: [PATCH 17/20] Update .vsts-ci/linux.yml Co-authored-by: Aditya Patwardhan --- .vsts-ci/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index c613636ceb3..b5e6db0db71 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -91,7 +91,7 @@ stages: - stage: PackageLinux displayName: Package Linux - dependsOn: ["BuildLinux"] # by specifying an empty array, this stage doesn't depend on the stage before it + dependsOn: ["BuildLinux"] jobs: - template: linux/templates/packaging.yml parameters: From 29aec20789afd75af67034b36dc45c21dc6d1ad3 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 17:03:16 -0700 Subject: [PATCH 18/20] Update packaging.strings.psd1 --- tools/packaging/packaging.strings.psd1 | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/tools/packaging/packaging.strings.psd1 b/tools/packaging/packaging.strings.psd1 index 365cfdcc9e3..7a06855442d 100644 --- a/tools/packaging/packaging.strings.psd1 +++ b/tools/packaging/packaging.strings.psd1 @@ -61,29 +61,7 @@ else fi '@ -<#endregion - 'debian\.9' { - New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2" -Path "$Staging/libcrypto.so.1.0.0" > $null - } - 'debian\.(10|11)' { - New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libssl.so.1.1" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1" -Path "$Staging/libcrypto.so.1.0.0" > $null - } - default { - # Default to old behavior before this change - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.10" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.10" -Path "$Staging/libcrypto.so.1.0.0" > $null - - - 'centos\.8' { - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.1.1" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.1.1.1" -Path "$Staging/libcrypto.so.1.0.0" > $null - } - default { - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.10" -Path "$Staging/libssl.so.1.0.0" > $null - New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.10" -Path "$Staging/libcrypto.so.1.0.0" > $null -#> + UbuntuAfterRemoveScript = @' #!/bin/sh set -e From 6424c948d9de41028b1a75883f973f2c96bcf48f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 26 Mar 2021 17:04:06 -0700 Subject: [PATCH 19/20] Update packaging.psm1 --- tools/packaging/packaging.psm1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index aa557f3dd66..e4a5e8ae7e5 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1285,12 +1285,6 @@ function Get-PackageDependencies "libicu" ) } - # elseif ($Environment.IsSUSEFamily) { - # $Dependencies = @( - # "libopenssl1_0_0", - # "libicu" - # ) - # } return $Dependencies } From 265f83778acfff3a2dc2deab9008df848ecc743b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 31 Mar 2021 11:44:08 -0700 Subject: [PATCH 20/20] add macos --- tools/packaging/packaging.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index e4a5e8ae7e5..8ef384d0e32 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1261,7 +1261,7 @@ function Get-PackageDependencies { param( [String] - [ValidateSet('rh','deb')] + [ValidateSet('rh','deb','macOS')] $Distribution )