forked from microsoft/vcpkg-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore the VCPKG_ROOT environment variable when we detect a vcpkg_root.
This resolves https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1634907 In actions/runner-images#6196 we have yet another CI system that is trying to helpfully set VCPKG_ROOT for customers to find their vcpkg instance which yet again breaks classic-mode-as-submodule customers. This change mitigates the issue by ignoring the environment variable when we detect a valid VCPKG_ROOT, which the user can override by using the command line option.
- Loading branch information
1 parent
566f3ce
commit 26f050a
Showing
18 changed files
with
112 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
. $PSScriptRoot/../end-to-end-tests-prelude.ps1 | ||
|
||
$CurrentTest = "VCPKG_ROOT" | ||
|
||
$targetMessage = 'Ignoring VCPKG_ROOT environment variable' | ||
|
||
$defaultOutput = Run-Vcpkg -TestArgs ($commonArgs + @('install', 'vcpkg-empty-port')) | ||
Throw-IfFailed | ||
if ($defaultOutput.Contains($targetMessage)) { | ||
throw 'Expected no warning about VCPKG_ROOT when using the environment variable.' | ||
} | ||
|
||
$actualVcpkgRoot = $env:VCPKG_ROOT | ||
|
||
pushd $actualVcpkgRoot | ||
try { | ||
$samePathOutput = Run-Vcpkg -TestArgs ($commonArgs + @('install', 'vcpkg-empty-port')) | ||
Throw-IfFailed | ||
if ($samePathOutput.Contains($targetMessage)) { | ||
throw 'Expected no warning about VCPKG_ROOT when the detected path is the same as the configured path.' | ||
} | ||
|
||
$env:VCPKG_ROOT = Join-Path $actualVcpkgRoot 'ports' # any existing directory that isn't the detected root | ||
$differentPathOutput = Run-Vcpkg -TestArgs ($commonArgs + @('install', 'vcpkg-empty-port', '--debug')) | ||
Throw-IfFailed | ||
if (-not ($differentPathOutput.Contains($targetMessage))) { | ||
throw 'Expected a warning about VCPKG_ROOT differing when the detected path differs from the configured path.' | ||
} | ||
|
||
$setWithArgOutput = Run-Vcpkg -TestArgs ($commonArgs + @('install', 'vcpkg-empty-port', '--vcpkg-root', $actualVcpkgRoot, '--debug')) | ||
echo $setWithArgOutput | ||
Throw-IfFailed | ||
if ($setWithArgOutput.Contains($targetMessage)) { | ||
throw 'Expected no warning about VCPKG_ROOT when the path is configured with a command line argument.' | ||
} | ||
} finally { | ||
$env:VCPKG_ROOT = $actualVcpkgRoot | ||
popd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters