From 0019148893baae3c930370202a4ab58200e01c92 Mon Sep 17 00:00:00 2001
From: Doug Bunting <6431421+dougbu@users.noreply.github.com>
Date: Sun, 29 Sep 2019 11:58:17 -0700
Subject: [PATCH 1/4] Update branding to 3.1.0-preview2
---
eng/Versions.props | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index 7540f5e7a2..bff22c3e00 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -9,7 +9,7 @@
3
1
0
- 1
+ 2
From aa84cd643cb7c162d01595d7a4b1a2221233d6b4 Mon Sep 17 00:00:00 2001
From: Doug Bunting <6431421+dougbu@users.noreply.github.com>
Date: Mon, 30 Sep 2019 12:47:42 -0700
Subject: [PATCH 2/4] Use a response file for GenAPI commands - work around
dotnet/arcade#4021
---
eng/targets/ReferenceAssembly.targets | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/eng/targets/ReferenceAssembly.targets b/eng/targets/ReferenceAssembly.targets
index f516f1b07a..765cc16932 100644
--- a/eng/targets/ReferenceAssembly.targets
+++ b/eng/targets/ReferenceAssembly.targets
@@ -61,15 +61,21 @@
+ <_GenApiFile>$([MSBuild]::NormalizePath('$(ArtifactsDir)', 'log', 'GenAPI.rsp'))
<_GenAPICommand Condition="'$(MSBuildRuntimeType)' == 'core'">"$(DotNetTool)" --roll-forward-on-no-candidate-fx 2 "$(_GenAPIPath)"
- <_GenAPICmd>$(_GenAPICommand)
- <_GenAPICmd>$(_GenAPICmd) "$(TargetPath)"
- <_GenAPICmd>$(_GenAPICmd) --lib-path "@(_ReferencePathDirectories)"
- <_GenAPICmd>$(_GenAPICmd) --out "$(_RefSourceFileOutputPath)"
- <_GenAPICmd>$(_GenAPICmd) --header-file "$(RepoRoot)/eng/LicenseHeader.txt"
- <_GenAPICmd>$(_GenAPICmd) --exclude-api-list "$(RepoRoot)/eng/GenAPI.exclusions.txt"
+ <_GenAPICmd>$(_GenAPICommand) @"$(_GenApiFile)"
+ <_GenApiArguments>
+
+
+
@@ -96,4 +102,4 @@
-
\ No newline at end of file
+
From f6eab78cd9c3cfe3741defbb15920e7ce2d67410 Mon Sep 17 00:00:00 2001
From: Doug Bunting <6431421+dougbu@users.noreply.github.com>
Date: Sun, 29 Sep 2019 23:20:23 -0700
Subject: [PATCH 3/4] Find or install Tar on CI - work around
dotnet/core-eng#7970 - install Git in repo if Tar can't be found in usual
locations - use found or installed Tar in Microsoft.AspNetCore.App.Ref
project - copy into repo from wherever it's found - add lots of
`Write-Host` debugging
nit: clean up / comment on VS Code warnings about build.ps1
---
.azure/pipelines/jobs/default-build.yml | 4 +
build.ps1 | 18 +++--
eng/scripts/InstallTar.ps1 | 76 +++++++++++++++++++
global.json | 1 +
.../ref/Microsoft.AspNetCore.App.Ref.csproj | 26 ++++++-
5 files changed, 114 insertions(+), 11 deletions(-)
create mode 100644 eng/scripts/InstallTar.ps1
diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml
index a136f3871f..d218c44531 100644
--- a/.azure/pipelines/jobs/default-build.yml
+++ b/.azure/pipelines/jobs/default-build.yml
@@ -55,6 +55,7 @@ parameters:
artifacts: []
buildDirectory: ''
buildScript: ''
+ installTar: true
installNodeJs: true
installJdk: true
timeoutInMinutes: 180
@@ -151,6 +152,9 @@ jobs:
Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(BuildDirectory)\artifacts\tmp\selenium\"
./eng/scripts/InstallGoogleChrome.ps1
displayName: Install Chrome
+ - ${{ if and(eq(parameters.installTar, 'true'), eq(parameters.agentOs, 'Windows')) }}:
+ - powershell: ./eng/scripts/InstallTar.ps1
+ displayName: Find or install Tar
- ${{ parameters.beforeBuild }}
diff --git a/build.ps1 b/build.ps1
index 17020044ed..c515a84af5 100644
--- a/build.ps1
+++ b/build.ps1
@@ -307,6 +307,8 @@ if (-not $foundJdk -and $RunBuild -and ($All -or $BuildJava) -and -not $NoBuildJ
# Initialize global variables need to be set before the import of Arcade is imported
$restore = $RunRestore
+# Though VS Code may indicate $nodeReuse, $warnAsError and $msbuildEngine are unused, tools.ps1 uses them.
+
# Disable node reuse - Workaround perpetual issues in node reuse and custom task assemblies
$nodeReuse = $false
$env:MSBUILDDISABLENODEREUSE=1
@@ -328,10 +330,10 @@ if ($CI) {
}
# tools.ps1 corrupts global state, so reset these values in case they carried over from a previous build
-rm variable:global:_BuildTool -ea Ignore
-rm variable:global:_DotNetInstallDir -ea Ignore
-rm variable:global:_ToolsetBuildProj -ea Ignore
-rm variable:global:_MSBuildExe -ea Ignore
+Remove-Item variable:global:_BuildTool -ea Ignore
+Remove-Item variable:global:_DotNetInstallDir -ea Ignore
+Remove-Item variable:global:_ToolsetBuildProj -ea Ignore
+Remove-Item variable:global:_MSBuildExe -ea Ignore
# Import Arcade
. "$PSScriptRoot/eng/common/tools.ps1"
@@ -391,10 +393,10 @@ finally {
}
# tools.ps1 corrupts global state, so reset these values so they don't carry between invocations of build.ps1
- rm variable:global:_BuildTool -ea Ignore
- rm variable:global:_DotNetInstallDir -ea Ignore
- rm variable:global:_ToolsetBuildProj -ea Ignore
- rm variable:global:_MSBuildExe -ea Ignore
+ Remove-Item variable:global:_BuildTool -ea Ignore
+ Remove-Item variable:global:_DotNetInstallDir -ea Ignore
+ Remove-Item variable:global:_ToolsetBuildProj -ea Ignore
+ Remove-Item variable:global:_MSBuildExe -ea Ignore
if ($DumpProcesses -or $ci) {
Stop-Job -Name DumpProcesses
diff --git a/eng/scripts/InstallTar.ps1 b/eng/scripts/InstallTar.ps1
new file mode 100644
index 0000000000..93f419b213
--- /dev/null
+++ b/eng/scripts/InstallTar.ps1
@@ -0,0 +1,76 @@
+<#
+.SYNOPSIS
+ Finds or installs the Tar command on this system.
+.DESCRIPTION
+ This script searches for Tar on this system. If not found, downloads and extracts Git to use its tar.exe. Prefers
+ global installation locations even if Git has been downloaded into this repo.
+.PARAMETER GitVersion
+ The version of the Git to install. If not set, the default value is read from global.json.
+.PARAMETER Force
+ Overwrite the existing installation if one exists in this repo and Tar isn't installed globally.
+#>
+param(
+ [string]$GitVersion,
+ [switch]$Force
+)
+
+$ErrorActionPreference = 'Stop'
+$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
+
+Set-StrictMode -Version 1
+
+# Find tar. If not found, install Git to get it.
+$repoRoot = (Join-Path $PSScriptRoot "..\.." -Resolve)
+$installDir = "$repoRoot\.tools\Git\win-x64"
+$tarCommand = "$installDir\usr\bin\tar.exe"
+$finalCommand = "$repoRoot\.tools\tar.exe"
+
+Write-Host "Windows version and other information, because who knows"
+cmd.exe /c ver
+systeminfo.exe
+
+Write-Host "Processor Architecture: $env:PROCESSOR_ARCHITECTURE"
+Write-Host "Dumping environment"
+Get-ChildItem env:\
+
+Write-Host "Checking $env:SystemRoot\System32\tar.exe"
+Get-ChildItem "$env:SystemRoot\System32\ta*.exe"
+if (Test-Path "$env:SystemRoot\System32\tar.exe") {
+ Write-Host "Found $env:SystemRoot\System32\tar.exe"
+ $tarCommand = "$env:SystemRoot\System32\tar.exe"
+}
+elseif (Test-Path "$env:ProgramFiles\Git\usr\bin\tar.exe") {
+ $tarCommand = "$env:ProgramFiles\Git\usr\bin\tar.exe"
+}
+elseif (Test-Path "${env:ProgramFiles(x86)}\Git\usr\bin\tar.exe") {
+ $tarCommand = "${env:ProgramFiles(x86)}\Git\usr\bin\tar.exe"
+}
+elseif (Test-Path "$env:AGENT_HOMEDIRECTORY\externals\git\usr\bin\tar.exe") {
+ $tarCommand = "$env:AGENT_HOMEDIRECTORY\externals\git\usr\bin\tar.exe"
+}
+elseif ((Test-Path $tarCommand) -And (-Not $Force)) {
+ Write-Verbose "Repo-local Git installation and $tarCommand already exist, skipping Git install."
+}
+else {
+ if (-not $GitVersion) {
+ $globalJson = Get-Content "$repoRoot\global.json" | ConvertFrom-Json
+ $GitVersion = $globalJson.tools.Git
+ }
+
+ $Uri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/git/Git-${GitVersion}-64-bit.zip"
+
+ Import-Module -Name (Join-Path $PSScriptRoot "..\common\native\CommonLibrary.psm1" -Resolve)
+ $InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri -InstallDirectory "$installDir\" -Force:$Force -Verbose
+
+ if ($InstallStatus -Eq $False) {
+ Write-Error "Installation failed"
+ exit 1
+ }
+}
+
+Copy-Item "$tarCommand" "$finalCommand" -Verbose
+Write-Host "Tar now available at '$finalCommand'"
+
+if ($tarCommand -like '*\Git\*') {
+ $null >.\.tools\tar.fromGit
+}
diff --git a/global.json b/global.json
index 41b9856784..256d50f24e 100644
--- a/global.json
+++ b/global.json
@@ -12,6 +12,7 @@
"$(MicrosoftNETCoreAppRuntimeVersion)"
]
},
+ "Git": "2.22.0",
"jdk": "11.0.3",
"vs": {
"version": "16.0",
diff --git a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
index 00c9026c5a..ef06af8da3 100644
--- a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
+++ b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
@@ -171,14 +171,34 @@ This package is an internal implementation of the .NET Core SDK and is not meant
Inputs="@(RefPackContent)"
Outputs="$(ZipArchiveOutputPath);$(TarArchiveOutputPath)"
Condition="'$(IsPackable)' == 'true'">
+
+ <_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">$(RepoRoot).tools\tar.exe
+ <_TarCommand Condition="'$(_TarCommand)' == ''">tar
+
+
+ <_TarArchiveOutputPath>$(TarArchiveOutputPath)
+ <_TarArchiveOutputPath
+ Condition="Exists('$(repoRoot)\.tools\tar.fromGit')">/$(TarArchiveOutputPath.Replace('\','/').Replace(':',''))
+
+
+
-
+
+
+
+
+
+
From c31c5143be9f3612af6c8a2eabbdae5aa2015166 Mon Sep 17 00:00:00 2001
From: Doug Bunting <6431421+dougbu@users.noreply.github.com>
Date: Mon, 30 Sep 2019 19:14:00 -0700
Subject: [PATCH 4/4] Create missing directory and simplify workaround slightly
---
eng/scripts/InstallTar.ps1 | 6 ++----
.../ref/Microsoft.AspNetCore.App.Ref.csproj | 14 +++-----------
2 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/eng/scripts/InstallTar.ps1 b/eng/scripts/InstallTar.ps1
index 93f419b213..12159a8d0b 100644
--- a/eng/scripts/InstallTar.ps1
+++ b/eng/scripts/InstallTar.ps1
@@ -25,13 +25,10 @@ $installDir = "$repoRoot\.tools\Git\win-x64"
$tarCommand = "$installDir\usr\bin\tar.exe"
$finalCommand = "$repoRoot\.tools\tar.exe"
-Write-Host "Windows version and other information, because who knows"
+Write-Host "Windows version and other information..."
cmd.exe /c ver
systeminfo.exe
-
Write-Host "Processor Architecture: $env:PROCESSOR_ARCHITECTURE"
-Write-Host "Dumping environment"
-Get-ChildItem env:\
Write-Host "Checking $env:SystemRoot\System32\tar.exe"
Get-ChildItem "$env:SystemRoot\System32\ta*.exe"
@@ -68,6 +65,7 @@ else {
}
}
+New-Item "$repoRoot\.tools\" -ErrorAction SilentlyContinue -ItemType Directory
Copy-Item "$tarCommand" "$finalCommand" -Verbose
Write-Host "Tar now available at '$finalCommand'"
diff --git a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
index ef06af8da3..a60b73a3cd 100644
--- a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
+++ b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
@@ -172,8 +172,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
Outputs="$(ZipArchiveOutputPath);$(TarArchiveOutputPath)"
Condition="'$(IsPackable)' == 'true'">
+ <_TarCommand>tar
<_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">$(RepoRoot).tools\tar.exe
- <_TarCommand Condition="'$(_TarCommand)' == ''">tar
<_TarArchiveOutputPath>$(TarArchiveOutputPath)
@@ -187,17 +187,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant
Overwrite="true" />
-
-
+
-
-
+ WorkingDirectory="$(TargetingPackLayoutRoot)" />