From 50185c0cc04bc9ce519c8974ecb7b522c1dd6dbf Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2019 13:30:39 +0000 Subject: [PATCH] Update dependencies from https://github.com/dotnet/arcade build 20191211.6 (#5871) - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19611.6 --- eng/Version.Details.xml | 4 ++-- eng/common/tools.ps1 | 28 +++++++++++++++++++++++++--- eng/common/tools.sh | 2 ++ global.json | 2 +- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 97742b1af..473fee2a2 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -104,9 +104,9 @@ - + https://github.com/dotnet/arcade - 71ce4c736b882e6112b395a0e92313be5dcb4328 + 71a91bbb3c49bad2f1e7f2c7f28b32c5c0efc9e5 diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index d762c9f04..09c3a3325 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -98,7 +98,7 @@ function Exec-Process([string]$command, [string]$commandArgs) { } } -function InitializeDotNetCli([bool]$install) { +function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { if (Test-Path variable:global:_DotNetInstallDir) { return $global:_DotNetInstallDir } @@ -146,6 +146,22 @@ function InitializeDotNetCli([bool]$install) { } $env:DOTNET_INSTALL_DIR = $dotnetRoot + + if ($createSdkLocationFile) { + # Create a temporary file under the toolset dir and rename it to sdk.txt to avoid races. + do { + $sdkCacheFileTemp = Join-Path $ToolsetDir $([System.IO.Path]::GetRandomFileName()) + } + until (!(Test-Path $sdkCacheFileTemp)) + Set-Content -Path $sdkCacheFileTemp -Value $dotnetRoot + + try { + Rename-Item -Force -Path $sdkCacheFileTemp 'sdk.txt' + } catch { + # Somebody beat us + Remove-Item -Path $sdkCacheFileTemp + } + } } # Add dotnet to PATH. This prevents any bare invocation of dotnet in custom @@ -216,7 +232,10 @@ function InstallDotNet([string] $dotnetRoot, } catch { Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet runtime '$runtime' from custom location '$runtimeSourceFeed'." + ExitWithExitCode 1 } + } else { + ExitWithExitCode 1 } } } @@ -274,8 +293,11 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = $vsMajorVersion = $vsMinVersion.Major $xcopyMSBuildVersion = "$vsMajorVersion.$($vsMinVersion.Minor).0-alpha" } - - $vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install + + $vsInstallDir = $null + if ($xcopyMSBuildVersion.Trim() -ine "none") { + $vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install + } if ($vsInstallDir -eq $null) { throw 'Unable to find Visual Studio that has required version and components installed' } diff --git a/eng/common/tools.sh b/eng/common/tools.sh index f58db5e25..e071af4ee 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -211,6 +211,8 @@ function InstallDotNet { Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to install dotnet SDK from custom location '$runtimeSourceFeed' (exit code '$exit_code')." ExitWithExitCode $exit_code } + else + ExitWithExitCode $exit_code fi fi } diff --git a/global.json b/global.json index efbb66077..40817d946 100644 --- a/global.json +++ b/global.json @@ -3,6 +3,6 @@ "dotnet": "5.0.100-alpha1-014915" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.19608.1" + "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.19611.6" } }