-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ubuntu] Add VCPKG_ROOT variable #6196
[Ubuntu] Add VCPKG_ROOT variable #6196
Conversation
/azp run ubuntu2004, ubuntu2204 |
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Pipelines successfully started running 2 pipeline(s). |
This breaks vcpkg customers who use vcpkg as a submodule. Can you explain why this variable is being set? |
@BillyONeal, we got a request to add this variable #6146. @michaelbprice, Could you please provide more context? |
There are at least 3 techniques being used in the wild to acquire vcpkg.
Under all of these scenarios, how should we expect tools to invoke
For option 3), it would be unwise to have that conventional environment variable differ according to the technique that was used to obtain the vcpkg tool, which was the current case in the GitHub Actions containers, where Another issue was identified where a user was using the presence of If we decide that we do not want to support option 3) for identifying the location of the tool, then we should make it clear that no one should rely upon such an environment variable being defined and that they should instead use options 1) or 2). |
(1) the location of the built in registry, and It defaults to the directory "above" the vcpkg binary with the file It was added because once upon a time, the canonical way to use vcpkg required building the vcpkg binary, and people asked for some way to avoid needing to rebuild the executable over and over, as that took significant time. So you could build / download the executable once, and reuse it with different "instances" of vcpkg. In classic mode, it, in effect, controls the versions of all of the packages that one can install. A CI system setting this is, in effect, saying "to hell with the versions the project being built asked for, you are getting the system versions".
In this case, the default
In this case, vcpkg is being installed into the shell in experimental support of the "artifacts" feature, where vcpkg needs to be able to reach into the outer shell and set environment variables.
This looks like case 1. In all 3 cases, the expected way the user calls us is via PATH (or by equivalent shell function in case 2).
The vast vast majority of the time, it should be (1).
There is no such "conventional environment variable". I don't know if one is even possible because the different deployment mechanisms have intentionally different behavior; the "one liner" installer was added as an experiment and we need to take a long hard look at all of our configuration before taking the experimental tag off. The other methods reduce to PATH. |
* Version lock the github actions actions. * Work around actions/runner-images#6196
@BillyONeal @michaelbprice |
We are still getting constant reports of people broken by this setting and still do not understand why GitHub Actions is setting it. We are also considering product changes to explicitly ignore the setting with a warning because CI systems keep doing this to us. |
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.
After some deliberation, my understanding of the role of the @erik-bershel - I think that due to the disruptions the change has caused, the addition of |
…t. (#725) * Remove unique_ptr from VcpkgCmdArguments. * 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. * Fix disable-metrics test and echo tool output. * Fix imprecise env-passthrough test.
Our workaround for this in the vcpkg product just landed today. |
Description
Add VCPKG_ROOT variable in additional to VCPKG_INSTALLATION_ROOT
Related issue:
#4241
Check list