From 5dbc923cb31e7bc5f9206655a5c47934ae6cb835 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2020 20:47:44 +0100 Subject: [PATCH] [master] Update dependencies from dotnet/arcade (#18206) * Update dependencies from https://github.com/dotnet/arcade build 20191215.1 - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19615.1 - Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19615.1 * Update dependencies from https://github.com/dotnet/arcade build 20191222.1 - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19622.1 - Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19622.1 * Update dependencies from https://github.com/dotnet/arcade build 20191229.1 - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19629.1 - Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19629.1 * Update dependencies from https://github.com/dotnet/arcade build 20200105.1 - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20055.1 - Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20055.1 --- eng/Version.Details.xml | 8 +++---- eng/common/templates/steps/publish-logs.yml | 2 +- eng/common/tools.ps1 | 33 ++++++++++++++++++++++++++--- eng/common/tools.sh | 2 ++ global.json | 4 ++-- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 228d1e31434..fd3f8a02847 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -15,13 +15,13 @@ - + https://github.com/dotnet/arcade - 71ce4c736b882e6112b395a0e92313be5dcb4328 + 111d78c79ac38f596688af152779d7a39e4bf973 - + https://github.com/dotnet/arcade - 71ce4c736b882e6112b395a0e92313be5dcb4328 + 111d78c79ac38f596688af152779d7a39e4bf973 diff --git a/eng/common/templates/steps/publish-logs.yml b/eng/common/templates/steps/publish-logs.yml index 8903ba57c00..f91751fe78e 100644 --- a/eng/common/templates/steps/publish-logs.yml +++ b/eng/common/templates/steps/publish-logs.yml @@ -18,6 +18,6 @@ steps: inputs: PathtoPublish: '$(Build.SourcesDirectory)/PostBuildLogs' PublishLocation: Container - ArtifactName: PostBuilLogs + ArtifactName: PostBuildLogs continueOnError: true condition: always() diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index d762c9f044a..d3a432878e2 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -98,7 +98,10 @@ function Exec-Process([string]$command, [string]$commandArgs) { } } -function InitializeDotNetCli([bool]$install) { +# createSdkLocationFile parameter enables a file being generated under the toolset directory +# which writes the sdk's location into. This is only necessary for cmd --> powershell invocations +# as dot sourcing isn't possible. +function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { if (Test-Path variable:global:_DotNetInstallDir) { return $global:_DotNetInstallDir } @@ -148,6 +151,24 @@ function InitializeDotNetCli([bool]$install) { $env:DOTNET_INSTALL_DIR = $dotnetRoot } + # Creates a temporary file under the toolset dir. + # The following code block is protecting against concurrent access so that this function can + # be called in parallel. + if ($createSdkLocationFile) { + 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 # build steps from using anything other than what we've downloaded. # It also ensures that VS msbuild will use the downloaded sdk targets. @@ -216,7 +237,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 +298,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 f58db5e25d1..e071af4ee49 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 30da517ad56..88f1ba5aac1 100644 --- a/global.json +++ b/global.json @@ -3,7 +3,7 @@ "dotnet": "5.0.100-alpha1-015772" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.19608.1", - "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.19608.1" + "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20055.1", + "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20055.1" } } -- 2.11.4.GIT