git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/6] cmake: copy over git-p4.py for t983[56] perforce test

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Dec 19, 2022, 18:39 UTC
Message-ID
<patch-5.6-70a7f3e19b2-20221219T183623Z-avarab@gmail.com>
In-Reply-To
<cover-0.6-00000000000-20221219T183623Z-avarab@gmail.com>

Since [1] two git-p4 tests have relied on there being a "git-p4.py" in the build directory, but the cmake recipe was not updated to account for this. Let's copy the "git-p4.py" over.

We could also change the test to e.g. grab the built "git-p4" and alter its shebang, which would be friendly to GIT_TEST_INSTALLED, but let's just do the bare minimum here to get cmake+ctest working without altering the test itself.

The reason this hasn't been caught by "vs-build" and "vs-test" is because those tests added in [2] invoke "cmake" with "-DPYTHON_TESTS=OFF", and therefore we'd skip this part of the git-p4 tests before getting past the "do we have python?" check. Even if we got past that the Windows CI wouldn't have a "p4" or "p4d" binary installed, so we'd skip the tests anyway.

In a subsequent commit we'll run "cmake" and "ctest" in CI with "ubuntu-latest", so we'll need this "git-p4.py" file.

1. f7b5ff607fa (git-p4: improve encoding handling to support
   inconsistent encodings, 2022-04-30)
2. 4c2c38e800f (ci: modification of main.yml to use cmake for vs-build
   job, 2020-06-26)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 contrib/buildsystems/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 560a15ed35a..29b73ecbbbc 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -894,6 +894,7 @@ endforeach()
 file(STRINGS ${CMAKE_SOURCE_DIR}/git-p4.py content NEWLINE_CONSUME)
 string(REPLACE "#!/usr/bin/env python" "#!/usr/bin/python" content "${content}")
 file(WRITE ${CMAKE_BINARY_DIR}/git-p4 ${content})
+file(COPY ${CMAKE_SOURCE_DIR}/git-p4.py DESTINATION ${CMAKE_BINARY_DIR}/)
 
 #perl modules
 file(GLOB_RECURSE perl_modules "${CMAKE_SOURCE_DIR}/perl/*.pm")
-- 
2.39.0.1071.g97ce8966538
Previous: Ævar Arnfjörð Bjarmason
Message 7 of 7 in “cmake: guard OS-specific code & cleanup & chmod +x on *nix”
  1. 0/6 cmake: guard OS-specific code & cleanup & chmod +x on *nixÆvar Arnfjörð Bjarmason, Dec 19, 2022
  2. 1/6 cmake: don't copy chainlint.pl to build directoryÆvar Arnfjörð Bjarmason, Dec 19, 2022
  3. 2/6 cmake: set "USE_LIBPCRE2" in "GIT-BUILD-OPTIONS" for test-lib.shÆvar Arnfjörð Bjarmason, Dec 19, 2022
  4. 3/6 cmake: increase test timeout on Windows onlyÆvar Arnfjörð Bjarmason, Dec 19, 2022
  5. 4/6 cmake: only look for "sh" in "C:/Program Files" on WindowsÆvar Arnfjörð Bjarmason, Dec 19, 2022
  6. 6/6 cmake: chmod +x the bin-wrappers/* & SCRIPT_{SH,PERL} & git-p4Ævar Arnfjörð Bjarmason, Dec 19, 2022
  7. 5/6 cmake: copy over git-p4.py for t983[56] perforce testÆvar Arnfjörð Bjarmason, Dec 19, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.