Fix working directory for archiving from git.#21166
Fix working directory for archiving from git.#21166BillyONeal merged 2 commits intomicrosoft:masterfrom
Conversation
- The directory specified no longer matches the directory used for
fetching.
- This was overlooked by PR microsoft#19338.
| ALLOW_IN_DOWNLOAD_MODE | ||
| COMMAND "${GIT}" archive "${rev_parse_ref}" -o "${temp_archive}" | ||
| WORKING_DIRECTORY "${DOWNLOADS}/git-tmp" | ||
| WORKING_DIRECTORY "${git_working_directory}" |
There was a problem hiding this comment.
Can you tell me which issue you solved here?
There was a problem hiding this comment.
Of course. This issue is with head (--head) mode operation.
It starts here. The directory where the script wants to operate in, i.e git_working_directory, is set to ${DOWNLOADS}/git-tmp.
vcpkg/scripts/cmake/vcpkg_from_git.cmake
Line 82 in 40a0fb2
However, if you have specified head mode (--head) then the code changes that directory to "${CURRENT_BUILDTREES_DIR}/src/git-tmp" here
vcpkg/scripts/cmake/vcpkg_from_git.cmake
Lines 83 to 88 in 40a0fb2
Which means the port will be fetched to that directory here
vcpkg/scripts/cmake/vcpkg_from_git.cmake
Lines 117 to 128 in 40a0fb2
The script then tries to archive the fetched code (for caching). However, the archiving custom command was still assuming the fetch was always done in ${DOWNLOADS}/git-tmp.
vcpkg/scripts/cmake/vcpkg_from_git.cmake
Lines 163 to 169 in 40a0fb2
This was failing because there is nothing in ${DOWNLOADS}/git-tmp. My guess is that it was just overlooked among the changes in #19338. I changed it to use the git_working_directory variable instead. This way it works for both modes.
I am not sure why the two operation modes (normal vs head) use two different temporary directories. Maybe that was overlooked. But I thought this fix covers both cases without big changes.
There was a problem hiding this comment.
I agree with @mahge -- this is once again a case the GitHub code review tool makes terrible. Consider existing uses on 126 and 149 that the terrible code review tool isn't showing as contest.
|
@strega-nil-ms @vicroms can you please take a look? Thanks. |
| ALLOW_IN_DOWNLOAD_MODE | ||
| COMMAND "${GIT}" archive "${rev_parse_ref}" -o "${temp_archive}" | ||
| WORKING_DIRECTORY "${DOWNLOADS}/git-tmp" | ||
| WORKING_DIRECTORY "${git_working_directory}" |
There was a problem hiding this comment.
I agree with @mahge -- this is once again a case the GitHub code review tool makes terrible. Consider existing uses on 126 and 149 that the terrible code review tool isn't showing as contest.
|
Depends on #21613. |
|
The qca regression was fixed by #21250. |
|
Thanks for the typo fix! |
|
No problem. Thanks for accepting it. I think it might be good to add at least one test that uses |
Describe the pull request
Fix the working directory where git archive is issued in (for
vcpkg_from_git)What does your PR fix?
The directory specified no longer matches the directory used for fetching.
This was overlooked by PR [tinyfiledialogs] Fix for good #19338.
Which triplets are supported/not supported? Have you updated the CI baseline?
Not applicable
Does your PR follow the maintainer guide?
YesIf you have added/updated a port: Have you run
./vcpkg x-add-version --alland committed the result?Not applicable