From patchwork Mon Dec 19 18:39:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13077021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D24DFC4332F for ; Mon, 19 Dec 2022 18:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232123AbiLSSjf (ORCPT ); Mon, 19 Dec 2022 13:39:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229895AbiLSSjd (ORCPT ); Mon, 19 Dec 2022 13:39:33 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 718AFD9 for ; Mon, 19 Dec 2022 10:39:32 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id y16so9619667wrm.2 for ; Mon, 19 Dec 2022 10:39:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1qZKS9KZO4t7xTf39n3XNGDUOoql58S1lsyjDtXgcg4=; b=gj4p6IbQAkrsAQMC/A4omB7lWefNfMy4E4PGSuS6EViMcVxA2Mr3knS5CIgPLqhc88 e0r2wrFYhIwaobQJCDP5/6iaUO3m+S5qfoAcua/sFWdNjzcKUNhG3NVxK1dzXmXUShkx VH7J2RL3/kXOD7cK7SlOxerR9l9I2BicVTcFYe2SZORR4TxIrR0HqKvnndV0uoQI3wkz DZTXqxl1fNoS/K6eRIi+CuWPAV/yUhLihwVkxZPZ/azeNVyTFiWm7rqshNxP31ZuNM12 mhs9CdMpFKxkbIjtRkp4fHjtgEEt0JuvN2RcXMwgkEoAht4y+UZ95Iwok4WwE7Qm2X1n wTgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1qZKS9KZO4t7xTf39n3XNGDUOoql58S1lsyjDtXgcg4=; b=mDjQJYSIgHi2MUWFoliaSxfrS8CqSAl8cnNQ8pYvWXH9GOGxqXUkdO91J2qZ2HRsN+ cqmWIh8SQNsobgdH14ECtcONdj+YJNv8Xkt1YU2rW7Go3BB2xD/5mtJeznQQraAMz7LL Lh1ZThdUnNuImHqZbXWmYhW9wvFB1DuC4p5z8nTCtbks4Yc74KmJVMdbQ+XDLuqWmNso qHHx+VU+sag5nFule72kngECx/NukwEXtwXfd3SewwryAaXSe2q/92cq6/vNo/9olgDl kCYqkO0KiKB8ROooWdxoCjdPpGH41RYqlb+yuJfhcEYheHTz1+POtckem4qHeyc19qzK txOw== X-Gm-Message-State: ANoB5pnd3ITc3q3TzgfgSzJwWiv5/JlxXN9u90ENEt/qzj3KUHK/10xU fH2GwSxjaTdb1PS4IyRyxshNhDND8ZBJyw== X-Google-Smtp-Source: AA0mqf5gbMp6iFFDshodLy1BZIY/5Q0Jay1TzNoJO38Js8y7dYTSa6/PiolCkOhl5NoSEHWzZBII8A== X-Received: by 2002:a05:6000:1004:b0:242:9e3:72b8 with SMTP id a4-20020a056000100400b0024209e372b8mr36453045wrx.31.1671475170713; Mon, 19 Dec 2022 10:39:30 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id a13-20020adfe5cd000000b0025dac4b615dsm7286790wrn.3.2022.12.19.10.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 10:39:30 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , Phillip Wood , Victoria Dye , Eric Sunshine , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 1/6] cmake: don't copy chainlint.pl to build directory Date: Mon, 19 Dec 2022 19:39:19 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1071.g97ce8966538 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org When [1] made this copy of "chainlint.sed" the script was invoked in the test-lib.sh as: [...] sed -f "$GIT_BUILD_DIR/t/chainlint.sed" [...] But when [2] replaced "chainlint.sed" with a "chainlint.pl" it also replaced that "$GIT_BUILD_DIR" with "$TEST_DIRECTORY", invoking it as: "$PERL_PATH" "$TEST_DIRECTORY/chainlint.pl" "$0" So this line could have been deleted in [2] but wasn't. Let's do that now. 1. 7f5397a07c6 (cmake: support for testing git when building out of the source tree, 2020-06-26) 2. 23a14f30166 (test-lib: replace chainlint.sed with chainlint.pl, 2022-09-01) Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/buildsystems/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 80290edd72a..c641e9349c9 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1106,7 +1106,6 @@ if(NOT ${CMAKE_BINARY_DIR}/CMakeCache.txt STREQUAL ${CACHE_PATH}) file(WRITE ${CMAKE_BINARY_DIR}/CTestCustom.cmake "file(WRITE ${CMAKE_SOURCE_DIR}/GIT-BUILD-DIR \"${CMAKE_BINARY_DIR}\")") #misc copies - file(COPY ${CMAKE_SOURCE_DIR}/t/chainlint.pl DESTINATION ${CMAKE_BINARY_DIR}/t/) file(COPY ${CMAKE_SOURCE_DIR}/po/is.po DESTINATION ${CMAKE_BINARY_DIR}/po/) file(GLOB mergetools "${CMAKE_SOURCE_DIR}/mergetools/*") file(COPY ${mergetools} DESTINATION ${CMAKE_BINARY_DIR}/mergetools/) From patchwork Mon Dec 19 18:39:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13077023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFE4AC10F1B for ; Mon, 19 Dec 2022 18:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232357AbiLSSjk (ORCPT ); Mon, 19 Dec 2022 13:39:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231774AbiLSSje (ORCPT ); Mon, 19 Dec 2022 13:39:34 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49B16194 for ; Mon, 19 Dec 2022 10:39:33 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id f18so9601366wrj.5 for ; Mon, 19 Dec 2022 10:39:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xqD9/NR2+RvjAnZkmSIxBt0Uq5+c6DPssxYU+WTk22Y=; b=RW6P8YoyecNj/oB5+fL93aQ4eU5pHZ9P3vYYeSfk61UmU1VyhpQhJIGdSMlEzdaZgL 7w7dIkVBJRddMHiIWLohPvqYvX0Xl4dlQmEQp/60jHb3ZYxpqP79ByMiKSafnmvoQDc6 4LDNa6d8pOoN/KG4BqMkU/8Gio0+4Lt+qQFazcupXT4Ci7moxjfgZIokV4Ium6cup0K1 W9CCCydg5L1fLQLJr6p4rdBI+JRRWGDtmikx0xfb2JqFM1zBOeSkCzrio/lrvNMvTMsK /m6hLuU/clgckdE5lJ7DJlvMS1A28ZuK9SrwFvX6ccp2gwAWbvdMoboVj1/VVjgs4hvO XuBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xqD9/NR2+RvjAnZkmSIxBt0Uq5+c6DPssxYU+WTk22Y=; b=Gl6tvyu4Y9/gCXyayPeh1gSDdUwkGuBpEYKKkvNV65KCquY0M9oQY/51mmfM5307gK JsEkOkpB5ClXXXjOEpSvWmpkoZKIWehAjWkQ5LHsDt74O3WGEc55MMNHHwcDCLsg1Lgk z/O2nXq3arvCxENc/q6VCDv5X8jqByF2IJ0eqPVJd4aNMFoq5pAbJB1jYDxULQVHnHz8 Hk4ZNab6ECVIVAvz0RbzNJFX3YomJr+5gtDL3YajcOr5x3rxRkgEAxjEjUr/f3NqCqyV ljJ0Z+B8L2DKqbZv/k646wnsVBg90QeH+QyxNv3pw50/rGcOq0JkbYvSZ1jMlis540BA uAFA== X-Gm-Message-State: ANoB5pkwwFhFxbwETvMOOCgwR9yzOh2NpRiku3L6uAlB5AoMiFWBaAO2 /FMGUwTjBZkdK/toSZBsi+Kbn2Bv4KSAzQ== X-Google-Smtp-Source: AA0mqf7ufx2MSTZ8Rfc/mkxMpeq7aqWP9ZSkVR0p0v5M0/sJm6imvkwoUNcD8Sa88RljbFZPouZQDg== X-Received: by 2002:a5d:4890:0:b0:241:fa43:d985 with SMTP id g16-20020a5d4890000000b00241fa43d985mr34770550wrq.12.1671475171567; Mon, 19 Dec 2022 10:39:31 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id a13-20020adfe5cd000000b0025dac4b615dsm7286790wrn.3.2022.12.19.10.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 10:39:30 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , Phillip Wood , Victoria Dye , Eric Sunshine , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 2/6] cmake: set "USE_LIBPCRE2" in "GIT-BUILD-OPTIONS" for test-lib.sh Date: Mon, 19 Dec 2022 19:39:20 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1071.g97ce8966538 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org When we build with libpcre2 which cmake has supported since [1] we need to set "USE_LIBPCRE2='YesPlease'" (or similar) in "GIT-BUILD-OPTIONS". Without this e.g. t7810-grep.sh will fail, as it has tests that rely on the behavior of !PCRE2. The reason this hasn't been noticed is that the Windows CI doesn't have access to libpcre2. With this the remaining two failures we had left after the preceding step are resolved, but note that that test run didn't include the git-p4 tests, which a subsequent commit will address). 1. 80431510a2b (cmake: add pcre2 support, 2022-05-24) Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/buildsystems/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index c641e9349c9..040f5f31230 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1086,6 +1086,9 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PYTHON_PATH='${PYTHON_PATH}'\ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "TAR='${TAR}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_CURL='${NO_CURL}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_EXPAT='${NO_EXPAT}'\n") +if(PCRE2_FOUND) + file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "USE_LIBPCRE2='YesPlease'\n") +endif() file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PERL='${NO_PERL}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PTHREADS='${NO_PTHREADS}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_UNIX_SOCKETS='${NO_UNIX_SOCKETS}'\n") From patchwork Mon Dec 19 18:39:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13077024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D48DC4332F for ; Mon, 19 Dec 2022 18:39:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232369AbiLSSjm (ORCPT ); Mon, 19 Dec 2022 13:39:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231931AbiLSSjf (ORCPT ); Mon, 19 Dec 2022 13:39:35 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E2D2AA for ; Mon, 19 Dec 2022 10:39:34 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id w15so9576289wrl.9 for ; Mon, 19 Dec 2022 10:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DPWjx7VXzMjv7wXvTfbMb1nd3NADOKkCpWsjFrSB1rc=; b=cBk8RrFuSu72A1pmzRciOLT898TawO1qRr7479tyRrHYuKth/IBBPrlnnfWi2FJ8aB J0etMFjAeg6XdNeOJb45lb+AP8WD8wMzn7x4zECGj86Fy7mi4N6ht/yTtsgr+yuGhd+X o4h61HHBR49AJ7JLblayv6XhbECPwt03ghjEzFTS0kCLPcZZMwLc6xWuTJR3WUl+iUaj dY2zV3i+REgklhzn0pV0LZuXpepPHBG30HgJhOSdAxOSqLSepvzTz9RoAcGa6mWrAPgO kKcm5kB1vQjy71Nw+nF4cT02oFNnqZFOxfEK42NPj9qc56Urzmsn+Jf+xFA5iW2P72AD bTNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DPWjx7VXzMjv7wXvTfbMb1nd3NADOKkCpWsjFrSB1rc=; b=CDE/m7QNecKrwZi2y7fE6/ORl2kvPHNMozKHsNTLTn/vVAUqyLkbYtGkKZcSewjGoe k0Bm7y0R2NudidnMZrsPRjlATCYo9q1xFUFyC6iY/Vt0kwOW7mliM22s/lpI8exZyRq7 o3QSIHef5W8lJmLMARKoauGhcVLirMuJMPHA8fzeQp0vibcKi81JM0oVhRG1Cc7QsNQC oy6Zsuwruq/uTXBPWiL75IQojrsyjoLyH+kuAnI9E8KNiejg1uo7DC9kW5vK9l801Jwx 0FTI+F3N8nZYuQra/jtxFHlH8pG77ACaOnbLDpL7b8Zo5k7MJBv3WgI0A7yVfjxeDPLp VFCQ== X-Gm-Message-State: AFqh2krZ433GLBRfH3PG+JtOYoYBJLgFZ+EWSIrgMENZ9U3vsiST6slx uxrLZvtPi/CMDOYZYS4R7D7V6u5Dtc4CBA== X-Google-Smtp-Source: AMrXdXvZg1xYZBytoExl1fse+GQzJaoh1HgTx3j/0tIKna3lNtceaI1Dz1d+x2uaF0gpfbgwp4MD3w== X-Received: by 2002:adf:e410:0:b0:254:9b64:8883 with SMTP id g16-20020adfe410000000b002549b648883mr16655297wrm.21.1671475172514; Mon, 19 Dec 2022 10:39:32 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id a13-20020adfe5cd000000b0025dac4b615dsm7286790wrn.3.2022.12.19.10.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 10:39:32 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , Phillip Wood , Victoria Dye , Eric Sunshine , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 3/6] cmake: increase test timeout on Windows only Date: Mon, 19 Dec 2022 19:39:21 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1071.g97ce8966538 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Per c858750b41c (cmake: increase time-out for a long-running test, 2022-10-18) the reason to set a custom timeout for t7112-reset-submodule.sh is Windows-specific. Let's only do that on Windows then. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/buildsystems/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 040f5f31230..d45b9c8e00a 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1125,8 +1125,10 @@ foreach(tsh ${test_scipts}) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t) endforeach() -# This test script takes an extremely long time and is known to time out even -# on fast machines because it requires in excess of one hour to run -set_tests_properties("${CMAKE_SOURCE_DIR}/t/t7112-reset-submodule.sh" PROPERTIES TIMEOUT 4000) +if(WIN32) + # This test script takes an extremely long time and is known to time out even + # on fast machines because it requires in excess of one hour to run + set_tests_properties("${CMAKE_SOURCE_DIR}/t/t7112-reset-submodule.sh" PROPERTIES TIMEOUT 4000) +endif() endif()#BUILD_TESTING From patchwork Mon Dec 19 18:39:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13077025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75AC7C4332F for ; Mon, 19 Dec 2022 18:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232380AbiLSSjp (ORCPT ); Mon, 19 Dec 2022 13:39:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232134AbiLSSjg (ORCPT ); Mon, 19 Dec 2022 13:39:36 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34D53194 for ; Mon, 19 Dec 2022 10:39:35 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id h12so9567500wrv.10 for ; Mon, 19 Dec 2022 10:39:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=63oeiQDMqgIrLsutQP66d08v98DT5QkEwaVddx+Yxdc=; b=BjfXg41jFGYa2d2AzHc2wHrA/66JdRCNtX2VVhBh9CggSOyQ73PzuZfNmw5wICQI1P gjYTNRSCpOrbg/JDl24vSdEKAZm5pl5zKLi0f7BZgUIF4MLOee3fhCFGyNMqoK4SR9+F M+3LTIoUJFkJFoz21tsnXgdm9fAoEVUtaUjdn7hYJtrMG5LD304DCLHrrx4mWD8r4TnL IFaab5ggwntFo1L/rf+Y0K7uzqIdi6T8mCkRls32KNU01adOKsjMcU/MpK5w6L2xET8o BFTBiWBdUO5l78AucrxTJr5Sy26bF2Q7hw4LFxkCSInan7OPjhcUQb2biP0iWpE4FYDH m0fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=63oeiQDMqgIrLsutQP66d08v98DT5QkEwaVddx+Yxdc=; b=6H/11bJiC+X7hw1V2m79/97grn7zCbNXHDculew8vQOBQLdibRT3Av3cGYYdamJjCR uAGVs4A2pSspyyb5EpPx3cdX79OiPS/+BlImTu+zLUZqaw+PhWqmpGlGZRjtNUlL+oHd Do5Nf/AfPp4IDwkCGKPkDsGMTNkIeQHh6H0UX+0hpZuaGRCSGpFRpgFBNTe6B1KFkPJn B7Ao0TlmhVoWB/tYqa1qUlU5nwWfre0X0YHwnZpgT4vUue6iUJOeB2F6Gvo2Qnz6p9zH sjCMVOdyM2UZssGB9Bekl9es3lk65MFAuViIUFIhqo4mxPLrnHl7mBczRzFQUQ5bVX5R bVeA== X-Gm-Message-State: ANoB5plPlJbcnBT7APv+BAe8BVvGbEczbILj2WJ8DFtjRzo4yzcglRjQ tH0nWqGIo77MZWdStIj05/hLnpowosuSuQ== X-Google-Smtp-Source: AA0mqf6MbuW0mfh9+yiyMvgHXZTjuEzw0EgR2xELUd1jLgRkMGbShglnCNYKsxWh+AJOPPOYH0I8Tg== X-Received: by 2002:adf:e301:0:b0:242:30c8:c36a with SMTP id b1-20020adfe301000000b0024230c8c36amr27072447wrj.45.1671475173451; Mon, 19 Dec 2022 10:39:33 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id a13-20020adfe5cd000000b0025dac4b615dsm7286790wrn.3.2022.12.19.10.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 10:39:32 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , Phillip Wood , Victoria Dye , Eric Sunshine , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 4/6] cmake: only look for "sh" in "C:/Program Files" on Windows Date: Mon, 19 Dec 2022 19:39:22 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1071.g97ce8966538 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Guard the finding of "SH_EXE" in "C:\Program Files" with a check for whether we're on Windows. This Windows-specific code was first added in [1], and later expanded on [2], but since some of that was added this build recipe has been made portable outside of Windows. 1. 72b6eeb81b1 (cmake: do find Git for Windows' shell interpreter, 2020-09-28) 2. 476e54b1c60 (cmake: support local installations of git, 2022-07-27). Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/buildsystems/CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index d45b9c8e00a..560a15ed35a 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -107,10 +107,17 @@ if(USE_VCPKG) set(CMAKE_TOOLCHAIN_FILE ${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file") endif() -find_program(SH_EXE sh PATHS "C:/Program Files/Git/bin" "$ENV{LOCALAPPDATA}/Programs/Git/bin") -if(NOT SH_EXE) - message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one." - "On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/") +if(WIN32) + find_program(SH_EXE sh PATHS "C:/Program Files/Git/bin" "$ENV{LOCALAPPDATA}/Programs/Git/bin") + if(NOT SH_EXE) + message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one." + "You can get it as part of 'Git for Windows' install at https://gitforwindows.org/") + endif() +else() + find_program(SH_EXE sh) + if(NOT SH_EXE) + message(FATAL_ERROR "cannot find 'sh' in '$PATH'") + endif() endif() #Create GIT-VERSION-FILE using GIT-VERSION-GEN From patchwork Mon Dec 19 18:39:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13077027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75C0EC4332F for ; Mon, 19 Dec 2022 18:40:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232215AbiLSSkA (ORCPT ); Mon, 19 Dec 2022 13:40:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232347AbiLSSjh (ORCPT ); Mon, 19 Dec 2022 13:39:37 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27308199 for ; Mon, 19 Dec 2022 10:39:36 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id m14so9585158wrh.7 for ; Mon, 19 Dec 2022 10:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z6YVaFRzsNbkZQybg4GKOCYXlan5Z+iC+DG7Zc/bHrE=; b=HyX4lT3Ij3si+Ka6rBuilJc8U1bLNjkjFrjnoCrAthuwHyYNSa4WXsY3BgIo8xVC0x Pm0FbWg7CyCz/ysU+qIH9oQbIxQQkL5/aOA0KRHZH6RAk+WigW4NhlDYQOORGJL3u+mf BOAqMBQ/4P/gU0cqpQBcpyMW5Zgr1f+K9LyYzIkbda5sxfpUx5xzrYetQWIH8UKCMudq oYC7zON0QoVue3a7BycpXsaUm6zA8EdbGnyo9qQuZp6HXkSK2TmUtJV+Nb25vaAkvzZZ cmMRuSlcEEEBmOZUSwW7ATjjiWCuwp/8MyQjZ4bLh2fDhQou3oNKosLJUgLjzALDaAUT wJYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z6YVaFRzsNbkZQybg4GKOCYXlan5Z+iC+DG7Zc/bHrE=; b=x5q9TGkuJHLJS4lnOtHcseUzzEoNRY31IEqKxsano2kfDFuX1Mf8lD0LNhU0fhVXA9 Z49psPreLljquAJavzDlouc3qw7nF9J+NOutyYBdoWGiXzOfDxGu1ne3Fv9ljaVg2EkH cBKekLGVXGz2G6Vaxz2rbXbX20KZnXGsP5GoIo0oQkzGJm1xWbzGYM/RI1xU8CTqVBtH kgnM2pFgrNKlHtZ8d1fIxEtNth2cka6L+M7M/CD+imPZFD/VOaFfoLs1MHTDVXe/q/eT REqIE9B/ct1cLVA8JTwpBg6gLYsCN+T4fYvaFO1MkBv0IgsErk1URih6WC3lj2MA8pAv eBxQ== X-Gm-Message-State: ANoB5pkwQip2Bk5sci2t+xHa9heMU6DvO+YkBYjpdrVwUs5/zdOvROtn uQKSlGVtb7xsmZUqluyi0EsUVVYvA6l8Gw== X-Google-Smtp-Source: AA0mqf6qFr9FRkwcygtjYmA0HQAnyURr88J5Kkv0wqnI9l8smso+aVzzOctXd4b5HbX8qXNd7dmXQg== X-Received: by 2002:a5d:5b08:0:b0:242:6e5d:c0fb with SMTP id bx8-20020a5d5b08000000b002426e5dc0fbmr28085307wrb.28.1671475174405; Mon, 19 Dec 2022 10:39:34 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id a13-20020adfe5cd000000b0025dac4b615dsm7286790wrn.3.2022.12.19.10.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 10:39:33 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , Phillip Wood , Victoria Dye , Eric Sunshine , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 5/6] cmake: copy over git-p4.py for t983[56] perforce test Date: Mon, 19 Dec 2022 19:39:23 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1071.g97ce8966538 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 --- 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") From patchwork Mon Dec 19 18:39:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13077026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D009C4332F for ; Mon, 19 Dec 2022 18:39:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232421AbiLSSj4 (ORCPT ); Mon, 19 Dec 2022 13:39:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbiLSSjh (ORCPT ); Mon, 19 Dec 2022 13:39:37 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F05FBAA for ; Mon, 19 Dec 2022 10:39:35 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id h11so9551461wrw.13 for ; Mon, 19 Dec 2022 10:39:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gMOWW5c03eR4V5eRVVWvlsYH0kUdIcD2s72yRrq3Png=; b=eq1NWN1z/dEYBIlDL8/JRO+KU5AEOLEpYIyXtyMAfFBGRvTiiGFEbHsh0w8AwJMSZ2 5u2sgk2ki/JdpvpdzB+a8frZYXAbX0H5g2kgzW+wQ7493qa4nHbQVWwiT05fcHW1FE3q bYPiicRN7leJSFM0pneYyLVNcii79b5wCBgSMjVwO2kfgUQ//q+8P1Gf3JXtu6mCSAZn NZrEVdhs3GIw6mMejBcot+TKGG5FvxnShSBmgCv+P6WM7vqTBX0pGDxjsDu/uHYuza0d Dd5Hm1CAkct57r5xRteAfXgmSZbqGs3N+sIA9JYg6lzp47NuXYNuuJWFb+Ixgz7PuOH9 MgqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gMOWW5c03eR4V5eRVVWvlsYH0kUdIcD2s72yRrq3Png=; b=wQaZGlavrLk91sAetHKqAPQyFSx9AQ1jFTGoLo6wYySTelm1/RqXLqm4MzTSs6wkl1 vhJekTJrUqnfO62IXGxzxiIrxlBEtUVZ2BSFRY0RqRB7azKyfMyjZfG7WqVjDguXIgh0 8psKwa3qlSzrnQ/T7Qg2cLg3kk1f6BEK84kPW00SrTGhNGOElB5H3k5Cefc7TTjWgz6e UuJ+odnSmgbGZnWvlsCt2GtW3n/IfwE7ghTiOi779m6lMdrpOW/BJ0+4HG8prb/tphZg mzIWMqG3x65aIgXfBEU/8znB418XHCAblt4ZnTDd5pGUKmdNw11dgki4gnYBuFddi/ri Bqrw== X-Gm-Message-State: ANoB5pnDhHEuvlL0/LSXFVt7c5N/wjQjEwa32pKk6PSc1eXJV+vJuYt+ yg4FwuYw9waAkQZ8PLMmsj/cFYfPuhP08w== X-Google-Smtp-Source: AA0mqf5Xlf+nZn3kW/fRdws6zUZRrOa5swih8dpxjFLV4PneiO7yfFeNjzpp5XJA9/FcMre6RFY3KQ== X-Received: by 2002:a05:6000:1d94:b0:236:770a:665a with SMTP id bk20-20020a0560001d9400b00236770a665amr26837167wrb.66.1671475175214; Mon, 19 Dec 2022 10:39:35 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id a13-20020adfe5cd000000b0025dac4b615dsm7286790wrn.3.2022.12.19.10.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 10:39:34 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin , Phillip Wood , Victoria Dye , Eric Sunshine , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 6/6] cmake: chmod +x the bin-wrappers/* & SCRIPT_{SH,PERL} & git-p4 Date: Mon, 19 Dec 2022 19:39:24 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.1071.g97ce8966538 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Since the cmake file was made to run on *nix in [1] running the tests with "ctest" broken, because we'd attempt to invoke our bin-wrappers/, but they didn't have the executable bit. In the best case, the "t/test-lib.sh" would be unable to find "bin-wrappers/git", and we'd fall back on "GIT_EXEC_PATH=$GIT_BUILD_DIR" using the fallback behavior added in [2]: $ ./t0001-init.sh /t/../contrib/buildsystems/out/bin-wrappers/git is not executable; using GIT_EXEC_PATH This was recently somewhat swept under the rug in [3], as ctest would run them with "--no-bin-wrappers". But still with [3], running e.g.: cmake -S contrib/buildsystems -B contrib/buildsystems/out -DCMAKE_BUILD_TYPE=Debug && make -C contrib/buildsystems/out && ctest --test-dir contrib/buildsystems/out --jobs="$(nproc)" --output-on-failure Fails around 20% of our tests on *nix. So even with [3] we'd fail any test that needed to invoke one of our built shell, perl or Python scripts on *nix. E.g. t0012-help.sh would fail on a test that tried to invoke "git web--browse". The equivalent of this (in the "out" directory) would happen: $ ./git --exec-path=$PWD web--browse git: 'web--browse' is not a git command. See 'git --help'. Which we can fix by "chmod +x"-ing the built "git-web--browse": $ chmod +x git-web--browse $ ./git --exec-path=$PWD web--browse usage: git web--browse [--browser=browser|--tool=browser] [--config=conf.var] url/file ... The same goes for e.g. the "git-p4" tests, which would fail because our built "git-p4" wasn't executable, etc. There's also a few other outstanding issues, which will be fixed in subsequent commits. Ideally we'd use the file(CHMOD ...) form everywhere, but that syntax was introduced in cmake 3.19[4], whereas we only require 3.14. Let's provide a fallback behind a version check, so that we'll eventually be able to delete the "else" part. Both forms result in the same file modes. Before this change: 80% tests passed, 196 tests failed out of 977 After: 99% tests passed, 5 tests failed out of 977 The remaining failures will be addressed in subsequent commits. As this isn't needed on Windows let's skip this there. There's also an unconfirmed (it works in CI) report[5] that invoking the "chmod" command fails in some scenarios. 1. f31b6244950 (Merge branch 'yw/cmake-updates', 2022-06-07) 2. e4597aae659 (run test suite without dashed git-commands in PATH, 2009-12-02) 3. 2ea1d8b5563 (cmake: make it easier to diagnose regressions in CTest runs, 2022-10-18) 4. https://cmake.org/cmake/help/latest/command/file.html#chmod 5. https://lore.kernel.org/git/87f22a55-ee84-2f76-7b9b-924a97f44f89@dunelm.org.uk/ Signed-off-by: Ævar Arnfjörð Bjarmason write script --- contrib/buildsystems/CMakeLists.txt | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 29b73ecbbbc..74b094ae5dc 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -847,6 +847,21 @@ add_custom_command(OUTPUT ${git_links} ${git_http_links} DEPENDS git git-remote-http) add_custom_target(git-links ALL DEPENDS ${git_links} ${git_http_links}) +function(write_script path content) + file(WRITE ${path} ${content}) + + if(WIN32) + message(TRACE "skipping chmod +x '${path}' on Windows") + elseif("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER_EQUAL "3.19") + file(CHMOD ${path} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) + else() + execute_process(COMMAND chmod +x ${path} + RESULT_VARIABLE CHILD_ERROR) + if(CHILD_ERROR) + message(FATAL_ERROR "failed to chmod +x '${path}': '${CHILD_ERROR}'") + endif() + endif() +endfunction() #creating required scripts set(SHELL_PATH /bin/sh) @@ -872,7 +887,7 @@ foreach(script ${git_shell_scripts}) string(REPLACE "# @@BROKEN_PATH_FIX@@" "" content "${content}") string(REPLACE "@@PERL@@" "${PERL_PATH}" content "${content}") string(REPLACE "@@PAGER_ENV@@" "LESS=FRX LV=-c" content "${content}") - file(WRITE ${CMAKE_BINARY_DIR}/${script} ${content}) + write_script(${CMAKE_BINARY_DIR}/${script} "${content}") endforeach() #perl scripts @@ -887,13 +902,13 @@ foreach(script ${git_perl_scripts}) file(STRINGS ${CMAKE_SOURCE_DIR}/${script}.perl content NEWLINE_CONSUME) string(REPLACE "#!/usr/bin/perl" "#!/usr/bin/perl\n${perl_header}\n" content "${content}") string(REPLACE "@@GIT_VERSION@@" "${PROJECT_VERSION}" content "${content}") - file(WRITE ${CMAKE_BINARY_DIR}/${script} ${content}) + write_script(${CMAKE_BINARY_DIR}/${script} "${content}") endforeach() #python script 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}) +write_script(${CMAKE_BINARY_DIR}/git-p4 "${content}") file(COPY ${CMAKE_SOURCE_DIR}/git-p4.py DESTINATION ${CMAKE_BINARY_DIR}/) #perl modules @@ -1032,20 +1047,20 @@ foreach(script ${wrapper_scripts}) file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME) string(REPLACE "@@BUILD_DIR@@" "${CMAKE_BINARY_DIR}" content "${content}") string(REPLACE "@@PROG@@" "${script}${EXE_EXTENSION}" content "${content}") - file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content}) + write_script(${CMAKE_BINARY_DIR}/bin-wrappers/${script} "${content}") endforeach() foreach(script ${wrapper_test_scripts}) file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME) string(REPLACE "@@BUILD_DIR@@" "${CMAKE_BINARY_DIR}" content "${content}") string(REPLACE "@@PROG@@" "t/helper/${script}${EXE_EXTENSION}" content "${content}") - file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content}) + write_script(${CMAKE_BINARY_DIR}/bin-wrappers/${script} "${content}") endforeach() file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME) string(REPLACE "@@BUILD_DIR@@" "${CMAKE_BINARY_DIR}" content "${content}") string(REPLACE "@@PROG@@" "git-cvsserver" content "${content}") -file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content}) +write_script(${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver "${content}") #options for configuring test options option(PERL_TESTS "Perform tests that use perl" ON)