-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[vcpkg] use VCPKG_ROOT_DIR instead of DOWNLOADS for WORKING_DIRECTORY in do_version_check #15299
Conversation
vcpkg_execute_in_download_mode( | ||
COMMAND ${${VAR}} ${VERSION_CMD} | ||
WORKING_DIRECTORY ${DOWNLOADS} | ||
${WORKING_DIRECTORY_ARG} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct response to "the downloads directory doesn't exist" is "create the downloads directory", not "dump the files in some random place wherever". Do you have a repro for this issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. On arm64-osx, I install all the required tools - cmake and ninja, prior to any operations, run bootstrap with useSystemBinaries
and allowAppleClang
, then try to build some packages, and when it tries to test the version of system-installed ninja, it fails on this step, as nothing was downloaded, and downloads directory does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, the repro is arm64-osx.
To be clear, I'm not saying "it's impossible for this to happen", I'm saying "this is not a correct fix for the problem".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reproduced this on x64-linux as well. The thing is that it silently fails:
[DEBUG] -- Found ninja('') but at least version 1.10.1 is required! Trying to use internal version if possible!
[DEBUG] -- Downloading https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-linux.zip...
But because it downloads the binary for correct architecture, further build does not fail. This is not the case with arm64, however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think that "dump the files in some random place wherever" is not the exact description of the issue. do_version_check
simply runs /usr/bin/ninja --version
, for example, and the directory it is running this command from does not seem to be a big issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The presence of the existing working directory setting strongly indicate that it was relevant for at least one program.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a high probability that the vcpkg_execute_in_download_mode
command was just copied from msiexec
call and having the call be inside a vcpkg dir seemed to be safe. Using VCPKG_ROOT or BUILDTREE_DIR seems also be reasonable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let it be VCPKG_ROOT then
Ping @BillyONeal . Are you sure that working directory is required at all? CMake uses absolute paths for executables here. |
I would also ping @Neumann-A , as the macro was introduced here #12895 and not changed much since then. |
… in do_version_check Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
1033f40
to
bd5ac3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some testing to make sure this didn't edit anything in the root dir.
Add check for downloads directory existence in
do_version_check
to preventNo such file or directory
error inexecute_process
.