Skip to content

Fall back to the build directory when GIT_COMMON_DIR is unset - #13497

Merged
cmcfarlen merged 1 commit into
apache:masterfrom
cmcfarlen:pv-dest-dir
Aug 5, 2026
Merged

Fall back to the build directory when GIT_COMMON_DIR is unset#13497
cmcfarlen merged 1 commit into
apache:masterfrom
cmcfarlen:pv-dest-dir

Conversation

@cmcfarlen

Copy link
Copy Markdown
Contributor

Description

cmake/proxy-verifier.cmake treats an unset GIT_COMMON_DIR as a fatal error:

CMake Error at cmake/proxy-verifier.cmake:40 (message):
  GIT_COMMON_DIR not set.  This should be set by the top-level CMakeLists.txt

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:

  1. A release tarball has no .git at all. asf-distdir builds the tarball with git 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.

  2. A worktree mapped into a container. The worktree's .git is 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-dir exits 128, and GIT_COMMON_DIR is left empty.

Note this only affects builds with ENABLE_AUTEST=ON (default OFF), since include(proxy-verifier) is guarded by it. A default tarball build is unaffected.

Changes

Introduce PV_DEST_DIR as the single destination for the download and extraction, set from GIT_COMMON_DIR when git provides one and CMAKE_BINARY_DIR otherwise, and drop the FATAL_ERROR. When the fallback is taken it says so:

-- GIT_COMMON_DIR not set, storing proxy-verifier in the build directory instead

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=ON in three trees and confirmed the resulting PROXY_VERIFIER_PATH:

Tree Result
Normal clone (GIT_COMMON_DIR set) <clone>/.git/proxy-verifier-v3.1.3/darwin-arm64 — unchanged from before
git archive export, no .git (the release-tarball case) <build>/proxy-verifier-v3.1.3/darwin-arm64
Worktree whose .git points at a non-existent path (the container case) <build>/proxy-verifier-v3.1.3/darwin-arm64

Both fallback trees reproduced the FATAL_ERROR before the change and reached Configuring done after it. For the fallback I also verified the archive extracts and that verifier-client and verifier-server are present at PROXY_VERIFIER_PATH, and that the generated tests/autest.sh receives the build-directory path:

--proxy-verifier-bin /tmp/pvbuild-nogit/proxy-verifier-v3.1.3/darwin-arm64

cmake-format leaves the file unchanged.

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.
Copilot AI lite review requested due to automatic review settings August 5, 2026 12:41
@cmcfarlen cmcfarlen self-assigned this Aug 5, 2026
@cmcfarlen cmcfarlen added the Build work related to build configuration or environment label Aug 5, 2026
@cmcfarlen cmcfarlen added this to the 11.0.0 milestone Aug 5, 2026
@cmcfarlen
cmcfarlen requested a review from bneradt August 5, 2026 12:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DIR to centralize the destination directory for proxy-verifier artifacts.
  • Replace the GIT_COMMON_DIR fatal error with a build-directory fallback and a status message.
  • Update download/extract and computed paths to use PV_DEST_DIR.

Comment thread cmake/proxy-verifier.cmake
Comment thread cmake/proxy-verifier.cmake
@cmcfarlen
cmcfarlen merged commit b8440f0 into apache:master Aug 5, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this to For v10.2.0 in ATS v10.2.x Aug 5, 2026
@cmcfarlen
cmcfarlen deleted the pv-dest-dir branch August 5, 2026 18:57
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)
@cmcfarlen cmcfarlen moved this from For v10.2.0 to Picked v10.2.0 in ATS v10.2.x Aug 6, 2026
@cmcfarlen cmcfarlen modified the milestones: 11.0.0, 10.2.0 Aug 6, 2026
@cmcfarlen

Copy link
Copy Markdown
Contributor Author

Cherry-picked to the 10.2.x branch as 2e61a7a for the 10.2.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build work related to build configuration or environment

Projects

Status: Picked v10.2.0

Development

Successfully merging this pull request may close these issues.

3 participants