diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index 886f748..bfb3233 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -9,12 +9,12 @@ variables: resources: - repo: self clean: true -phases: -- phase: Build - - queue: - name: Hosted Ubuntu 1604 - parallel: 2 +jobs: +- job: Build + pool: + vmImage: ubuntu-latest + displayName: Linux + strategy: matrix: Linux ARM Native: buildName: ubuntu.16.04-arm diff --git a/.vsts-ci/windows.yml b/.vsts-ci/windows.yml index b5da8f4..1ccfab5 100644 --- a/.vsts-ci/windows.yml +++ b/.vsts-ci/windows.yml @@ -14,7 +14,9 @@ jobs: - job: Build pool: - vmImage: vs2017-win2016 + name: PS-PowerShell-x64 + demands: + - ImageOverride -equals PSMMS2019-PS-Native-Secure strategy: matrix: @@ -28,10 +30,6 @@ jobs: buildName: x64_arm64 steps: - - powershell: | - choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System' - displayName: Install cmake - condition: succeeded() - powershell: | $vsPath = ${Env:ProgramFiles(x86)} + '\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin' Write-Host "##vso[task.prependpath]$vsPath" diff --git a/build.psm1 b/build.psm1 index 3c759c8..d4f090b 100644 --- a/build.psm1 +++ b/build.psm1 @@ -464,7 +464,7 @@ function Start-BuildNativeUnixBinaries { } elseif ($IsMacOS) { Start-NativeExecution { cmake -DCMAKE_TOOLCHAIN_FILE="./macos.toolchain.cmake" . } - Start-NativeExecution { make -j } + Start-NativeExecution { make -j } Start-NativeExecution { ctest --verbose } } else { @@ -533,12 +533,7 @@ function Start-BuildPowerShellNativePackage [Parameter(Mandatory = $true)] [ValidateScript({Test-Path $_ -PathType Leaf})] - [string] $psrpZipPath, - - [Parameter(Mandatory = $true)] - [string] $NuGetOutputPath, - - [switch] $SkipCleanup = $false + [string] $psrpZipPath ) if(-not (Test-Path $PackageRoot)) @@ -605,24 +600,32 @@ function Start-BuildPowerShellNativePackage Copy-Item $iconPath (Join-Path $PackageRoot -ChildPath $iconFileName) -Verbose $Nuspec -f $Version, $iconFileName | Out-File -FilePath (Join-Path $PackageRoot -ChildPath 'Microsoft.PowerShell.Native.nuspec') -Force +} - if(-not (Test-Path $NuGetOutputPath)) - { - $null = New-Item $NuGetOutputPath -Force -Verbose -ItemType Directory - } +<# +.SYNOPSIS + Pack the new nuget package from af folder. +#> +function New-NugetPackage { + param ( + [Parameter(Mandatory)] + [string] $PackageRoot, + + [Parameter(Mandatory)] + [string] $NuGetOutputPath + ) try { + if (-not (Test-Path $NuGetOutputPath)) { + $null = New-Item $NuGetOutputPath -Force -Verbose -ItemType Directory + } + Push-Location $PackageRoot nuget.exe pack . -OutputDirectory $NuGetOutputPath } finally { Pop-Location } - - if(-not $SkipCleanup -and (Test-Path $tempExtractionPath)) - { - Remove-Item $tempExtractionPath -Recurse -Force -ErrorAction SilentlyContinue - } } <# @@ -2153,63 +2156,19 @@ function Start-PSBootstrap { $cmakePresent = precheck 'cmake' $null $sdkPresent = Test-Win10SDK - # Install chocolatey - $chocolateyPath = "$env:AllUsersProfile\chocolatey\bin" - - if(precheck 'choco' $null) { - Write-Log "Chocolatey is already installed. Skipping installation." - } - elseif(($cmakePresent -eq $false) -or ($sdkPresent -eq $false)) { - Write-Log "Chocolatey not present. Installing chocolatey." - if ($Force -or "Install chocolatey via https://chocolatey.org/install.ps1") { - Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) - if (-not ($machinePath.ToLower().Contains($chocolateyPath.ToLower()))) { - Write-Log "Adding $chocolateyPath to Path environment variable" - $env:Path += ";$chocolateyPath" - $newMachineEnvironmentPath += ";$chocolateyPath" - } else { - Write-Log "$chocolateyPath already present in Path environment variable" - } - } else { - Write-Error "Chocolatey is required to install missing dependencies. Please install it from https://chocolatey.org/ manually. Alternatively, install cmake and Windows 10 SDK." - return - } - } else { - Write-Log "Skipping installation of chocolatey, cause both cmake and Win 10 SDK are present." - } - # Install cmake - $cmakePath = "${env:ProgramFiles}\CMake\bin" - if($cmakePresent -and !($force.IsPresent)) { - Write-Log "Cmake is already installed. Skipping installation." + #$cmakePath = "${env:ProgramFiles}\CMake\bin" + if($cmakePresent) { + Write-Log "Cmake is already installed." } else { - Write-Log "Cmake not present or -Force used. Installing cmake." - Start-NativeExecution { choco install cmake -y --version 3.10.0 } - if (-not ($machinePath.ToLower().Contains($cmakePath.ToLower()))) { - Write-Log "Adding $cmakePath to Path environment variable" - $env:Path += ";$cmakePath" - $newMachineEnvironmentPath = "$cmakePath;$newMachineEnvironmentPath" - } else { - Write-Log "$cmakePath already present in Path environment variable" - } + throw "Cmake not present." } - # Install Windows 10 SDK - $packageName = "windows-sdk-10.0" - - if (-not $sdkPresent) { - Write-Log "Windows 10 SDK not present. Installing $packageName." - Start-NativeExecution { choco install windows-sdk-10.0 -y } - } else { - Write-Log "Windows 10 SDK present. Skipping installation." + if ($sdkPresent) { + Write-Log "Windows 10 SDK is already installed." } - - # Update path machine environment variable - if ($newMachineEnvironmentPath -ne $machinePath) { - Write-Log "Updating Path machine environment variable" - if ($Force -or $PSCmdlet.ShouldProcess("Update Path machine environment variable to $newMachineEnvironmentPath")) { - [Environment]::SetEnvironmentVariable('Path', $newMachineEnvironmentPath, 'MACHINE') - } + else { + throw "Windows 10 SDK not present." } } } diff --git a/src/PowerShell.Core.Instrumentation/PowerShell.Core.Instrumentation.man b/src/PowerShell.Core.Instrumentation/PowerShell.Core.Instrumentation.man index b1c239b..d879924 100644 --- a/src/PowerShell.Core.Instrumentation/PowerShell.Core.Instrumentation.man +++ b/src/PowerShell.Core.Instrumentation/PowerShell.Core.Instrumentation.man @@ -2184,6 +2184,18 @@ value="0x6017" version="1" /> +