From bf4210fa221b98b82888de58b5ce2a86d7cb3330 Mon Sep 17 00:00:00 2001 From: Christopher Costa Date: Thu, 31 Oct 2019 17:08:17 -0700 Subject: [PATCH 1/4] Fix disable native toolset install logic --- eng/common/tools.ps1 | 2 +- eng/common/tools.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 3ab5498b7f2..caa3d687cca 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -446,7 +446,7 @@ function GetSdkTaskProject([string]$taskName) { } function InitializeNativeTools() { - if ($null -eq $env:DisableNativeToolsetInstalls) { + if (Test-Path variable:DisableNativeToolsetInstalls) { return } if (Get-Member -InputObject $GlobalJson -Name "native-tools") { diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 35a80c3f123..63d0459791b 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -273,7 +273,7 @@ function GetNuGetPackageCachePath { } function InitializeNativeTools() { - if [[ -z "${DisableNativeToolsetInstalls:-}" ]]; then + if [[ -n "${DisableNativeToolsetInstalls:-}" ]]; then return fi if grep -Fq "native-tools" $global_json_file From f51fbc982d70b993e822a1e9c64f7ad0f3e8886d Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Fri, 1 Nov 2019 10:08:05 +0100 Subject: [PATCH 2/4] Update tools.ps1 --- eng/common/tools.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index caa3d687cca..42ca33ac33d 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -446,10 +446,7 @@ function GetSdkTaskProject([string]$taskName) { } function InitializeNativeTools() { - if (Test-Path variable:DisableNativeToolsetInstalls) { - return - } - if (Get-Member -InputObject $GlobalJson -Name "native-tools") { + if (-Not (Test-Path variable:DisableNativeToolsetInstalls) -And (Get-Member -InputObject $GlobalJson -Name "native-tools")) { $nativeArgs= @{} if ($ci) { $nativeArgs = @{ From 2620e97e889bf427cc7f10eb4fb061762cc4c9d0 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Fri, 1 Nov 2019 10:08:53 +0100 Subject: [PATCH 3/4] Update tools.sh --- eng/common/tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 63d0459791b..4648d04a1af 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -437,7 +437,7 @@ Write-PipelineSetVariable -name "Temp" -value "$temp_dir" Write-PipelineSetVariable -name "TMP" -value "$temp_dir" # Import custom tools configuration, if present in the repo. -if [[ "$disable_configure_toolset_import" != null ]]; then +if [[ -n "$disable_configure_toolset_import" ]]; then configure_toolset_script="$eng_root/configure-toolset.sh" if [[ -a "$configure_toolset_script" ]]; then . "$configure_toolset_script" From f5c59abc2ca1a1f55f76c27bb591388e639ab976 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Fri, 1 Nov 2019 13:43:10 +0100 Subject: [PATCH 4/4] Update tools.sh --- eng/common/tools.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 4648d04a1af..6a23ac0a345 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -4,7 +4,7 @@ # CI mode - set to true on CI server for PR validation build or official build. ci=${ci:-false} -disable_configure_toolset_import=${disable_configure_toolset_import:-null} +disable_configure_toolset_import=${disable_configure_toolset_import:-} # Set to true to use the pipelines logger which will enable Azure logging output. # https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md @@ -437,7 +437,7 @@ Write-PipelineSetVariable -name "Temp" -value "$temp_dir" Write-PipelineSetVariable -name "TMP" -value "$temp_dir" # Import custom tools configuration, if present in the repo. -if [[ -n "$disable_configure_toolset_import" ]]; then +if [[ -z "$disable_configure_toolset_import" ]]; then configure_toolset_script="$eng_root/configure-toolset.sh" if [[ -a "$configure_toolset_script" ]]; then . "$configure_toolset_script"