cmcfarlen opened a new pull request, #13497:
URL: https://github.com/apache/trafficserver/pull/13497

   ## 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to