From: Daniel Stenberg Date: Thu, 17 Oct 2024 15:50:02 +0000 (+0200) Subject: libtests: generate the lib1521 atomically X-Git-Tag: curl-8_11_0~124 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ae8d9b579281ee5a9383f97e4e608b3897ccbf0;p=thirdparty%2Fcurl.git libtests: generate the lib1521 atomically By renaming from a temporary file name to the .c once completed. This avoids the risk that the checksrc job tries to verify the file before it is complete, in parallel build setups. Reported-by: Dan Frandrich Fixes #15258 Closes #15327 --- diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt index 2e0b848ee6..522ca6a1db 100644 --- a/tests/libtest/CMakeLists.txt +++ b/tests/libtest/CMakeLists.txt @@ -30,7 +30,7 @@ set_source_files_properties("../../lib/curl_multibyte.c" PROPERTIES SKIP_UNITY_B add_custom_command( OUTPUT "lib1521.c" - COMMAND ${PERL_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" < "${CURL_SOURCE_DIR}/include/curl/curl.h" > "lib1521.c" + COMMAND ${PERL_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" < "${CURL_SOURCE_DIR}/include/curl/curl.h" "lib1521.c" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" "${CURL_SOURCE_DIR}/include/curl/curl.h" diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am index f9c44f0dd9..809731d074 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -110,7 +110,7 @@ noinst_PROGRAMS = $(LIBTESTPROGS) endif lib1521.c: $(top_srcdir)/tests/libtest/mk-lib1521.pl $(top_srcdir)/include/curl/curl.h - @PERL@ $(top_srcdir)/tests/libtest/mk-lib1521.pl < $(top_srcdir)/include/curl/curl.h > lib1521.c + @PERL@ $(top_srcdir)/tests/libtest/mk-lib1521.pl < $(top_srcdir)/include/curl/curl.h lib1521.c CHECKSRC = $(CS_$(V)) CS_0 = @echo " RUN " $@; diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl index b5dae5cb94..1f642ad3be 100755 --- a/tests/libtest/mk-lib1521.pl +++ b/tests/libtest/mk-lib1521.pl @@ -24,7 +24,7 @@ ########################################################################### # Usage: -# perl mk-lib1521.pl < ../../include/curl/curl.h > lib1521.c +# perl mk-lib1521.pl < ../../include/curl/curl.h lib1521.c # minimum and maximum long signed values my $minlong = "LONG_MIN"; @@ -171,7 +171,15 @@ $allowednumerrors .= <