Fall back to the build directory when GIT_COMMON_DIR is unset - #13497
Merged
Conversation
Requiring GIT_COMMON_DIR made configure fatal in trees where git cannot resolve a common directory, such as a source export without .git or a worktree mapped into a container without the paths its .git file points at. Nothing about proxy-verifier needs that directory specifically; it is only a convenient cache shared across worktrees of one clone. Introduce PV_DEST_DIR, set from GIT_COMMON_DIR when available and the build directory otherwise, and use it for the download and extraction.
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adjusts proxy-verifier’s CMake setup to no longer fail configuration when GIT_COMMON_DIR is unavailable, by falling back to the build directory for downloads/extraction.
Changes:
- Introduce
PV_DEST_DIRto centralize the destination directory for proxy-verifier artifacts. - Replace the
GIT_COMMON_DIRfatal error with a build-directory fallback and a status message. - Update download/extract and computed paths to use
PV_DEST_DIR.
bneradt
approved these changes
Aug 5, 2026
cmcfarlen
added a commit
that referenced
this pull request
Aug 6, 2026
Requiring GIT_COMMON_DIR made configure fatal in trees where git cannot resolve a common directory, such as a source export without .git or a worktree mapped into a container without the paths its .git file points at. Nothing about proxy-verifier needs that directory specifically; it is only a convenient cache shared across worktrees of one clone. Introduce PV_DEST_DIR, set from GIT_COMMON_DIR when available and the build directory otherwise, and use it for the download and extraction. (cherry picked from commit b8440f0)
Contributor
Author
|
Cherry-picked to the 10.2.x branch as 2e61a7a for the 10.2.0 release. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
cmake/proxy-verifier.cmaketreats an unsetGIT_COMMON_DIRas a fatal error:But that directory is only a convenient cache shared across worktrees of one clone — nothing about proxy-verifier actually needs it. There are ordinary situations where git can't resolve a common directory, and configure shouldn't fail in any of them:
A release tarball has no
.gitat all.asf-distdirbuilds the tarball withgit archive --format=tar --prefix=... HEAD, so the extracted source tree contains no git metadata whatsoever. Anyone configuring that tarball with-DENABLE_AUTEST=ON— a normal way to verify a release candidate — hits the fatal error. Worth fixing before the 10.2.0 RC rather than after.A worktree mapped into a container. The worktree's
.gitis a file pointing at<host-path>/.git/worktrees/<name>. If only the worktree directory is mapped in, that path doesn't exist inside the container,git rev-parse --git-common-direxits 128, andGIT_COMMON_DIRis left empty.Note this only affects builds with
ENABLE_AUTEST=ON(default OFF), sinceinclude(proxy-verifier)is guarded by it. A default tarball build is unaffected.Changes
Introduce
PV_DEST_DIRas the single destination for the download and extraction, set fromGIT_COMMON_DIRwhen git provides one andCMAKE_BINARY_DIRotherwise, and drop theFATAL_ERROR. When the fallback is taken it says so:The git common directory is still preferred, so the shared-cache behaviour for normal clones and worktrees is unchanged. In the fallback case each build directory keeps its own copy of the archive; CMake skips re-downloading when the existing file already matches
EXPECTED_HASH, so it is one download per build directory.Test plan
Configured with
-DENABLE_AUTEST=ONin three trees and confirmed the resultingPROXY_VERIFIER_PATH:GIT_COMMON_DIRset)<clone>/.git/proxy-verifier-v3.1.3/darwin-arm64— unchanged from beforegit archiveexport, no.git(the release-tarball case)<build>/proxy-verifier-v3.1.3/darwin-arm64.gitpoints at a non-existent path (the container case)<build>/proxy-verifier-v3.1.3/darwin-arm64Both fallback trees reproduced the
FATAL_ERRORbefore the change and reachedConfiguring doneafter it. For the fallback I also verified the archive extracts and thatverifier-clientandverifier-serverare present atPROXY_VERIFIER_PATH, and that the generatedtests/autest.shreceives the build-directory path:cmake-formatleaves the file unchanged.