From 52c9c53d04e4789bdaf69c1f26e35e0b649d2b69 Mon Sep 17 00:00:00 2001 From: PRASOON KARUNAN V Date: Mon, 20 Nov 2017 13:38:33 +0530 Subject: [PATCH 01/18] Updated the error message as suggested . --- .../resources/ParameterBinderStrings.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/resources/ParameterBinderStrings.resx b/src/System.Management.Automation/resources/ParameterBinderStrings.resx index 1edbbba226e..8c49becc278 100644 --- a/src/System.Management.Automation/resources/ParameterBinderStrings.resx +++ b/src/System.Management.Automation/resources/ParameterBinderStrings.resx @@ -142,7 +142,7 @@ Cannot bind positional parameters because no names were given. - Parameter set cannot be resolved using the specified named parameters. + Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided. Cannot process command because of one or more missing mandatory parameters:{1}. From 59a78d54cc98235ab9417807d50da51b83a87cb2 Mon Sep 17 00:00:00 2001 From: bergmeister Date: Mon, 20 Nov 2017 20:28:17 +0000 Subject: [PATCH 02/18] Change synopsis of install-powershell.ps1 to reflect that it works cross-platform (#5465) --- tools/install-powershell.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index 8a69fb7e654..d614d512d6e 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -1,6 +1,6 @@ <# .Synopsis - Install PowerShell Core on Windows. + Install PowerShell Core on Windows, Linux or macOS. .DESCRIPTION By default, the latest PowerShell Core release package will be installed. If '-Daily' is specified, then the latest PowerShell Core daily package will be installed. From 3483d6dd7c9a840ae4e5853b66c9b866462b06e1 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 17 Nov 2017 16:47:24 -0800 Subject: [PATCH 03/18] update version regex for nanoserver docker (#5494) --- docker/release/nanoserver/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/release/nanoserver/Dockerfile b/docker/release/nanoserver/Dockerfile index 39c5e321a7e..ed500cb3496 100755 --- a/docker/release/nanoserver/Dockerfile +++ b/docker/release/nanoserver/Dockerfile @@ -16,7 +16,7 @@ ENV PS_DOWNLOAD_URL https://github.com/PowerShell/PowerShell/releases/download/v SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -RUN if (!($env:PS_VERSION -match '^\d+\.\d+\.\d+(-\w+\.\d+)?$' )) {throw ('PS_Version ({0}) must match the regex "^\d+\.\d+\.\d+(-\w+\.\d+)?$"' -f $env:PS_VERSION)} +RUN if (!($env:PS_VERSION -match '^\d+\.\d+\.\d+(-\w+(\.\d+)?)?$' )) {throw ('PS_Version ({0}) must match the regex "^\d+\.\d+\.\d+(-\w+(\.\d+)?)?$"' -f $env:PS_VERSION)} RUN Invoke-WebRequest $Env:PS_DOWNLOAD_URL -OutFile powershell.zip RUN Expand-Archive powershell.zip -DestinationPath \PowerShell From 0aeec3c27fd4342423c8e994f6083f7e559334d5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 17 Nov 2017 17:26:00 -0800 Subject: [PATCH 04/18] Fix mac packaging (#5496) --- tools/releaseBuild/macOS/PowerShellPackage.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/releaseBuild/macOS/PowerShellPackage.ps1 b/tools/releaseBuild/macOS/PowerShellPackage.ps1 index e4ee858361b..2fdc90fed11 100644 --- a/tools/releaseBuild/macOS/PowerShellPackage.ps1 +++ b/tools/releaseBuild/macOS/PowerShellPackage.ps1 @@ -34,6 +34,7 @@ if ($ReleaseTag) Push-Location try { Set-Location /PowerShell + git submodule update --init --recursive --quiet Import-Module "/PowerShell/build.psm1" Import-Module "/PowerShell/tools/packaging" From 368163ec499c3819e07e90cdc42156cf855eb729 Mon Sep 17 00:00:00 2001 From: Mark Kraus Date: Tue, 21 Nov 2017 15:09:27 -0600 Subject: [PATCH 05/18] [Feature] Fix AppVeyor Fails (#5520) --- .../Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index dc3bdce61ed..656d0bec69f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -2740,22 +2740,22 @@ Describe "Validate Invoke-WebRequest and Invoke-RestMethod -InFile" -Tags "Featu Describe "Web cmdlets tests using the cmdlet's aliases" -Tags "CI" { BeforeAll { - $response = Start-HttpListener -Port 8082 + $response = Start-HttpListener -Port 8079 } AfterAll { - $null = Stop-HttpListener -Port 8082 + $null = Stop-HttpListener -Port 8079 $response.PowerShell.Dispose() } It "Execute Invoke-WebRequest" { - $result = iwr "http://localhost:8082/PowerShell?test=response&output=hello" -TimeoutSec 5 + $result = iwr "http://localhost:8079/PowerShell?test=response&output=hello" -TimeoutSec 5 $result.StatusCode | Should Be "200" $result.Content | Should Be "hello" } It "Execute Invoke-RestMethod" { - $result = irm "http://localhost:8082/PowerShell?test=response&output={%22hello%22:%22world%22}&contenttype=application/json" -TimeoutSec 5 + $result = irm "http://localhost:8079/PowerShell?test=response&output={%22hello%22:%22world%22}&contenttype=application/json" -TimeoutSec 5 $result.Hello | Should Be "world" } } From f82438477d8f11c9fdc3cc8aa3488f4ee8083ead Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 21 Nov 2017 13:51:10 -0800 Subject: [PATCH 06/18] Update target tag for master CI to 6.1.0-preview.1 (#5513) * use metadata JSON to create release tag in CI --- tools/appveyor.psm1 | 43 +++++++++++++++++++++++++++++++------------ tools/metadata.json | 3 ++- tools/travis.ps1 | 28 +++++++++++++++++++++------- 3 files changed, 54 insertions(+), 20 deletions(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 359f7c85079..a1401a1bb7e 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -168,19 +168,20 @@ function Invoke-AppVeyorFull # Implements the AppVeyor 'build_script' step function Invoke-AppVeyorBuild { - # check to be sure our test tags are correct - $result = Get-PesterTag - if ( $result.Result -ne "Pass" ) { + $releaseTag = Get-ReleaseTag + # check to be sure our test tags are correct + $result = Get-PesterTag + if ( $result.Result -ne "Pass" ) { $result.Warnings throw "Tags must be CI, Feature, Scenario, or Slow" - } + } - if(Test-DailyBuild) - { - Start-PSBuild -Configuration 'CodeCoverage' -PSModuleRestore - } + if(Test-DailyBuild) + { + Start-PSBuild -Configuration 'CodeCoverage' -PSModuleRestore -ReleaseTag $releaseTag + } - Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' + Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag } # Implements the AppVeyor 'install' step @@ -188,9 +189,10 @@ function Invoke-AppVeyorInstall { # Make sure we have all the tags Sync-PSTags -AddRemoteIfMissing + $releaseTag = Get-ReleaseTag if($env:APPVEYOR_BUILD_NUMBER) { - Update-AppveyorBuild -Version "$(Get-PSVersion -OmitCommitId)-$env:APPVEYOR_BUILD_NUMBER" + Update-AppveyorBuild -Version $releaseTag } if(Test-DailyBuild){ @@ -420,14 +422,31 @@ function Get-PackageName return $name } +function Get-ReleaseTag +{ + $metaDataPath = Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json' + $metaData = Get-Content $metaDataPath | ConvertFrom-Json + + $releaseTag = $metadata.NextReleaseTag + if($env:APPVEYOR_BUILD_NUMBER) + { + $releaseTag = $releaseTag.split('.')[0..2] -join '.' + $releaseTag = $releaseTag+'.'+$env:APPVEYOR_BUILD_NUMBER + } + + return $releaseTag +} + # Implements AppVeyor 'on_finish' step function Invoke-AppveyorFinish { try { + $releaseTag = Get-ReleaseTag + $packageParams = @{} if($env:APPVEYOR_BUILD_VERSION) { - $packageParams += @{Version=$env:APPVEYOR_BUILD_VERSION} + $packageParams += @{ReleaseTag=$releaseTag} } # Build packages @@ -454,7 +473,7 @@ function Invoke-AppveyorFinish } else { - $previewVersion = (git describe --abbrev=0).Split('-') + $previewVersion = $releaseTag.Split('-') $previewPrefix = $previewVersion[0] $previewLabel = $previewVersion[1].replace('.','') diff --git a/tools/metadata.json b/tools/metadata.json index a7f64d48e93..776d5ca3b24 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,3 +1,4 @@ { - "ReleaseTag": "v6.0.0-beta.9" + "ReleaseTag": "v6.0.0-rc", + "NextReleaseTag": "v6.1.0-preview.1" } diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 79cdb304919..670b012693d 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -44,6 +44,21 @@ OS Type: $($PSVersionTable.OS)
} } +function Get-ReleaseTag +{ + $metaDataPath = Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json' + $metaData = Get-Content $metaDataPath | ConvertFrom-Json + + $releaseTag = $metadata.NextReleaseTag + if($env:TRAVIS_BUILD_NUMBER) + { + $releaseTag = $releaseTag.split('.')[0..2] -join '.' + $releaseTag = $releaseTag+'.'+$env:TRAVIS_BUILD_NUMBER + } + + return $releaseTag +} + # This function retrieves the appropriate svg to be used when presenting # the daily test run badge # the location in azure is public readonly @@ -171,7 +186,8 @@ if($Stage -eq 'Bootstrap') } elseif($Stage -eq 'Build') { - $BaseVersion = (Get-PSVersion -OmitCommitId) + '-' + $releaseTag = Get-ReleaseTag + Write-Host -Foreground Green "Executing travis.ps1 `$isPR='$isPr' `$isFullBuild='$isFullBuild' - $commitMessage" $output = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions)) @@ -179,7 +195,7 @@ elseif($Stage -eq 'Build') $ProgressPreference = 'SilentlyContinue' try { ## We use CrossGen build to run tests only if it's the daily build. - Start-PSBuild -CrossGen -PSModuleRestore + Start-PSBuild -CrossGen -PSModuleRestore -ReleaseTag $releaseTag } finally{ $ProgressPreference = $originalProgressPreference @@ -235,12 +251,10 @@ elseif($Stage -eq 'Build') } if ($createPackages) { + $packageParams = @{} - if($env:TRAVIS_BUILD_NUMBER) - { - $version = $BaseVersion + $env:TRAVIS_BUILD_NUMBER - $packageParams += @{Version=$version} - } + $packageParams += @{ReleaseTag=$releaseTag} + # Only build packages for branches, not pull requests $packages = @(Start-PSPackage @packageParams -SkipReleaseChecks) # Packaging AppImage depends on the deb package From ea86a7d3ae5dfb95f9683c34f2d7f7e3af11d61e Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 21 Nov 2017 13:52:10 -0800 Subject: [PATCH 07/18] Fix docker tests (#5508) * update expected version * update container list --- docker/tests/container.tests.ps1 | 16 ++++++++-------- docker/tests/containerTestCommon.psm1 | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/tests/container.tests.ps1 b/docker/tests/container.tests.ps1 index ea6a694bb74..591144b4a5f 100644 --- a/docker/tests/container.tests.ps1 +++ b/docker/tests/container.tests.ps1 @@ -14,7 +14,7 @@ Describe "Build Linux Containers" -Tags 'Build', 'Linux' { [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path @@ -33,7 +33,7 @@ Describe "Build Windows Containers" -Tags 'Build', 'Windows' { [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path @@ -62,19 +62,19 @@ Describe "Linux Containers run PowerShell" -Tags 'Behavior', 'Linux' { Remove-Item $testContext.resolvedXmlPath -ErrorAction SilentlyContinue Remove-Item $testContext.resolvedLogPath -ErrorAction SilentlyContinue } - + it "Get PSVersion table from $(Get-RepoName):" -TestCases $script:linuxContainerTests -Skip:$script:skipLinux { param( [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path ) - Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-beta' + Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-rc' } } @@ -87,18 +87,18 @@ Describe "Windows Containers run PowerShell" -Tags 'Behavior', 'Windows' { Remove-Item $testContext.resolvedXmlPath -ErrorAction SilentlyContinue Remove-Item $testContext.resolvedLogPath -ErrorAction SilentlyContinue } - + it "Get PSVersion table from $(Get-RepoName):" -TestCases $script:windowsContainerTests -skip:$script:skipWindows { param( [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path ) - Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-beta' + Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-rc' } } diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index b8669ad25d6..207187be2a6 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -65,7 +65,7 @@ function Invoke-Docker # Return a list of Linux Container Test Cases function Get-LinuxContainer { - foreach($os in 'amazonlinux','centos7','opensuse42.2','ubuntu14.04','ubuntu16.04') + foreach($os in 'centos7','ubuntu14.04','ubuntu16.04') { Write-Output @{ Name = $os From c74232c24eb8b756b992240bc468439a72595d4e Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 21 Nov 2017 16:20:25 -0800 Subject: [PATCH 08/18] Replace strlen with strnlen in native code (#5510) * fix expected vs actual for easier troubleshooting * replace strlen calls with strnlen --- src/libpsl-native/src/followsymlink.cpp | 2 +- src/libpsl-native/src/getfullyqualifiedname.cpp | 2 +- src/libpsl-native/test/test-createsymlink.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libpsl-native/src/followsymlink.cpp b/src/libpsl-native/src/followsymlink.cpp index 6f32d697d77..033160fae67 100644 --- a/src/libpsl-native/src/followsymlink.cpp +++ b/src/libpsl-native/src/followsymlink.cpp @@ -39,7 +39,7 @@ char* FollowSymLink(const char* fileName) if (realPath) { - return strndup(realPath, strlen(realPath) + 1); + return strndup(realPath, strnlen(realPath, PATH_MAX)); } // if the path wasn't resolved, use readlink diff --git a/src/libpsl-native/src/getfullyqualifiedname.cpp b/src/libpsl-native/src/getfullyqualifiedname.cpp index 75e5af4b367..12a3483ed7c 100644 --- a/src/libpsl-native/src/getfullyqualifiedname.cpp +++ b/src/libpsl-native/src/getfullyqualifiedname.cpp @@ -43,7 +43,7 @@ char *GetFullyQualifiedName() } // return the first canonical name in the list - fullName = strndup(info->ai_canonname, strlen(info->ai_canonname)); + fullName = strndup(info->ai_canonname, strnlen(info->ai_canonname, NI_MAXHOST)); // only free info if getaddrinfo was successful freeaddrinfo(info); diff --git a/src/libpsl-native/test/test-createsymlink.cpp b/src/libpsl-native/test/test-createsymlink.cpp index 9bd96f346f3..42f186b2951 100644 --- a/src/libpsl-native/test/test-createsymlink.cpp +++ b/src/libpsl-native/test/test-createsymlink.cpp @@ -92,7 +92,7 @@ TEST_F(CreateSymLinkTest, SymLinkToFile) std::string target = FollowSymLink(fileSymLink.c_str()); char buffer[PATH_MAX]; std::string expected = realpath(file, buffer); - EXPECT_EQ(target, expected); + EXPECT_EQ(expected, target); } TEST_F(CreateSymLinkTest, SymLinkToDirectory) @@ -103,7 +103,7 @@ TEST_F(CreateSymLinkTest, SymLinkToDirectory) std::string target = FollowSymLink(dirSymLink.c_str()); char buffer[PATH_MAX]; std::string expected = realpath(dir, buffer); - EXPECT_EQ(target, expected); + EXPECT_EQ(expected, target); } TEST_F(CreateSymLinkTest, SymLinkAgain) From ef859b18ea7b12bcc4884b7528fdfa60aa468acf Mon Sep 17 00:00:00 2001 From: kvprasoon Date: Thu, 23 Nov 2017 00:04:02 +0530 Subject: [PATCH 09/18] Revert "Change synopsis of install-powershell.ps1 to reflect that it works cross-platform (#5465)" This reverts commit 59a78d54cc98235ab9417807d50da51b83a87cb2. --- tools/install-powershell.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index d614d512d6e..8a69fb7e654 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -1,6 +1,6 @@ <# .Synopsis - Install PowerShell Core on Windows, Linux or macOS. + Install PowerShell Core on Windows. .DESCRIPTION By default, the latest PowerShell Core release package will be installed. If '-Daily' is specified, then the latest PowerShell Core daily package will be installed. From 95ad1bff5dd8c678e0931b75be5efb8098947b15 Mon Sep 17 00:00:00 2001 From: kvprasoon Date: Thu, 23 Nov 2017 00:04:05 +0530 Subject: [PATCH 10/18] Revert "Fix mac packaging (#5496)" This reverts commit 0aeec3c27fd4342423c8e994f6083f7e559334d5. --- tools/releaseBuild/macOS/PowerShellPackage.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/releaseBuild/macOS/PowerShellPackage.ps1 b/tools/releaseBuild/macOS/PowerShellPackage.ps1 index 2fdc90fed11..e4ee858361b 100644 --- a/tools/releaseBuild/macOS/PowerShellPackage.ps1 +++ b/tools/releaseBuild/macOS/PowerShellPackage.ps1 @@ -34,7 +34,6 @@ if ($ReleaseTag) Push-Location try { Set-Location /PowerShell - git submodule update --init --recursive --quiet Import-Module "/PowerShell/build.psm1" Import-Module "/PowerShell/tools/packaging" From 74f43239d5e4d217034fa62cd340f6ae185874ae Mon Sep 17 00:00:00 2001 From: kvprasoon Date: Thu, 23 Nov 2017 00:04:07 +0530 Subject: [PATCH 11/18] Revert "Update target tag for master CI to 6.1.0-preview.1 (#5513)" This reverts commit f82438477d8f11c9fdc3cc8aa3488f4ee8083ead. --- tools/appveyor.psm1 | 43 ++++++++++++------------------------------- tools/metadata.json | 3 +-- tools/travis.ps1 | 28 +++++++--------------------- 3 files changed, 20 insertions(+), 54 deletions(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index a1401a1bb7e..359f7c85079 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -168,20 +168,19 @@ function Invoke-AppVeyorFull # Implements the AppVeyor 'build_script' step function Invoke-AppVeyorBuild { - $releaseTag = Get-ReleaseTag - # check to be sure our test tags are correct - $result = Get-PesterTag - if ( $result.Result -ne "Pass" ) { + # check to be sure our test tags are correct + $result = Get-PesterTag + if ( $result.Result -ne "Pass" ) { $result.Warnings throw "Tags must be CI, Feature, Scenario, or Slow" - } + } - if(Test-DailyBuild) - { - Start-PSBuild -Configuration 'CodeCoverage' -PSModuleRestore -ReleaseTag $releaseTag - } + if(Test-DailyBuild) + { + Start-PSBuild -Configuration 'CodeCoverage' -PSModuleRestore + } - Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag + Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' } # Implements the AppVeyor 'install' step @@ -189,10 +188,9 @@ function Invoke-AppVeyorInstall { # Make sure we have all the tags Sync-PSTags -AddRemoteIfMissing - $releaseTag = Get-ReleaseTag if($env:APPVEYOR_BUILD_NUMBER) { - Update-AppveyorBuild -Version $releaseTag + Update-AppveyorBuild -Version "$(Get-PSVersion -OmitCommitId)-$env:APPVEYOR_BUILD_NUMBER" } if(Test-DailyBuild){ @@ -422,31 +420,14 @@ function Get-PackageName return $name } -function Get-ReleaseTag -{ - $metaDataPath = Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json' - $metaData = Get-Content $metaDataPath | ConvertFrom-Json - - $releaseTag = $metadata.NextReleaseTag - if($env:APPVEYOR_BUILD_NUMBER) - { - $releaseTag = $releaseTag.split('.')[0..2] -join '.' - $releaseTag = $releaseTag+'.'+$env:APPVEYOR_BUILD_NUMBER - } - - return $releaseTag -} - # Implements AppVeyor 'on_finish' step function Invoke-AppveyorFinish { try { - $releaseTag = Get-ReleaseTag - $packageParams = @{} if($env:APPVEYOR_BUILD_VERSION) { - $packageParams += @{ReleaseTag=$releaseTag} + $packageParams += @{Version=$env:APPVEYOR_BUILD_VERSION} } # Build packages @@ -473,7 +454,7 @@ function Invoke-AppveyorFinish } else { - $previewVersion = $releaseTag.Split('-') + $previewVersion = (git describe --abbrev=0).Split('-') $previewPrefix = $previewVersion[0] $previewLabel = $previewVersion[1].replace('.','') diff --git a/tools/metadata.json b/tools/metadata.json index 776d5ca3b24..a7f64d48e93 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,4 +1,3 @@ { - "ReleaseTag": "v6.0.0-rc", - "NextReleaseTag": "v6.1.0-preview.1" + "ReleaseTag": "v6.0.0-beta.9" } diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 670b012693d..79cdb304919 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -44,21 +44,6 @@ OS Type: $($PSVersionTable.OS)
} } -function Get-ReleaseTag -{ - $metaDataPath = Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json' - $metaData = Get-Content $metaDataPath | ConvertFrom-Json - - $releaseTag = $metadata.NextReleaseTag - if($env:TRAVIS_BUILD_NUMBER) - { - $releaseTag = $releaseTag.split('.')[0..2] -join '.' - $releaseTag = $releaseTag+'.'+$env:TRAVIS_BUILD_NUMBER - } - - return $releaseTag -} - # This function retrieves the appropriate svg to be used when presenting # the daily test run badge # the location in azure is public readonly @@ -186,8 +171,7 @@ if($Stage -eq 'Bootstrap') } elseif($Stage -eq 'Build') { - $releaseTag = Get-ReleaseTag - + $BaseVersion = (Get-PSVersion -OmitCommitId) + '-' Write-Host -Foreground Green "Executing travis.ps1 `$isPR='$isPr' `$isFullBuild='$isFullBuild' - $commitMessage" $output = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions)) @@ -195,7 +179,7 @@ elseif($Stage -eq 'Build') $ProgressPreference = 'SilentlyContinue' try { ## We use CrossGen build to run tests only if it's the daily build. - Start-PSBuild -CrossGen -PSModuleRestore -ReleaseTag $releaseTag + Start-PSBuild -CrossGen -PSModuleRestore } finally{ $ProgressPreference = $originalProgressPreference @@ -251,10 +235,12 @@ elseif($Stage -eq 'Build') } if ($createPackages) { - $packageParams = @{} - $packageParams += @{ReleaseTag=$releaseTag} - + if($env:TRAVIS_BUILD_NUMBER) + { + $version = $BaseVersion + $env:TRAVIS_BUILD_NUMBER + $packageParams += @{Version=$version} + } # Only build packages for branches, not pull requests $packages = @(Start-PSPackage @packageParams -SkipReleaseChecks) # Packaging AppImage depends on the deb package From e10e45adca46a9b7d50096b8b6889d3ec88339f1 Mon Sep 17 00:00:00 2001 From: kvprasoon Date: Thu, 23 Nov 2017 00:04:10 +0530 Subject: [PATCH 12/18] Revert "Fix docker tests (#5508)" This reverts commit ea86a7d3ae5dfb95f9683c34f2d7f7e3af11d61e. --- docker/tests/container.tests.ps1 | 16 ++++++++-------- docker/tests/containerTestCommon.psm1 | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/tests/container.tests.ps1 b/docker/tests/container.tests.ps1 index 591144b4a5f..ea6a694bb74 100644 --- a/docker/tests/container.tests.ps1 +++ b/docker/tests/container.tests.ps1 @@ -14,7 +14,7 @@ Describe "Build Linux Containers" -Tags 'Build', 'Linux' { [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path @@ -33,7 +33,7 @@ Describe "Build Windows Containers" -Tags 'Build', 'Windows' { [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path @@ -62,19 +62,19 @@ Describe "Linux Containers run PowerShell" -Tags 'Behavior', 'Linux' { Remove-Item $testContext.resolvedXmlPath -ErrorAction SilentlyContinue Remove-Item $testContext.resolvedLogPath -ErrorAction SilentlyContinue } - + it "Get PSVersion table from $(Get-RepoName):" -TestCases $script:linuxContainerTests -Skip:$script:skipLinux { param( [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path ) - Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-rc' + Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-beta' } } @@ -87,18 +87,18 @@ Describe "Windows Containers run PowerShell" -Tags 'Behavior', 'Windows' { Remove-Item $testContext.resolvedXmlPath -ErrorAction SilentlyContinue Remove-Item $testContext.resolvedLogPath -ErrorAction SilentlyContinue } - + it "Get PSVersion table from $(Get-RepoName):" -TestCases $script:windowsContainerTests -skip:$script:skipWindows { param( [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path ) - Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-rc' + Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-beta' } } diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index 207187be2a6..b8669ad25d6 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -65,7 +65,7 @@ function Invoke-Docker # Return a list of Linux Container Test Cases function Get-LinuxContainer { - foreach($os in 'centos7','ubuntu14.04','ubuntu16.04') + foreach($os in 'amazonlinux','centos7','opensuse42.2','ubuntu14.04','ubuntu16.04') { Write-Output @{ Name = $os From 9bc49618f93c2dfd329b4cc885ad6afee0e8bb81 Mon Sep 17 00:00:00 2001 From: bergmeister Date: Mon, 20 Nov 2017 20:28:17 +0000 Subject: [PATCH 13/18] Change synopsis of install-powershell.ps1 to reflect that it works cross-platform (#5465) --- tools/install-powershell.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index 8a69fb7e654..d614d512d6e 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -1,6 +1,6 @@ <# .Synopsis - Install PowerShell Core on Windows. + Install PowerShell Core on Windows, Linux or macOS. .DESCRIPTION By default, the latest PowerShell Core release package will be installed. If '-Daily' is specified, then the latest PowerShell Core daily package will be installed. From c261bba9a91f25e2f09f2dde4bc4a5572674769d Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 17 Nov 2017 17:26:00 -0800 Subject: [PATCH 14/18] Fix mac packaging (#5496) --- tools/releaseBuild/macOS/PowerShellPackage.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/releaseBuild/macOS/PowerShellPackage.ps1 b/tools/releaseBuild/macOS/PowerShellPackage.ps1 index e4ee858361b..2fdc90fed11 100644 --- a/tools/releaseBuild/macOS/PowerShellPackage.ps1 +++ b/tools/releaseBuild/macOS/PowerShellPackage.ps1 @@ -34,6 +34,7 @@ if ($ReleaseTag) Push-Location try { Set-Location /PowerShell + git submodule update --init --recursive --quiet Import-Module "/PowerShell/build.psm1" Import-Module "/PowerShell/tools/packaging" From 6861c318e0b059f957fb2a116ab5649eb7b1eb7f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 21 Nov 2017 13:51:10 -0800 Subject: [PATCH 15/18] Update target tag for master CI to 6.1.0-preview.1 (#5513) * use metadata JSON to create release tag in CI --- tools/appveyor.psm1 | 43 +++++++++++++++++++++++++++++++------------ tools/metadata.json | 3 ++- tools/travis.ps1 | 28 +++++++++++++++++++++------- 3 files changed, 54 insertions(+), 20 deletions(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 359f7c85079..a1401a1bb7e 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -168,19 +168,20 @@ function Invoke-AppVeyorFull # Implements the AppVeyor 'build_script' step function Invoke-AppVeyorBuild { - # check to be sure our test tags are correct - $result = Get-PesterTag - if ( $result.Result -ne "Pass" ) { + $releaseTag = Get-ReleaseTag + # check to be sure our test tags are correct + $result = Get-PesterTag + if ( $result.Result -ne "Pass" ) { $result.Warnings throw "Tags must be CI, Feature, Scenario, or Slow" - } + } - if(Test-DailyBuild) - { - Start-PSBuild -Configuration 'CodeCoverage' -PSModuleRestore - } + if(Test-DailyBuild) + { + Start-PSBuild -Configuration 'CodeCoverage' -PSModuleRestore -ReleaseTag $releaseTag + } - Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' + Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag } # Implements the AppVeyor 'install' step @@ -188,9 +189,10 @@ function Invoke-AppVeyorInstall { # Make sure we have all the tags Sync-PSTags -AddRemoteIfMissing + $releaseTag = Get-ReleaseTag if($env:APPVEYOR_BUILD_NUMBER) { - Update-AppveyorBuild -Version "$(Get-PSVersion -OmitCommitId)-$env:APPVEYOR_BUILD_NUMBER" + Update-AppveyorBuild -Version $releaseTag } if(Test-DailyBuild){ @@ -420,14 +422,31 @@ function Get-PackageName return $name } +function Get-ReleaseTag +{ + $metaDataPath = Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json' + $metaData = Get-Content $metaDataPath | ConvertFrom-Json + + $releaseTag = $metadata.NextReleaseTag + if($env:APPVEYOR_BUILD_NUMBER) + { + $releaseTag = $releaseTag.split('.')[0..2] -join '.' + $releaseTag = $releaseTag+'.'+$env:APPVEYOR_BUILD_NUMBER + } + + return $releaseTag +} + # Implements AppVeyor 'on_finish' step function Invoke-AppveyorFinish { try { + $releaseTag = Get-ReleaseTag + $packageParams = @{} if($env:APPVEYOR_BUILD_VERSION) { - $packageParams += @{Version=$env:APPVEYOR_BUILD_VERSION} + $packageParams += @{ReleaseTag=$releaseTag} } # Build packages @@ -454,7 +473,7 @@ function Invoke-AppveyorFinish } else { - $previewVersion = (git describe --abbrev=0).Split('-') + $previewVersion = $releaseTag.Split('-') $previewPrefix = $previewVersion[0] $previewLabel = $previewVersion[1].replace('.','') diff --git a/tools/metadata.json b/tools/metadata.json index a7f64d48e93..776d5ca3b24 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,3 +1,4 @@ { - "ReleaseTag": "v6.0.0-beta.9" + "ReleaseTag": "v6.0.0-rc", + "NextReleaseTag": "v6.1.0-preview.1" } diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 79cdb304919..670b012693d 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -44,6 +44,21 @@ OS Type: $($PSVersionTable.OS)
} } +function Get-ReleaseTag +{ + $metaDataPath = Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json' + $metaData = Get-Content $metaDataPath | ConvertFrom-Json + + $releaseTag = $metadata.NextReleaseTag + if($env:TRAVIS_BUILD_NUMBER) + { + $releaseTag = $releaseTag.split('.')[0..2] -join '.' + $releaseTag = $releaseTag+'.'+$env:TRAVIS_BUILD_NUMBER + } + + return $releaseTag +} + # This function retrieves the appropriate svg to be used when presenting # the daily test run badge # the location in azure is public readonly @@ -171,7 +186,8 @@ if($Stage -eq 'Bootstrap') } elseif($Stage -eq 'Build') { - $BaseVersion = (Get-PSVersion -OmitCommitId) + '-' + $releaseTag = Get-ReleaseTag + Write-Host -Foreground Green "Executing travis.ps1 `$isPR='$isPr' `$isFullBuild='$isFullBuild' - $commitMessage" $output = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions)) @@ -179,7 +195,7 @@ elseif($Stage -eq 'Build') $ProgressPreference = 'SilentlyContinue' try { ## We use CrossGen build to run tests only if it's the daily build. - Start-PSBuild -CrossGen -PSModuleRestore + Start-PSBuild -CrossGen -PSModuleRestore -ReleaseTag $releaseTag } finally{ $ProgressPreference = $originalProgressPreference @@ -235,12 +251,10 @@ elseif($Stage -eq 'Build') } if ($createPackages) { + $packageParams = @{} - if($env:TRAVIS_BUILD_NUMBER) - { - $version = $BaseVersion + $env:TRAVIS_BUILD_NUMBER - $packageParams += @{Version=$version} - } + $packageParams += @{ReleaseTag=$releaseTag} + # Only build packages for branches, not pull requests $packages = @(Start-PSPackage @packageParams -SkipReleaseChecks) # Packaging AppImage depends on the deb package From cf384acda88b7678a5bf775fb88521b2d768ea43 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 21 Nov 2017 13:52:10 -0800 Subject: [PATCH 16/18] Fix docker tests (#5508) * update expected version * update container list --- docker/tests/container.tests.ps1 | 16 ++++++++-------- docker/tests/containerTestCommon.psm1 | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/tests/container.tests.ps1 b/docker/tests/container.tests.ps1 index ea6a694bb74..591144b4a5f 100644 --- a/docker/tests/container.tests.ps1 +++ b/docker/tests/container.tests.ps1 @@ -14,7 +14,7 @@ Describe "Build Linux Containers" -Tags 'Build', 'Linux' { [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path @@ -33,7 +33,7 @@ Describe "Build Windows Containers" -Tags 'Build', 'Windows' { [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path @@ -62,19 +62,19 @@ Describe "Linux Containers run PowerShell" -Tags 'Behavior', 'Linux' { Remove-Item $testContext.resolvedXmlPath -ErrorAction SilentlyContinue Remove-Item $testContext.resolvedLogPath -ErrorAction SilentlyContinue } - + it "Get PSVersion table from $(Get-RepoName):" -TestCases $script:linuxContainerTests -Skip:$script:skipLinux { param( [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path ) - Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-beta' + Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-rc' } } @@ -87,18 +87,18 @@ Describe "Windows Containers run PowerShell" -Tags 'Behavior', 'Windows' { Remove-Item $testContext.resolvedXmlPath -ErrorAction SilentlyContinue Remove-Item $testContext.resolvedLogPath -ErrorAction SilentlyContinue } - + it "Get PSVersion table from $(Get-RepoName):" -TestCases $script:windowsContainerTests -skip:$script:skipWindows { param( [Parameter(Mandatory=$true)] [string] $name, - + [Parameter(Mandatory=$true)] [string] $path ) - Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-beta' + Get-ContainerPowerShellVersion -TestContext $testContext -Name $Name -RepoName (Get-RepoName) | should be '6.0.0-rc' } } diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index b8669ad25d6..207187be2a6 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -65,7 +65,7 @@ function Invoke-Docker # Return a list of Linux Container Test Cases function Get-LinuxContainer { - foreach($os in 'amazonlinux','centos7','opensuse42.2','ubuntu14.04','ubuntu16.04') + foreach($os in 'centos7','ubuntu14.04','ubuntu16.04') { Write-Output @{ Name = $os From 2deb06e122481791aa2b4f3420c629687dcff780 Mon Sep 17 00:00:00 2001 From: Mark Kraus Date: Wed, 22 Nov 2017 03:34:05 -0600 Subject: [PATCH 17/18] Fix Import-CliXml Tests (#5521) Add checks that ProcessName is not null or empty. --- .../Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 index c53bced0227..1ddc40d5c2f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 @@ -125,7 +125,7 @@ Context "Import-CliXML" { BeforeAll { - $gpsList = Get-Process powershell + $gpsList = Get-Process pwsh $gps = $gpsList | Select-Object -First 1 $filePath = Join-Path $subFilePath 'gps.xml' @@ -161,7 +161,9 @@ $fileContent | Should Not Be $null $importedProcess = Import-Clixml $filePath + $importedProcess.ProcessName | Should Not BeNullOrEmpty $gps.ProcessName | Should Be $importedProcess.ProcessName + $importedProcess.Id | Should Not BeNullOrEmpty $gps.Id | Should Be $importedProcess.Id } @@ -173,7 +175,9 @@ $fileContent | Should Not Be $null $importedProcess = Import-Clixml $filePath + $importedProcess.ProcessName | Should Not BeNullOrEmpty $gps.ProcessName | Should Be $importedProcess.ProcessName + $importedProcess.Id | Should Not BeNullOrEmpty $gps.Id | Should Be $importedProcess.Id } From 5cac3145fb06edc9e808c409ff9db4ba4a45b47c Mon Sep 17 00:00:00 2001 From: bergmeister Date: Wed, 22 Nov 2017 10:14:32 +0000 Subject: [PATCH 18/18] Disambiguate icon for daily builds on Windows (#5467) * Disambiguate icon for daily builds on Windows. Some code had to be borrowed from build.psm1 because this script has to be self contained in case it gets executed by only downloading this file via the published download link https://twitter.com/Steve_MSFT/status/930585082451992576 --- tools/install-powershell.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index d614d512d6e..fac01dc1c48 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -156,6 +156,19 @@ try { Move-Item -Path $contentPath -Destination $Destination } + # Edit icon to disambiguate daily builds. + if ($IsWinEnv -and $Daily.IsPresent) { + if (-not (Test-Path "~/.rcedit/rcedit-x64.exe")) { + Write-Verbose "Install RCEdit for modifying exe resources" -Verbose + $rceditUrl = "https://github.com/electron/rcedit/releases/download/v1.0.0/rcedit-x64.exe" + New-Item -Path "~/.rcedit" -Type Directory -Force > $null + Invoke-WebRequest -OutFile "~/.rcedit/rcedit-x64.exe" -Uri $rceditUrl + } + + Write-Verbose "Change icon to disambiguate it from a released installation" -Verbose + & "~/.rcedit/rcedit-x64.exe" "$Destination\pwsh.exe" --set-icon "$Destination\assets\Powershell_av_colors.ico" + } + ## Change the mode of 'pwsh' to 'rwxr-xr-x' to allow execution if (-not $IsWinEnv) { chmod 755 $Destination/pwsh }