From 0151ab4d38a50eeb3313e55e84a9306e67c339f5 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Tue, 23 Apr 2019 15:48:11 -0700 Subject: [PATCH] Support setting "partition" for arcade to avoid conflicts of .dotnet and artifacts folders --- .gitignore | 2 ++ eng/common/tools.ps1 | 9 +++++++++ eng/common/tools.sh | 9 ++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 23fe40877..2ce687bb1 100644 --- a/.gitignore +++ b/.gitignore @@ -95,8 +95,10 @@ dlldata.c # Build artifacts artifacts/ +artifacts-*/ bin/ .dotnet/ +.dotnet-*/ *_i.c *_p.c diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 8fe2b11ad..4d73a6b36 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -128,7 +128,12 @@ function InitializeDotNetCli([bool]$install) { if ((-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -ne $null) -and (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetSdkVersion"))) { $dotnetRoot = $env:DOTNET_INSTALL_DIR } else { + $dotnetRoot = Join-Path $RepoRoot ".dotnet" + if ($env:ARCADE_PARTITION -ne $null) + { + $dotnetRoot = Join-Path $RepoRoot ".dotnet-$env:ARCADE_PARTITION" + } if (-not (Test-Path(Join-Path $dotnetRoot "sdk\$dotnetSdkVersion"))) { if ($install) { @@ -561,6 +566,10 @@ function GetMSBuildBinaryLogCommandLineArgument($arguments) { $RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..") $EngRoot = Resolve-Path (Join-Path $PSScriptRoot "..") $ArtifactsDir = Join-Path $RepoRoot "artifacts" +if ($env:ARCADE_PARTITION -ne $null) +{ + $ArtifactsDir = Join-Path $RepoRoot "artifacts-$env:ARCADE_PARTITION" +} $ToolsetDir = Join-Path $ArtifactsDir "toolset" $ToolsDir = Join-Path $RepoRoot ".tools" $LogDir = Join-Path (Join-Path $ArtifactsDir "log") $configuration diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 738bb5669..dc0ed708e 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -131,7 +131,9 @@ function InitializeDotNetCli { dotnet_root="$DOTNET_INSTALL_DIR" else dotnet_root="$repo_root/.dotnet" - + if [[ -n "${ARCADE_PARTITION:-}" ]]; then + dotnet_root="$repo_root/.dotnet-$ARCADE_PARTITION" + fi export DOTNET_INSTALL_DIR="$dotnet_root" if [[ ! -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then @@ -360,6 +362,11 @@ _script_dir=`dirname "$_ResolvePath"` eng_root=`cd -P "$_script_dir/.." && pwd` repo_root=`cd -P "$_script_dir/../.." && pwd` artifacts_dir="$repo_root/artifacts" +if [[ -n "${ARCADE_PARTITION:-}" ]]; then + artifacts_dir="$repo_root/artifacts-$ARCADE_PARTITION" + export ArtifactsDir="$artifacts_dir/" +fi + toolset_dir="$artifacts_dir/toolset" tools_dir="$repo_root/.tools" log_dir="$artifacts_dir/log/$configuration"