Skip to content

Commit d2d8d9f

Browse files
chcostaViktorHofer
authored andcommitted
Fix disable native toolset install logic (#4265)
* Fix disable native toolset install logic
1 parent 9eac612 commit d2d8d9f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

eng/common/tools.ps1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,7 @@ function GetSdkTaskProject([string]$taskName) {
446446
}
447447

448448
function InitializeNativeTools() {
449-
if ($null -eq $env:DisableNativeToolsetInstalls) {
450-
return
451-
}
452-
if (Get-Member -InputObject $GlobalJson -Name "native-tools") {
449+
if (-Not (Test-Path variable:DisableNativeToolsetInstalls) -And (Get-Member -InputObject $GlobalJson -Name "native-tools")) {
453450
$nativeArgs= @{}
454451
if ($ci) {
455452
$nativeArgs = @{

eng/common/tools.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# CI mode - set to true on CI server for PR validation build or official build.
66
ci=${ci:-false}
7-
disable_configure_toolset_import=${disable_configure_toolset_import:-null}
7+
disable_configure_toolset_import=${disable_configure_toolset_import:-}
88

99
# Set to true to use the pipelines logger which will enable Azure logging output.
1010
# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
@@ -273,7 +273,7 @@ function GetNuGetPackageCachePath {
273273
}
274274

275275
function InitializeNativeTools() {
276-
if [[ -z "${DisableNativeToolsetInstalls:-}" ]]; then
276+
if [[ -n "${DisableNativeToolsetInstalls:-}" ]]; then
277277
return
278278
fi
279279
if grep -Fq "native-tools" $global_json_file
@@ -437,7 +437,7 @@ Write-PipelineSetVariable -name "Temp" -value "$temp_dir"
437437
Write-PipelineSetVariable -name "TMP" -value "$temp_dir"
438438

439439
# Import custom tools configuration, if present in the repo.
440-
if [[ "$disable_configure_toolset_import" != null ]]; then
440+
if [[ -z "$disable_configure_toolset_import" ]]; then
441441
configure_toolset_script="$eng_root/configure-toolset.sh"
442442
if [[ -a "$configure_toolset_script" ]]; then
443443
. "$configure_toolset_script"

0 commit comments

Comments
 (0)