Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,6 @@ Additional references:
please reference the issue in PR description (e.g. ```Fix #11```).
See [this][closing-via-message] for more details.

#### Pull request - Change log

* All PRs must update the [changelog](../CHANGELOG.MD) in your pull request.
New changes always go into the **Unreleased** section at the top of the changelog.
Keeping the changelog up-to-date simplifies the release process for Maintainers.
An example (with an associated PR #):

```markdown
## Unreleased

* `Update-Item` now supports `-FriendlyName` (#1234, @ExampleUser).
```
Note: Please add `**Breaking Change**` to the front of the entry in the changelog if the change is [breaking.](#making-breaking-changes)

* Please use the present tense and imperative mood when describing your changes:
* Instead of "Adding support for Windows Server 2012 R2", write "Add support for Windows Server 2012 R2".
* Instead of "Fixed for server connection issue", write "Fix server connection issue".
Expand Down
9 changes: 5 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
## PR Summary
<!-- summarize your PR between here and the checklist -->

## PR Checklist

Note: Please mark anything not applicable to this PR `NA`.

- [ ] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [ ] Use the present tense and imperative mood when describing your changes
- [ ] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [ ] [Update the changelog](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---changelog)
- [ ] User facing [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [ ] Issue filed - Issue link:
- [ ] [Change is not breaking](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)
- [ ] [Make sure you've added a new test, if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
- [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
- [ ] [Add `[feature]` if the change is significant or affectes feature tests](https://github.com/PowerShell/PowerShell/blob/master/docs/testing-guidelines/testing-guidelines.md#requesting-additional-tests-for-a-pr)

## PR Summary
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ install:
rvm install ruby-2.3.3;
rvm --default use 2.3.3;
fi
# Ensure that libcurl+openssl is used on macOS for greater feature support.
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export DYLD_LIBRARY_PATH=/usr/local/opt/curl/lib:/usr/local/opt/openssl/lib:${DYLD_LIBRARY_PATH};
fi
- pushd tools
- ./install-powershell.sh
- popd
Expand All @@ -39,9 +43,9 @@ install:
script:
- pwsh -File tools/travis.ps1
# spellcheck
# Ignore publish folders because they have 3rd party files
# Ignore 'Pester' folder because it's third party
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
mdspell '**/*.md' '!**/publish/**/*.md' --ignore-numbers --ignore-acronyms --report;
mdspell '**/*.md' '!**/Pester/**/*.md' --ignore-numbers --ignore-acronyms --report;
fi

after_failure:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Update the contribution guideline to note that updating the changelog is required. (#5586)
- Remove Pester as a module include with the PowerShell Packages.
In the future, you should be able to add it by running `Install-Module Pester`. (#5623, #5631)
- Make Travis CI use `libcurl+openssl+gssapi` (#5629, @markekraus)

## v6.0.0-rc - 2017-11-16

Expand Down
2 changes: 1 addition & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ function Start-PSBootstrap {
Start-NativeExecution { brew install $Deps } -IgnoreExitcode

# Install patched version of curl
Start-NativeExecution { brew install curl --with-openssl } -IgnoreExitcode
Start-NativeExecution { brew install curl --with-openssl --with-gssapi } -IgnoreExitcode
}

# Install [fpm](https://github.com/jordansissel/fpm) and [ronn](https://github.com/rtomayko/ronn)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,13 +769,10 @@ private static string RemoveSxSPsHomeModulePath(string currentProcessModulePath,
{
#if UNIX
const string powershellExeName = "pwsh";
const string oldPowershellExeName = "powershell";
#else
const string powershellExeName = "pwsh.exe";
const string oldPowershellExeName = "powershell.exe";
#endif
const string powershellDepsName = "pwsh.deps.json";
const string oldPowershellDepsName = "powershell.deps.json";

StringBuilder modulePathString = new StringBuilder(currentProcessModulePath.Length);
char[] invalidPathChars = Path.GetInvalidPathChars();
Expand All @@ -796,10 +793,8 @@ private static string RemoveSxSPsHomeModulePath(string currentProcessModulePath,
{
string parentDir = Path.GetDirectoryName(trimedPath);
string psExePath = Path.Combine(parentDir, powershellExeName);
string oldExePath = Path.Combine(parentDir, oldPowershellExeName);
string psDepsPath = Path.Combine(parentDir, powershellDepsName);
string oldDepsPath = Path.Combine(parentDir, oldPowershellDepsName);
if ((File.Exists(psExePath) && File.Exists(psDepsPath)) || (File.Exists(oldExePath) && File.Exists(oldDepsPath)))
if ((File.Exists(psExePath) && File.Exists(psDepsPath)))
{
// Path is a PSHome module path from a different powershell core instance. Ignore it.
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1412,9 +1412,8 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" {
$testCases1 = @(
@{ Test = @{SslProtocol = 'Default'; ActualProtocol = 'Default'}; Pending = $false }
@{ Test = @{SslProtocol = 'Tls'; ActualProtocol = 'Tls'}; Pending = $false }
# these two currently fail on Travis CI macOS build
@{ Test = @{SslProtocol = 'Tls11'; ActualProtocol = 'Tls11'}; Pending = $IsMacOS }
@{ Test = @{SslProtocol = 'Tls12'; ActualProtocol = 'Tls12'}; Pending = $IsMacOS }
@{ Test = @{SslProtocol = 'Tls11'; ActualProtocol = 'Tls11'}; Pending = $false }
@{ Test = @{SslProtocol = 'Tls12'; ActualProtocol = 'Tls12'}; Pending = $false }
# macOS does not support multiple SslProtocols
@{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls12'}; Pending = $IsMacOS }
@{ Test = @{SslProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls12'}; Pending = $IsMacOS }
Expand All @@ -1433,9 +1432,8 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" {
@{ Test = @{IntendedProtocol = 'Tls'; ActualProtocol = 'Tls11'}; Pending = $false }
@{ Test = @{IntendedProtocol = 'Tls11'; ActualProtocol = 'Tls12'}; Pending = $false }
@{ Test = @{IntendedProtocol = 'Tls12'; ActualProtocol = 'Tls11'}; Pending = $false }
# these two currently fail on Travis CI macOS build
@{ Test = @{IntendedProtocol = 'Tls11'; ActualProtocol = 'Tls'}; Pending = $IsMacOS }
@{ Test = @{IntendedProtocol = 'Tls12'; ActualProtocol = 'Tls'}; Pending = $IsMacOS }
@{ Test = @{IntendedProtocol = 'Tls11'; ActualProtocol = 'Tls'}; Pending = $false }
@{ Test = @{IntendedProtocol = 'Tls12'; ActualProtocol = 'Tls'}; Pending = $false }
# macOS does not support multiple SslProtocols
@{ Test = @{IntendedProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls'}; Pending = $IsMacOS }
@{ Test = @{IntendedProtocol = 'Tls, Tls12'; ActualProtocol = 'Tls11'}; Pending = $IsMacOS }
Expand Down Expand Up @@ -2382,9 +2380,8 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {
$testCases1 = @(
@{ Test = @{SslProtocol = 'Default'; ActualProtocol = 'Default'}; Pending = $false }
@{ Test = @{SslProtocol = 'Tls'; ActualProtocol = 'Tls'}; Pending = $false }
# these two currently fail on Travis CI macOS build
@{ Test = @{SslProtocol = 'Tls11'; ActualProtocol = 'Tls11'}; Pending = $IsMacOS }
@{ Test = @{SslProtocol = 'Tls12'; ActualProtocol = 'Tls12'}; Pending = $IsMacOS }
@{ Test = @{SslProtocol = 'Tls11'; ActualProtocol = 'Tls11'}; Pending = $false }
@{ Test = @{SslProtocol = 'Tls12'; ActualProtocol = 'Tls12'}; Pending = $false }
# macOS does not support multiple SslProtocols
@{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls12'}; Pending = $IsMacOS }
@{ Test = @{SslProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls12'}; Pending = $IsMacOS }
Expand All @@ -2403,9 +2400,8 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" {
@{ Test = @{IntendedProtocol = 'Tls'; ActualProtocol = 'Tls11'}; Pending = $false }
@{ Test = @{IntendedProtocol = 'Tls11'; ActualProtocol = 'Tls12'}; Pending = $false }
@{ Test = @{IntendedProtocol = 'Tls12'; ActualProtocol = 'Tls11'}; Pending = $false }
# these two currently fail on Travis CI macOS build
@{ Test = @{IntendedProtocol = 'Tls11'; ActualProtocol = 'Tls'}; Pending = $IsMacOS }
@{ Test = @{IntendedProtocol = 'Tls12'; ActualProtocol = 'Tls'}; Pending = $IsMacOS }
@{ Test = @{IntendedProtocol = 'Tls11'; ActualProtocol = 'Tls'}; Pending = $false }
@{ Test = @{IntendedProtocol = 'Tls12'; ActualProtocol = 'Tls'}; Pending = $false }
# macOS does not support multiple SslProtocols
@{ Test = @{IntendedProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls'}; Pending = $IsMacOS }
@{ Test = @{IntendedProtocol = 'Tls, Tls12'; ActualProtocol = 'Tls11'}; Pending = $IsMacOS }
Expand Down
12 changes: 9 additions & 3 deletions test/powershell/engine/Basic/ValidateAttributes.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,15 @@ Describe 'Validate Attributes Tests' -Tags 'CI' {
$byteList = [System.Collections.Generic.List[byte]] $byteArray
$byteCollection = [System.Collections.ObjectModel.Collection[byte]] $byteArray
## Use the running time of 'MandatoryFunc -Value $byteArray' as the baseline time
## because it does no check on the argument.
$baseline = (Measure-Command { MandatoryFunc -Value $byteArray }).Milliseconds
## Running time should be less than 'expected'
$expected = $baseline + 20
## Running time should be less than 'UpperBoundTime'
## This is not really a performance test (perf test cannot run reliably in our CI), but a test
## to make sure we don't check the elements of a value-type collection.
## The crossgen'ed 'S.M.A.dll' is about 28mb in size, and it would take more than 2000ms if we
## check each byte of the array, list or collection. We use ($baseline + 200)ms as the upper
## bound value in tests to prove that we don't check each byte.
$UpperBoundTime = $baseline + 200

if ($IsWindows) {
$null = New-Item -Path $TESTDRIVE/file1
Expand All @@ -340,7 +346,7 @@ Describe 'Validate Attributes Tests' -Tags 'CI' {

It "Validate running time '<ScriptBlock>'" -TestCases $testCases {
param ($ScriptBlock)
(Measure-Command $ScriptBlock).Milliseconds | Should BeLessThan $expected
(Measure-Command $ScriptBlock).Milliseconds | Should BeLessThan $UpperBoundTime
}

It "COM enumerable argument should work with 'ValidateNotNull' and 'ValidateNotNullOrEmpty'" -Skip:(!$IsWindows) {
Expand Down
20 changes: 8 additions & 12 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,6 @@ function Start-PSPackage {
# Copy file which go into symbols.zip
Get-ChildItem -Path $buildSource | Where-Object {$toExclude -inotcontains $_.Name} | Copy-Item -Destination $symbolsSource -Recurse

# Exclude Pester until we move it to PSModuleRestore
$pesterPath = Join-Path -Path $symbolsSource -ChildPath 'Modules\Pester'
if(Test-Path -Path $pesterPath)
{
Remove-Item -Path $pesterPath -Recurse -Force -ErrorAction SilentlyContinue
}

# Zip symbols.zip to the root package
$zipSource = Join-Path $symbolsSource -ChildPath '*'
$zipPath = Join-Path -Path $Source -ChildPath 'symbols.zip'
Expand Down Expand Up @@ -426,6 +419,7 @@ function New-TempFolder

return $tempFolder
}

function New-PSSignedBuildZip
{
param(
Expand All @@ -441,17 +435,17 @@ function New-PSSignedBuildZip

# Replace unsigned binaries with signed
$signedFilesFilter = Join-Path -Path $signedFilesPath -ChildPath '*'
Get-ChildItem -path $signedFilesFilter -Recurse | Select-Object -ExpandProperty FullName | Foreach-Object -Process {
Get-ChildItem -path $signedFilesFilter -Recurse -File | Select-Object -ExpandProperty FullName | Foreach-Object -Process {
$relativePath = $_.Replace($signedFilesPath,'')
$destination = Join-Path -Path $buildPath -ChildPath $relativePath
log "replacing $destination with $_"
Copy-Item -Path $_ -Destination $destination -force
}

# Remove `signed` folder in buildpath now that signed binaries are copied
if (Test-Path $BuildPath\signed)
# Remove '$signedFilesPath' now that signed binaries are copied
if (Test-Path $signedFilesPath)
{
Remove-Item -Recurse -Force -Path $BuildPath\signed
Remove-Item -Recurse -Force -Path $signedFilesPath
}

$name = split-path -Path $BuildPath -Leaf
Expand All @@ -477,10 +471,12 @@ function Expand-PSSignedBuild
)

$psModulePath = Split-Path -path $PSScriptRoot
# Expand unsigned build
# Expand signed build
$buildPath = Join-Path -path $psModulePath -childpath 'ExpandedBuild'
$null = New-Item -path $buildPath -itemtype Directory -force
Expand-Archive -path $BuildZip -destinationpath $buildPath -Force
# Remove the zip file that contains only those files from the parent folder of 'publish'.
# That zip file is used for compliance scan.
Remove-Item -Path (Join-Path -Path $buildPath -ChildPath '*.zip') -Recurse

$windowsExecutablePath = (Join-Path $buildPath -ChildPath 'pwsh.exe')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ param (
[string] $destination = "$env:WORKSPACE",

[ValidateSet("win7-x64", "win7-x86")]
[string]$Runtime = 'win10-x64',
[string]$Runtime = 'win7-x64',

[switch] $Wait,

Expand Down Expand Up @@ -80,8 +80,7 @@ try{
else
{
Write-Verbose "Starting powershell build for RID: $Runtime and ReleaseTag: $ReleaseTag ..." -verbose
$buildParams = @{}
$buildParams['CrossGen'] = $true
$buildParams = @{'CrossGen'=$true}
if(!$Symbols.IsPresent)
{
$buildParams['PSModuleRestore'] = $true
Expand All @@ -90,12 +89,7 @@ try{
Start-PSBuild -Clean -Runtime $Runtime -Configuration Release @releaseTagParam @buildParams
}

$pspackageParams = @{'Type'='msi'}
if ($Runtime -ne 'win10-x64')
{
$pspackageParams += @{'WindowsRuntime'=$Runtime}
}

$pspackageParams = @{'Type'='msi'; 'WindowsRuntime'=$Runtime}
if(!$Symbols.IsPresent)
{
Write-Verbose "Starting powershell packaging(msi)..." -verbose
Expand All @@ -112,8 +106,8 @@ try{

Write-Verbose "Exporting packages ..." -verbose

Get-ChildItem $location\*.msi,$location\*.zip | Select-Object -ExpandProperty FullName | ForEach-Object {
$file = $_
Get-ChildItem $location\*.msi,$location\*.zip | ForEach-Object {
$file = $_.FullName
Write-Verbose "Copying $file to $destination" -verbose
Copy-Item -Path $file -Destination "$destination\" -Force
}
Expand Down
12 changes: 6 additions & 6 deletions tools/releaseBuild/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\dockerInstall.psm1"
],
"DockerImageName": "ps-winsrvcore",
"BinaryBucket": "symbols",
"BinariesExpected": 1,
"BinaryBucket": "results",
"ArtifactsExpected": 1,
"VariableForExtractedBinariesPath": "Symbols_x64"
},
{
Expand All @@ -68,8 +68,8 @@
".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\dockerInstall.psm1"
],
"DockerImageName": "ps-winsrvcore",
"BinaryBucket": "symbols",
"BinariesExpected": 1,
"BinaryBucket": "results",
"ArtifactsExpected": 1,
"VariableForExtractedBinariesPath": "Symbols_x86"
},
{
Expand All @@ -88,7 +88,7 @@
],
"DockerImageName": "ps-winsrvcore",
"BinaryBucket": "signed",
"BinariesExpected": 2
"ArtifactsExpected": 2
},
{
"Name": "win7-x86-package",
Expand All @@ -106,7 +106,7 @@
],
"DockerImageName": "ps-winsrvcore",
"BinaryBucket": "signed",
"BinariesExpected": 2
"ArtifactsExpected": 2
}
],
"Linux": [
Expand Down
2 changes: 1 addition & 1 deletion tools/releaseBuild/updateSigning.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $signingXml.SignConfigXML.job | ForEach-Object -Process {
{
$newSignType = $signTypes[$signType]
Write-Host "Updating $($_.src) to $newSignType"
$_.signType = $signTypes[$signType]
$_.signType = $newSignType
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions tools/releaseBuild/vstsbuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ End {

# Use temp as destination if not running in VSTS
$destFolder = $env:temp
if($env:Build_ArtifactStagingDirectory)
if($env:BUILD_STAGINGDIRECTORY)
{
# Use artifact staging if running in VSTS
$destFolder = $env:Build_ArtifactStagingDirectory
$destFolder = $env:BUILD_STAGINGDIRECTORY
}

$BuildPackagePath = New-PSSignedBuildZip -BuildPath $BuildPath -SignedFilesPath $SignedFilesPath -DestinationFolder $destFolder
Expand Down Expand Up @@ -113,7 +113,7 @@ End {
BuildPackageName = $buildPackageName
}

Invoke-Build -RepoPath $resolvedRepoRoot -BuildJsonPath './tools/releaseBuild/build.json' -Name $Name -Parameters $buildParameters -AdditionalFiles $AdditionalFiles
Invoke-Build -RepoPath $resolvedRepoRoot -BuildJsonPath './tools/releaseBuild/build.json' -Name $Name -Parameters $buildParameters -AdditionalFiles $AdditionalFiles
}
catch
{
Expand Down