Skip to content
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

Better error message when VCPKG_ROOT is independently defined #7229

Merged
merged 1 commit into from
Jul 18, 2019

Conversation

daniel347x
Copy link
Contributor

If the VCPKG_ROOT environment variable is defined incorrectly - i.e., does not point to the 'vcpkg' root directory - the current error message provides no insight into the real cause of the problem.

I just lost 10 hours debugging this issue. It does make sense for end-users to define an environment variable called 'VCPKG_ROOT' independently of actually running vcpkg, as I did - to indicate to my downstream application the location of the 'include' path created for a 3rd-party library when vcpkg installed it (which happens to be located inside the vkpkg root directory by default - in the /installed/.../include directory).

Unfortunately, defining the 'VCPKG_ROOT' independently, as I did, caused complete failure of vcpkg to run, giving the current useless error "Changing the working dir failed". (...The path <vcpkg/installed/.../include> is not the root directory of vcpkg, and in fact does not even exist when the vcpkg repository is cloned.)

It would be immensely helpful to receive a proper error message alerting a programmer to the real likely cause of this error - i.e., alerting the programmer to the fact that the VCPKG_ROOT environment variable is reserved for use by 'vcpkg' itself, and should not be used by end-users for alternate purposes. (I have also included the other potential error condition - an improperly created '.vcpkg-root' file - for completeness, though it seems less likely this would be the issue.)

The current error message addresses this issue, and I hope will be accepted into the library to save some other poor soul such as myself an entire lost day should they mistakenly create an environment variable called 'VCPKG_ROOT' pointing to the install target location inside the actual vkpkg root directory.

If the VCPKG_ROOT environment variable is defined incorrectly - i.e., does not point to the 'vcpkg' root directory - the current error message provides no insight into the real cause of the problem.

I just lost 10 hours debugging this issue.  It *does* make sense for end-users to define an environment variable called 'VCPKG_ROOT' independently of actually running vcpkg, as I did - to indicate to my downstream application the location of the 'include' path created for a 3rd-party library when vcpkg installed it (which happens to be located inside the vkpkg root directory by default - in the <vcpkg>/installed/.../include directory).

Unfortunately, defining the 'VCPKG_ROOT' independently, as I did, caused complete failure of vcpkg to run, giving the current useless error "Changing the working dir failed".  (...The path <vcpkg/installed/.../include> is not the root directory of vcpkg, and in fact does not even exist when the vcpkg repository is cloned.)

It would be immensely helpful to receive a proper error message alerting a programmer to the real likely cause of this error - i.e., alerting the programmer to the fact that the VCPKG_ROOT environment variable is reserved for use by 'vcpkg' itself, and should not be used by end-users for alternate purposes.  (I have also included the other potential error condition - an improperly created '.vcpkg-root' file - for completeness, though it seems less likely this would be the issue.)

The current error message addresses this issue, and I hope will be accepted into the library to save some other poor soul such as myself an entire lost day should they mistakenly create an environment variable called 'VCPKG_ROOT' pointing to the install target location inside the actual vkpkg root directory.
@JackBoosY JackBoosY requested a review from Rastaban July 10, 2019 23:55
@Rastaban Rastaban merged commit ef48500 into microsoft:master Jul 18, 2019
strega-nil pushed a commit to strega-nil/vcpkg that referenced this pull request May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants