From patchwork Tue Oct 18 10:59:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13010253 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 E22F9C4332F for ; Tue, 18 Oct 2022 10:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbiJRK7Q (ORCPT ); Tue, 18 Oct 2022 06:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbiJRK7L (ORCPT ); Tue, 18 Oct 2022 06:59:11 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA0980BD3 for ; Tue, 18 Oct 2022 03:59:10 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id l32so10450299wms.2 for ; Tue, 18 Oct 2022 03:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:fcc:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=JEj13aDBcZ+qGqPB4u07gMH3+zEFKRTB1kYVmy2u0vs=; b=XYQ23By1TT1gCfC+IABzDe3nN/Od5bBvK5C4DauaLExguOQIcswLYMA/SQoMg/JwvE pjGJfJ5B/gNVCaPczx4vFDO8liSO8eNJ32ZrCIife/0RwksUHj06NIbMhaEpucZuosM2 EH+iNUTdCuHtJNDYASqrT4CKLIUYOkVHnGJ4F/OOmrcfi2kNT3AW+fUROGw+ZTWW9RaP rfh2t65Hgw6yaXRg5AL5bGxynr4sGi7IE21ETsXaWB16cK9XEJv4OAprxGkOmaA2F8+A RofPMPJyyffi1lIo7PWe2eBcL9uefLumn3g8dGBf14QtnbOqAalzfhyJpl254Yb4mR3O QT2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:fcc:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JEj13aDBcZ+qGqPB4u07gMH3+zEFKRTB1kYVmy2u0vs=; b=oH3S/tSkSFdSyhOqin3/80JBVSEUBxESJ1ZaMP5QSuKg7ADYZqzl+LWzdnzYrjeElZ EZTHWr7sR4IXH9zqgrpfJztBpq9eDMRR6gQN22VZvpfU/iWJ5+ZDW9+SyfUYqwGfhSg+ GrXV4N4tTiBQ2X/tTlXBeFcbK4MzWwTGhZv+bPG7ASQBISOjNqbQSn4EayI/RkLWKcMB aYFwrdUO1RjgN7XWZhjhFUTyzR+/gvVECy0RqC52pKrRPvdIk1KAO//PEUIgx9tcvyT4 JShSX4oE8UHZehfaNWVc21eT61Wlc4IQ0O4FyF5YPC93wcbnbA6lGOAYnSIMgKhuUaic 2nRg== X-Gm-Message-State: ACrzQf25maL7ccMAdtK9W49ymJeXGFmFtZyEXDN0LVSIh9C/aI+gzeET zu7V5rErKhc42kfWNueun9azvkThwps= X-Google-Smtp-Source: AMsMyM7BlKFVs5LVxlS08dWWFRdrYCyUiIvZOoDuGM2Um0bfC0mpmEocVfSFCrngiWyc5+CiEP1hAA== X-Received: by 2002:a05:600c:3b99:b0:3c6:8b8e:a624 with SMTP id n25-20020a05600c3b9900b003c68b8ea624mr1551278wms.113.1666090748725; Tue, 18 Oct 2022 03:59:08 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id w3-20020adfee43000000b0022add5a6fb1sm10687523wro.30.2022.10.18.03.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 03:59:08 -0700 (PDT) Message-Id: <356b2e9a1007bcd1382f26f333926ff0d5b9abe2.1666090745.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 18 Oct 2022 10:59:01 +0000 Subject: [PATCH v3 1/5] cmake: make it easier to diagnose regressions in CTest runs MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Phillip Wood , Victoria Dye , Eric Sunshine , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin When a test script fails in Git's test suite, the usual course of action is to re-run it using options to increase the verbosity of the output, e.g. `-v` and `-x`. Like in Git's CI runs, when running the tests in Visual Studio via the CTest route, it is cumbersome or at least requires a very unintuitive approach to pass options to the test scripts: the CMakeLists.txt file would have to be modified, passing the desired options to _all_ test scripts, and then the CMake Cache would have to be reconfigured before running the test in question individually. Unintuitive at best, and opposite to the niceties IDE users expect. So let's just pass those options by default: This will not clutter any output window but the log that is written to a log file will have information necessary to figure out test failures. While at it, also imitate what the Windows jobs in Git's CI runs do to accelerate running the test scripts: pass the `--no-bin-wrappers` and `--no-chain-lint` options. This makes the test runs noticeably faster because the `bin-wrappers/` scripts as well as the `chain-lint` code make heavy use of POSIX shell scripting, which is really, really slow on Windows due to the need to emulate POSIX behavior via the MSYS2 runtime. In a test by Eric Sunshine, it added two minutes (!) just to perform the chain-lint task. The idea of adding a CMake config option (รก la `GIT_TEST_OPTS`) was considered during the development of this patch, but then dropped: such a setting is global, across _all_ tests, where e.g. `--run=...` would not make sense. Users wishing to override these new defaults are better advised running the test script manually, in a Git Bash, with full control over the command line. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 2237109b57f..6ac20bc5054 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1088,7 +1088,7 @@ file(GLOB test_scipts "${CMAKE_SOURCE_DIR}/t/t[0-9]*.sh") #test foreach(tsh ${test_scipts}) add_test(NAME ${tsh} - COMMAND ${SH_EXE} ${tsh} + COMMAND ${SH_EXE} ${tsh} --no-bin-wrappers --no-chain-lint -vx WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t) endforeach() From patchwork Tue Oct 18 10:59:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13010254 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 C3941C433FE for ; Tue, 18 Oct 2022 10:59:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229990AbiJRK7U (ORCPT ); Tue, 18 Oct 2022 06:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbiJRK7N (ORCPT ); Tue, 18 Oct 2022 06:59:13 -0400 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 F09A018B08 for ; Tue, 18 Oct 2022 03:59:11 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id w18so22839262wro.7 for ; Tue, 18 Oct 2022 03:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=z0tMKdv7eU70aifszClnd20mLEDmV7jo+jeNIIrwvS0=; b=dD1NZ2fuQ3OMCY9BzEghk4zGLWr3903zndfB0Fb0/khEXrJ+YyDHfNcZCvkdLtr4kj mfX6Ji64bYIAtDSDmPkOmvA4/U6V28XlljaFzGx/jv/sclb8o/8/4e1MGDcqYEmFYx2P iCaijnG4MbrG58NsJyzzjsp/o9VbK4flbMqECPALPaXryT1LU8V+4pNvaxYUGPeL1/qB BJFwI5RXgXMCk14us8093yt1QzVndJYX6LvfG4T+pa1j3aYW2O/46dVoebXZ5h+kumbD vUWouE7nZZC69yzpDoce9+kCqlZGPbt/1g+DK6nI8V1YDxH/Gd/8yxdesxeN8NKlmc+Q cl6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z0tMKdv7eU70aifszClnd20mLEDmV7jo+jeNIIrwvS0=; b=ahyeW4uVnXth9N+efMM2V49cJltEdJHlicD32qc9eBPw2ji01+/KvN+cWEFD1jK6S/ EH5N1+pqy4LFjeUeOlbK0OxgCP4z5YpDt5jsMUfkOGTr6qNZ8F40oWfLX3l2o5cs6L0J 18y+TlyCdfNJPEC8bcequpBQt1GAbDNtpd0EnKjtPF2A2/hgqeaA5Blgopokj4WQTllf x8LXiCUL5IvDSdzCb9eYcSGQ9MyANUgZKY30oASeq8qWoPPgMYLRlT1P1fQFeAwOFoFp kIlP50eVufj4VwX86ECZNDamMdyZBfAxp7Q97ET8MX/bzSPC4DR4qbZPHNqZ7huCkf6V WMIw== X-Gm-Message-State: ACrzQf0/uuOp+6UDI1Iv1zJSS4aOslwELhvxufWGHpv72JkJgb3JhJy8 j6UvLQcTl6uWnkIOSC8hR0Nk1BgATI0= X-Google-Smtp-Source: AMsMyM74bQvvti44mzVtMb3anq8E/m8/rxGlstJ4XEh9MKLTfTs20hAnDE8fZF/CxL6ELPbVRpqsJQ== X-Received: by 2002:adf:e18b:0:b0:22e:a2ce:7746 with SMTP id az11-20020adfe18b000000b0022ea2ce7746mr1498600wrb.468.1666090749943; Tue, 18 Oct 2022 03:59:09 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u6-20020adfeb46000000b002258235bda3sm10649042wrn.61.2022.10.18.03.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 03:59:09 -0700 (PDT) Message-Id: <9faca9d5cbe706c00d03ca2a125f2e113294a548.1666090745.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 18 Oct 2022 10:59:02 +0000 Subject: [PATCH v3 2/5] cmake: copy the merge tools for testing Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Phillip Wood , Victoria Dye , Eric Sunshine , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin Even when running the tests via CTest, t7609 and t7610 rely on more than only a few mergetools to be copied to the build directory. Let's make it so. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 6ac20bc5054..0c741e7d878 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1078,7 +1078,8 @@ if(NOT ${CMAKE_BINARY_DIR}/CMakeCache.txt STREQUAL ${CACHE_PATH}) #misc copies file(COPY ${CMAKE_SOURCE_DIR}/t/chainlint.sed DESTINATION ${CMAKE_BINARY_DIR}/t/) file(COPY ${CMAKE_SOURCE_DIR}/po/is.po DESTINATION ${CMAKE_BINARY_DIR}/po/) - file(COPY ${CMAKE_SOURCE_DIR}/mergetools/tkdiff DESTINATION ${CMAKE_BINARY_DIR}/mergetools/) + file(GLOB mergetools "${CMAKE_SOURCE_DIR}/mergetools/*") + file(COPY ${mergetools} DESTINATION ${CMAKE_BINARY_DIR}/mergetools/) file(COPY ${CMAKE_SOURCE_DIR}/contrib/completion/git-prompt.sh DESTINATION ${CMAKE_BINARY_DIR}/contrib/completion/) file(COPY ${CMAKE_SOURCE_DIR}/contrib/completion/git-completion.bash DESTINATION ${CMAKE_BINARY_DIR}/contrib/completion/) endif() From patchwork Tue Oct 18 10:59:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13010255 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 A6376C4332F for ; Tue, 18 Oct 2022 10:59:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbiJRK7W (ORCPT ); Tue, 18 Oct 2022 06:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbiJRK7O (ORCPT ); Tue, 18 Oct 2022 06:59:14 -0400 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 E530580BD3 for ; Tue, 18 Oct 2022 03:59:12 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id bv10so22861378wrb.4 for ; Tue, 18 Oct 2022 03:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=08yJomRBoQ6Yjeqi9A3chzlIQeCCUPVSzEQwULp2Unw=; b=l9sAOUdfcf5kehSQ46vDvY633TE1c4LjNtjCww2ccCbWFu7WXXS9F0DDxmjk07JP+S 9KSjI4xlcPB6B9p50t0PELFLwkLcjuZw/NgU3IOVWglGABlV5M8cZYYLcniCaLFnqx8d aUZmVwZK199myZN+G1MGHZtXHXOOmGv68PFL76j/3GbhSHNm4NIRv+MSOKVjXkIf4/Cm XI5Q7ljdzcDbbSUdvrsaUj3Xwu5jyZN67+Di9AU3GWiQGQMa1eZgpYNP855sdGqYogAZ 0ZU17MdaJza3Q27u5h1bmJPV7j4zdsEM+evhV3euYJrLFRWhROnwhiUpWzDasVStjdMC nASA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=08yJomRBoQ6Yjeqi9A3chzlIQeCCUPVSzEQwULp2Unw=; b=KWRiSwmmNYfBsMO1G/yFet1fdpp1uE1wUNhN3w2SRxE8Y1rcpN24ihOG3yPq2UUxfr FL1bR1g1OUcEXoN5OYK65I9ctcWav2E+1T1NSKh0jsh0ZTR7ReztsMNP8S1+v+2Td+PZ TQqjPbm1JyTj0zzCA04a8M6Jjd5Cvrn/AkTh1KR63UsnT+hrnx9DhWLjDyqzvtdtYyl1 HQfTVVZ0l09ml2QitQn37FGfstkKcdQWlI42hPJL3dSLOZO81T61DPzh3nhH6alPPI+B OmbGltipq9kd9/14JonChdh9FZU6lOeWoB9iQImZrVwnImzN93f0SKs52jZrVUWyLQ6v oDrQ== X-Gm-Message-State: ACrzQf2WhrN5WoEa0+0Q17S7BKMtImhaS3WDfTxvnFaPk+/WKPDv5UL9 NTPb9joR98W6Jq+Aml6HazFAqBmX1Lg= X-Google-Smtp-Source: AMsMyM4SybDLdpTdYtixc0OcjaKRcjydrT8+kdriDSKgGQzzGkyYwvIv5Ibkq7aEVtpjdRgqonEXNA== X-Received: by 2002:a5d:4950:0:b0:230:cc5a:f6b0 with SMTP id r16-20020a5d4950000000b00230cc5af6b0mr1498501wrs.656.1666090751292; Tue, 18 Oct 2022 03:59:11 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id i20-20020a05600c481400b003a6125562e1sm12426081wmo.46.2022.10.18.03.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 03:59:10 -0700 (PDT) Message-Id: <41a8021a4bd09e1470d04ec11d392777d4f5824f.1666090745.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 18 Oct 2022 10:59:03 +0000 Subject: [PATCH v3 3/5] add -p: avoid ambiguous signed/unsigned comparison Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Phillip Wood , Victoria Dye , Eric Sunshine , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In the interactive `add` operation, users can choose to jump to specific hunks, and Git will present the hunk list in that case. To avoid showing too many lines at once, only a maximum of 21 hunks are shown, skipping the "mode change" pseudo hunk. The comparison performed to skip the "mode change" pseudo hunk (if any) compares a signed integer `i` to the unsigned value `mode_change` (which can be 0 or 1 because it is a 1-bit type). According to section 6.3.1.8 of the C99 standard (see e.g. https://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf), what should happen is an automatic conversion of the "lesser" type to the "greater" type, but since the types differ in signedness, it is ill-defined what is the correct "usual arithmetic conversion". Which means that Visual C's behavior can (and does) differ from GCC's: When compiling Git using the latter, `add -p`'s `goto` command shows no hunks by default because it casts a negative start offset to a pretty large unsigned value, breaking the "goto hunk" test case in `t3701-add-interactive.sh`. Let's avoid that by converting the unsigned bit explicitly to a signed integer. Note: This is a long-standing bug in the Visual C build of Git, but it has never been caught because t3701 is skipped when `NO_PERL` is set, which is the case in the `vs-test` jobs of Git's CI runs. Signed-off-by: Johannes Schindelin --- add-patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add-patch.c b/add-patch.c index 509ca04456b..3524555e2b0 100644 --- a/add-patch.c +++ b/add-patch.c @@ -1547,7 +1547,7 @@ soft_increment: strbuf_remove(&s->answer, 0, 1); strbuf_trim(&s->answer); i = hunk_index - DISPLAY_HUNKS_LINES / 2; - if (i < file_diff->mode_change) + if (i < (int)file_diff->mode_change) i = file_diff->mode_change; while (s->answer.len == 0) { i = display_hunks(s, file_diff, i); From patchwork Tue Oct 18 10:59:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13010256 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 C9625C433FE for ; Tue, 18 Oct 2022 10:59:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229967AbiJRK7h (ORCPT ); Tue, 18 Oct 2022 06:59:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbiJRK7R (ORCPT ); Tue, 18 Oct 2022 06:59:17 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 954DDB1DED for ; Tue, 18 Oct 2022 03:59:14 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id y10so10465368wma.0 for ; Tue, 18 Oct 2022 03:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Pfgl4E0nDpcq6VgmFXsgjzOUpD0wiXOTzccdHRZVp5o=; b=TVCtrXnJorAY3qgoCgpYwqHuWeGyA/YwxDHvTPt9dMWLIJDXJnqFLQE108zVZNxIF1 MeTdPPBRmr3Hy8wDzJnHLS2kRby2y9jMzkQ1NSWCXyeGN0rWp5bLZ2iva/d6SUZC9svm rCqznMVox6Zo++1WpzKgaK08leqlPLahVbYm904f2QNGrgg6eGk3c3Ds6wNdnmLmBeTk 2ZC8pTtJzVLTUTTQm+cEqIHHKm/+axNZOlH/AK4kMj87O7KWTufNfWx0Qyjx0Q0P64SU tXrZpElK9qr7s3Yw6uqAqodZVrtQFncavmpfMHTe+HVtvG0gz+JBWqdMPn3XB8SHIKT6 KBsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pfgl4E0nDpcq6VgmFXsgjzOUpD0wiXOTzccdHRZVp5o=; b=uinQCpWKH2NDSK3Hh6HrsAT71qT1qJOFKaA5oAnorAOaHU9yeRKcxmTvcL3x+OkQA0 cUMzP6A77AtNssRe/BxdaET7bHyKiFV7YoZR8fOj3yvLJtKDDsbxY7wwU0u+Zd+tU+VV bW/ojAezf24TKhllpDRTyhZopD9tYLOzkuOre6B3n2Lgrln8yy5efPxMj8cE2z0KQSW+ QVjNx4RgupiwVT4Id4PP+rOt+SQdKEC7EnFGx4hIkeCuchjnYyXxSyc2PTY1a5AXBYe/ 9xD+w9g1dxnEsrkWUMViQF6GuQGgGC+/Hk0wZTk5Wc5XSknmpemq0rHEv59T9Ex3mjiG Ns+w== X-Gm-Message-State: ACrzQf30sLBXTS6q+FjqFuAyWTCg0u3gsk2H6xbTbX+Z6QcRSOwk80uq H10oCtv9na3YpQ/yvGhclvk4CRn72Ck= X-Google-Smtp-Source: AMsMyM7FPe03gDfq4gd7n4gNV155Yk4Zrv4uP+ZXzIY8t54a6XEfK4uuhPDRYqwQoIh2ozEEGCEhyw== X-Received: by 2002:a05:600c:538a:b0:3c6:c223:7ec5 with SMTP id hg10-20020a05600c538a00b003c6c2237ec5mr1585791wmb.37.1666090752726; Tue, 18 Oct 2022 03:59:12 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id v2-20020a5d4b02000000b0022ed6ff3a96sm10646959wrq.39.2022.10.18.03.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 03:59:11 -0700 (PDT) Message-Id: <5b0c2a150e9fce1ca0284d65628b42ed5a7aad9a.1666090745.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 18 Oct 2022 10:59:04 +0000 Subject: [PATCH v3 4/5] cmake: avoid editing t/test-lib.sh Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Phillip Wood , Victoria Dye , Eric Sunshine , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 7f5397a07c6c (cmake: support for testing git when building out of the source tree, 2020-06-26), we implemented support for running Git's test scripts even after building Git in a different directory than the source directory. The way we did this was to edit the file `t/test-lib.sh` to override `GIT_BUILD_DIR` to point somewhere else than the parent of the `t/` directory. This is unideal because it always leaves a tracked file marked as modified, and it is all too easy to commit that change by mistake. Let's change the strategy by teaching `t/test-lib.sh` to detect the presence of a file called `GIT-BUILD-DIR` in the source directory. If it exists, the contents are interpreted as the location to the _actual_ build directory. We then write this file as part of the CTest definition. To support building Git via a regular `make` invocation after building it using CMake, we ensure that the `GIT-BUILD-DIR` file is deleted (for convenience, this is done as part of the Makefile rule that is already run with every `make` invocation to ensure that `GIT-BUILD-OPTIONS` is up to date). Signed-off-by: Johannes Schindelin --- .gitignore | 1 + Makefile | 1 + contrib/buildsystems/CMakeLists.txt | 7 +------ t/test-lib.sh | 10 ++++++++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 73df7295795..89ad7e68b4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /fuzz_corpora +/GIT-BUILD-DIR /GIT-BUILD-OPTIONS /GIT-CFLAGS /GIT-LDFLAGS diff --git a/Makefile b/Makefile index 88178c5b466..886614340c7 100644 --- a/Makefile +++ b/Makefile @@ -3029,6 +3029,7 @@ else @echo RUNTIME_PREFIX=\'false\' >>$@+ endif @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi + @if test -f GIT-BUILD-DIR; then rm GIT-BUILD-DIR; fi ### Detect Python interpreter path changes ifndef NO_PYTHON diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 0c741e7d878..1d8cebb4cfe 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1067,14 +1067,9 @@ endif() #Make the tests work when building out of the source tree get_filename_component(CACHE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../CMakeCache.txt ABSOLUTE) if(NOT ${CMAKE_BINARY_DIR}/CMakeCache.txt STREQUAL ${CACHE_PATH}) - file(RELATIVE_PATH BUILD_DIR_RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/CMakeCache.txt) - string(REPLACE "/CMakeCache.txt" "" BUILD_DIR_RELATIVE ${BUILD_DIR_RELATIVE}) #Setting the build directory in test-lib.sh before running tests file(WRITE ${CMAKE_BINARY_DIR}/CTestCustom.cmake - "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh GIT_BUILD_DIR_REPL REGEX \"GIT_BUILD_DIR=(.*)\")\n" - "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh content NEWLINE_CONSUME)\n" - "string(REPLACE \"\${GIT_BUILD_DIR_REPL}\" \"GIT_BUILD_DIR=\\\"$TEST_DIRECTORY/../${BUILD_DIR_RELATIVE}\\\"\" content \"\${content}\")\n" - "file(WRITE ${CMAKE_SOURCE_DIR}/t/test-lib.sh \${content})") + "file(WRITE ${CMAKE_SOURCE_DIR}/GIT-BUILD-DIR \"${CMAKE_BINARY_DIR}\")") #misc copies file(COPY ${CMAKE_SOURCE_DIR}/t/chainlint.sed DESTINATION ${CMAKE_BINARY_DIR}/t/) file(COPY ${CMAKE_SOURCE_DIR}/po/is.po DESTINATION ${CMAKE_BINARY_DIR}/po/) diff --git a/t/test-lib.sh b/t/test-lib.sh index 120f11812c3..dfc0144ed3b 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -47,6 +47,16 @@ then echo "PANIC: Running in a $TEST_DIRECTORY that doesn't end in '/t'?" >&2 exit 1 fi +if test -f "$GIT_BUILD_DIR/GIT-BUILD-DIR" +then + GIT_BUILD_DIR="$(cat "$GIT_BUILD_DIR/GIT-BUILD-DIR")" || exit 1 + # On Windows, we must convert Windows paths lest they contain a colon + case "$(uname -s)" in + *MINGW*) + GIT_BUILD_DIR="$(cygpath -au "$GIT_BUILD_DIR")" + ;; + esac +fi # Prepend a string to a VAR using an arbitrary ":" delimiter, not # adding the delimiter if VAR or VALUE is empty. I.e. a generalized: From patchwork Tue Oct 18 10:59:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13010257 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 5ED96C433FE for ; Tue, 18 Oct 2022 10:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbiJRK7j (ORCPT ); Tue, 18 Oct 2022 06:59:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbiJRK7R (ORCPT ); Tue, 18 Oct 2022 06:59:17 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF0A480BD3 for ; Tue, 18 Oct 2022 03:59:15 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id i82-20020a1c3b55000000b003c6c154d528so268872wma.4 for ; Tue, 18 Oct 2022 03:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=c7I87zxy1YkseDheQ3ObpIeu2VPLv1trvSuTyDBxiow=; b=f8DWgNuz0HrbmzLLvIqt3iY73+FidpO2XhAZOQXw2CokY4kpKlkfMFcqRi/OHlA7oL k0QF13DR5xtnP8Xls9PDDnIgsNHJxYD5PVj8DOMhSxRTtsH/0EyhilNwI/R00t9/qL// LkD37vvVnj4sq9wzyg1VkLQpvZvcWJytLQSnOkqVL1+dFcGf3VTy2xWkDXW7vPd6gOec RS3oIleVpYXPZaQycCPPLQLxbV6lUJmKpvPXo2Hww5WEwJmz7PtaBZx+kFgw1CrJtiN4 4tIi24KDRX56+gmCYm4phU5LQdfwMyKWqhq5Y6A5lBderMsV4Vje4bUGn/QDWj8LXC6g 6xeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c7I87zxy1YkseDheQ3ObpIeu2VPLv1trvSuTyDBxiow=; b=Wnnyo2Kpw5MLWRSkMAEOedgDsXbEAsMAAj10kHzmwwK0pCcv1uU4tdMeerWI9FZ+wC mitFGPXmOAytx+WdBcwviLRbbo1Hn10FHBIan+7PQn+gwMBwu0OGZdliKBlrYgakmUJq e1brV6MQ6ExWhHcuT3GXOzCnRGBUlOdzJt9Vw/KrGJYBLEyVdB1Hu4PHtrFnV3VTgB71 lNbPwQRQbwEF9FqdGtyGjE7TsuAmRvJArc/wwLBgUOwb54xtymzHHpSWm6DYDS6q3BVs z3NJGL7rMMGMgw0ckWHxcQao/1FumOwvIt4A17mEmfaPpLYGr+wW06MP75nrj8+Or8Rf K8ZA== X-Gm-Message-State: ACrzQf0uAtTnbh8ZTw3ksnvXNiRX77M8J5kU7dmLNS5nlxH5Y+3hCRU3 VY1wqlxRUx2VccSqqe3lti1x3XnSHiY= X-Google-Smtp-Source: AMsMyM6p+V6nXpJg2hibyfASkDLDgUUZGxqdN7KTanaRyorv9qUds/MtUtuxqAR5FbsP8vKVlwoz8Q== X-Received: by 2002:a05:600c:3384:b0:3c6:f25a:96e9 with SMTP id o4-20020a05600c338400b003c6f25a96e9mr9763399wmp.112.1666090753721; Tue, 18 Oct 2022 03:59:13 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o5-20020a5d62c5000000b00228cbac7a25sm10846771wrv.64.2022.10.18.03.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 03:59:13 -0700 (PDT) Message-Id: <40cf872f48386f8eca0fa814e4cdfb0ded915ed8.1666090745.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 18 Oct 2022 10:59:05 +0000 Subject: [PATCH v3 5/5] cmake: increase time-out for a long-running test Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Phillip Wood , Victoria Dye , Eric Sunshine , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin As suggested in https://github.com/git-for-windows/git/issues/3966#issuecomment-1221264238, t7112 can run for well over one hour, which seems to be the default maximum run time at least when running CTest-based tests in Visual Studio. Let's increase the time-out as a stop gap to unblock developers wishing to run Git's test suite in Visual Studio. Note: The actual run time is highly dependent on the circumstances. For example, in Git's CI runs, the Windows-based tests typically take a bit over 5 minutes to run. CI runs have the added benefit that Windows Defender (the common anti-malware scanner on Windows) is turned off, something many developers are not at liberty to do on their work stations. When Defender is turned on, even on this developer's high-end Ryzen system, t7112 takes over 15 minutes to run. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 1d8cebb4cfe..7e0d040e0f6 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1088,4 +1088,8 @@ 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) + endif()#BUILD_TESTING