From patchwork Tue Aug 23 08:30:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12951908 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 2A852C32772 for ; Tue, 23 Aug 2022 09:13:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349016AbiHWJNy (ORCPT ); Tue, 23 Aug 2022 05:13:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349189AbiHWJLU (ORCPT ); Tue, 23 Aug 2022 05:11:20 -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 21F9486C24 for ; Tue, 23 Aug 2022 01:31:32 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id ay12so6806756wmb.1 for ; Tue, 23 Aug 2022 01:31:32 -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; bh=uRgabWi8kMFnLk7MySU/fiQXaJR9mqMTeDJYFEoMCgY=; b=EHwxNOxGk/qKAxIkOy1eY+tubuWk9CuxMItTlDN2MUsmi0NMFbHtAq4RxNLwRgu/vz 4i2XfiMjrPywPlzbSVs4o+vt/dOG+3zggBURKKEEvQxfPwaPzO7OD7thtj695ho8wqwg dSu/yZXOmQ1FIftE6rr0HhPqvOgX+9MjkGAKFtnwjB9g9OF9/9P2M0cRc3qxYszuD1lm JExmQz39GKoQvw7NWNNtNQpEXac2yBeN6w//NyUp1XHKLQSPHCA5w68uSMaDtb4hdQH2 UyjTPsXT6TDJII65URT9BcdGmd8CTsJmZeguqANIBttnVwsATWzl8PL9jjp+TCDin7bz 5VVQ== 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; bh=uRgabWi8kMFnLk7MySU/fiQXaJR9mqMTeDJYFEoMCgY=; b=FHhGIl9MZWcn0pA2RDmL0WTp9MSugdwSu5uDTt07OMaWobT2ADoQpOoavK8sy2stfY QedKvmcX0YAxgsKaiWbU2Dsn4V1NQmSb1PlvauuwN6KFwLTYEYsUzyLM7TrLfuAtK7wD CzYC6olDYHSE8+XohO1AOd1FoX1Z+/Vfo7475SY4Dc6Gs7LhQHNFtOgwifmudzdJkKZo vHUIpWFGMThwZ5R+Hh7azvpEbL4rJIH+v3kPdoNYSK/9q/wqMFdq3vteHh+i3df2l8vB aOm74xQPtecPaegu4FZ3kzo/8bzoFJvqCOcSzMSwsnHc6pOjnkAZDKrBmfebvbUFh+iD IMww== X-Gm-Message-State: ACgBeo3efDHPg9Qrq3MzsWYZysR9N1LqqwGrzeOx90WBGDyoNvnMqLpz IXc7y2lgx2LVXxnlUu5ax/8/ORfBqAU= X-Google-Smtp-Source: AA6agR48UNasHT5aoWuuM/cRjxtpmKmkBgf16y3ejVoSGaOT2G0ys6KWqjhP3n1DkYpbkNMDtS0ZEQ== X-Received: by 2002:a05:600c:5022:b0:3a6:ad4:1c6 with SMTP id n34-20020a05600c502200b003a60ad401c6mr1357187wmr.177.1661243466768; Tue, 23 Aug 2022 01:31:06 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a18-20020adfdd12000000b002205cbc1c74sm13536649wrm.101.2022.08.23.01.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 01:31:06 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Tue, 23 Aug 2022 08:30:59 +0000 Subject: [PATCH v2 1/5] cmake: make it easier to diagnose regressions in CTest runs Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Phillip Wood , 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. 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. 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 1b23f2440d8..4aee1e24342 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 Aug 23 08:31:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12951907 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 5429EC32792 for ; Tue, 23 Aug 2022 09:13:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348486AbiHWJNt (ORCPT ); Tue, 23 Aug 2022 05:13:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349203AbiHWJLW (ORCPT ); Tue, 23 Aug 2022 05:11:22 -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 6504D86C29 for ; Tue, 23 Aug 2022 01:31:33 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id u14so16060185wrq.9 for ; Tue, 23 Aug 2022 01:31:32 -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; bh=Q3KJWsUHoyvk83fYpnqq1nuFuvSaE5HztSbDUOVTRRs=; b=gEr5wkQzVRzpUfuyuZ5al7azA1VlQMMZtGh9MgnbgJyNnwJ5Xulcqf2+F96fIVhsKR UF+wwidtq23MWsAAMIc9wtySJDf5YbL12wY9ntz42fFaNoDvcQWEr+H7C2JBhG4js6Ui PgTx9eLpX7C/zZTZLjOKtCZaqzUwjChxA8dQerci6GBPSurVgdVsDKEVuEbrJsS3oHax osMJyGEsbdC9SnoZGUjyCWoVn1fGFPPwu8NzMX3ZN7rkLyjK3z/pvevKrQ5YeER0Cjcv Z/TyQQFIh0SNfyGUUBlRClYj08GtuB27Oo25aKZD22bgZBark01H2tgRuTrpJOjmY3Ev vbnA== 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; bh=Q3KJWsUHoyvk83fYpnqq1nuFuvSaE5HztSbDUOVTRRs=; b=pUC5pfB8P17BAlYZmQNFNNH8xal+gVy2oJhhgOm3ZiS5cS1tyLHg/r3EWgxDOjD+MQ U+p9fvUo4Mtg/bEhPNVmU9Z16uzIdx2aEX0hwOaxij+TntSJp/py1ySQPyc/2WgVnvGq YJuDALmFu3ILhjYxwm6TOb/aSZJl+lgUQGl2aw5csZdkN2+gMa4xI2Zf6CN0l/0U7Zrs fvvQmPHZzRUgQNZQAUh6v4reoQqaGBnTOYo+K8lFAAZicK+5inIBMqZpEiEWnNhkPtYY kJ8HkJf47lJQGFiKRbmyCIPvA2mq5YYOp61+yrqIIePWYjeHgklScl1euaESNulpC4p0 sLiA== X-Gm-Message-State: ACgBeo2zJTAAa3ujzFRnZtBzzNWU0QIwh788zt2ioPwIpTLwCb9mEXTD 0pbPgL0d1VhBFda1076dV1Mn7OSP4Jg= X-Google-Smtp-Source: AA6agR6ECqsfKiD0mYOa+fhHYB10448TShLfHRE7tMTez0zM/Kgm22ULJwZwCPjoFh6cZVIug/l81A== X-Received: by 2002:a05:6000:1182:b0:225:2a9e:77d9 with SMTP id g2-20020a056000118200b002252a9e77d9mr13090257wrx.699.1661243467804; Tue, 23 Aug 2022 01:31:07 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o12-20020a05600c4fcc00b003a5f2cc2f1dsm21036312wmq.42.2022.08.23.01.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 01:31:07 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Tue, 23 Aug 2022 08:31:00 +0000 Subject: [PATCH v2 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 , 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 4aee1e24342..fe606c179f7 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 Aug 23 08:31:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12951909 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 1C14BC32772 for ; Tue, 23 Aug 2022 09:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243689AbiHWJN4 (ORCPT ); Tue, 23 Aug 2022 05:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349206AbiHWJLW (ORCPT ); Tue, 23 Aug 2022 05:11:22 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64A0686C25 for ; Tue, 23 Aug 2022 01:31:33 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id ay39-20020a05600c1e2700b003a5503a80cfso7310244wmb.2 for ; Tue, 23 Aug 2022 01:31:33 -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; bh=08yJomRBoQ6Yjeqi9A3chzlIQeCCUPVSzEQwULp2Unw=; b=bAvRWwPin9Ie5I4MRaoCWzHn914onkB4Gz3bQDjc4dlzuvtf4fiIPeQvz/aJuNj8zd /NNjONkdSt6joe+sJyzWyrE1MyCV8HwGzi3H1osBYuPWvUUcmsPkjmFQyJ3hGZK+uWud Vfz4wvLZiZRfhvIlXpWOVSQxyspLbceQ7BlgT6Ydhpt4NhHmGCQRBxf26RgzJewvbBTI lRkD0CPH6DvZE+I9c6IT2pD+vcskBn9FhLGgHA+obs53cKRtQ+6pC+sTqc5/zA8YqKIV OJimLUPK8/MJ6RmBgMnD11ChJGbbQERwHzno5LPQZIDxpcEmFKdhrRjbtfIPMgfOcmi/ s9Lg== 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; bh=08yJomRBoQ6Yjeqi9A3chzlIQeCCUPVSzEQwULp2Unw=; b=LoM7sXPTVWgeg8uk5xY+0CYlcjP/2u0/urN7AAc8ISjHnPNvb+xV7uXfdVQLHIovoZ sDHeiazU3yu/fDV09zmWHkE54eiWDKaMCllGqAgQT7fniUJi9xNU7qH0psP1RqQyq525 GJMhljkzn8X2yydgdpxlLhyt5feq1r+GQp66gix8ka+6aQ1oOsA3cnYIxpN/EwHdX6yN Z8mgOkg6iNoFpKnd9jyKBlOJqzu6hEgae1EA2h3YnVTbWEAnTE0fPd9GPMzb2RedmS1o HG/vibKBY7frMzJSOPvOMWfMFL+fuPwXOenEkQJRmHf3RaL+PM/vIdNasJzG3ky5nCnO Ngcw== X-Gm-Message-State: ACgBeo3cU1kHmjC9Z98Hz9/t+zKljUVtTW4506ArUFvu5E/r7V+u6kBY h4oBMDuo4MjoGKC+FdX2ye8kHLLqx08= X-Google-Smtp-Source: AA6agR4T+sGq6gMN1HV/2sNRu8EdOV+8ALFy46AeFDc7RZrDBXIuQSz+wyBzN5iztDwzZYn/KUiZlw== X-Received: by 2002:a1c:3b04:0:b0:3a5:487c:6240 with SMTP id i4-20020a1c3b04000000b003a5487c6240mr1414800wma.152.1661243468889; Tue, 23 Aug 2022 01:31:08 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id s4-20020a1cf204000000b003a5f812635asm16365781wmc.39.2022.08.23.01.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 01:31:08 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Tue, 23 Aug 2022 08:31:01 +0000 Subject: [PATCH v2 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 , 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 Aug 23 08:31: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: 12951905 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 7F912C32774 for ; Tue, 23 Aug 2022 09:13:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348961AbiHWJNo (ORCPT ); Tue, 23 Aug 2022 05:13:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349231AbiHWJLZ (ORCPT ); Tue, 23 Aug 2022 05:11:25 -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 64D3D86C28 for ; Tue, 23 Aug 2022 01:31:33 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id ay39-20020a05600c1e2700b003a5503a80cfso7310277wmb.2 for ; Tue, 23 Aug 2022 01:31:33 -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; bh=oqn06qcCx888JqXrAWFrPw6Pt3QXV7A7ysDTY/54nAY=; b=FMRIfLC1QHixgi1btbBqNrWFqVtgbv1jCzL8cmYNZz/0IKhmrFFlECycccJ4cwtOrq BfiLhafOBWzSwoTH2imt6LPFZ+x22it0QMgPPiHHnh+1OuKlvik7WJYKxPFv14nM85UD job5DLyinI3vyXwcamnrE9CX+d+ZaPzhMBa7jDLDIphwtpzM+AsCABs//noQrPoztXk/ ObMwM41n2GVIlBkkvHiidGswDapbVQv6fu7Vk1OEbPaL9cgE5F4RP3xABcs/zLSd2pAg 5HDc5YCXNaeh8f147V0MawRxFu7fz17QQ27qU0Cp2AiNGKt2kE+zOnlWb4zHAvVFtPVL XLXQ== 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; bh=oqn06qcCx888JqXrAWFrPw6Pt3QXV7A7ysDTY/54nAY=; b=2C2QefuOyCTU+wNfLQZGZRx8Vo1/cx2wrUKH4QBZ0kOSJHliIYi5FqsJTgFNeABhiU lhK0RLi/MuWfk/YCUaQHnC1ga8j4g8QRwlvskBqM89BvME2XMuJm5N4Dz4vROUdxZOOR XybizOjN+kNmkzbIij9SpHYsTorx+Y0VYL5kgVxZs9cuikKBmDEZ7YgRn6QOnLNVrF+Q UCgal6WvSmX7DtAJo4PNPvmV51jJTANKNIdJaaZ3W3MqNF873s5bRQSU8oceNQtODqxX UM9FrOP8e3KIT3ou2AQwyWXvk7nzqJk0673AD+oQhwap3FRTo4S4zFUxXsbuUMYUsKKw NtiQ== X-Gm-Message-State: ACgBeo1lC6H1EA9ZvFlqI+lqTiPKha9oe3wB24dL5mE1YI/is1mEvx0e 32szeWydkw1Pi6aKq2uSgorgT9euVl8= X-Google-Smtp-Source: AA6agR47YWBGBlY5PwkrTL1MU7rBgF8lp6klMCpqLk2m+rhYWr80bKJ9uxEvC3e0Wq73RHDOY+doZQ== X-Received: by 2002:a1c:7916:0:b0:3a6:3540:5b3c with SMTP id l22-20020a1c7916000000b003a635405b3cmr1362933wme.178.1661243470083; Tue, 23 Aug 2022 01:31:10 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id h11-20020a05600c350b00b003a63a3b55c3sm14059232wmq.14.2022.08.23.01.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 01:31:09 -0700 (PDT) Message-Id: <22473d6b8f3d4e4c482c27a4fb3b58705d4c93ca.1661243463.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 23 Aug 2022 08:31:02 +0000 Subject: [PATCH v2 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 , 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 | 11 ++++++++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a4522157641..b72ddf09346 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /fuzz_corpora /fuzz-pack-headers /fuzz-pack-idx +/GIT-BUILD-DIR /GIT-BUILD-OPTIONS /GIT-CFLAGS /GIT-LDFLAGS diff --git a/Makefile b/Makefile index 04d0fd1fe60..9347ed90da7 100644 --- a/Makefile +++ b/Makefile @@ -3028,6 +3028,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 fe606c179f7..29d7e236ae1 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 55857af601b..4468ac51f25 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -42,7 +42,16 @@ then TEST_OUTPUT_DIRECTORY=$TEST_DIRECTORY fi GIT_BUILD_DIR="${TEST_DIRECTORY%/t}" -if test "$TEST_DIRECTORY" = "$GIT_BUILD_DIR" +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 +elif test "$TEST_DIRECTORY" = "$GIT_BUILD_DIR" then echo "PANIC: Running in a $TEST_DIRECTORY that doesn't end in '/t'?" >&2 exit 1 From patchwork Tue Aug 23 08:31: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: 12951906 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 48551C32772 for ; Tue, 23 Aug 2022 09:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240373AbiHWJNr (ORCPT ); Tue, 23 Aug 2022 05:13:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349217AbiHWJLW (ORCPT ); Tue, 23 Aug 2022 05:11:22 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEFD94A110 for ; Tue, 23 Aug 2022 01:31:33 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id e20so15581044wri.13 for ; Tue, 23 Aug 2022 01:31:33 -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; bh=V59jbhymdjJGkgMRC+pw9il5wsLo5lKgfJAb6RRGIdk=; b=Q/QQ1h6qW0XbS/3ijkDdP7XWbunLK8D+G6eJ7JkBdFVzW0XcacVaF9GD3ibUm6lT5E tBPDdhBcCjltqUq/rFXR5TsnGEMxdxv2dCADHaizad9HnvUB7jwgMNh46q5YNbd1bDJ3 02fmaalNn27oIt1xomV2lK/SJkKlNDzk2heMh2Vp/HimYUlQDSWcoTQH98cIyAufYQnl HsA4tZfNvUC1RNI1sGO1DIM2dRJS9Nq0tZgm3u93f5yKOjvYYgKGM4eNIfalMYhnGwtd h1/Z3NtS+eFhXv+U0tKZyi+U5n/eafXY2RoS4UeVL6ukvmkByxxa9y4qocXElexiJgl9 vL+Q== 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; bh=V59jbhymdjJGkgMRC+pw9il5wsLo5lKgfJAb6RRGIdk=; b=kGI0OiO38Ub33Mwr1ARDkbgJ8ptm10bggAIPYfXU/wGxQW40zEaFD690+8rCr+NBuQ Da4Wi/YnZGQ7v3m0OAECbF1+XMVCoRk/vgqqFbjct5bjB6g8cUvGrUH3qfviaRoVrRow UqxUSaF0q0RNQ4r9iyc2HIQJtg/r+5iRDKAgcdvhX9n/6+AMEyp8pEcxyRVdfhikE2Hb CtEDpQIyV8yjlO9WDGlCN/dBNYxd+xl1kuQIZYCrqgFNIHfL3KUx0mC7/RHR0gSR2T6A 1QgsCVsVtyfFXqVoWS6fonReRc/kmnKG+WCHVS6sdgqAyfPsf2fzTXaK/QJZZnvftQwd 1XTg== X-Gm-Message-State: ACgBeo3CsBbwksi8yGbqq5hGlKqlnRWGjeVwtW48iUVTOsYo8+Hu1ABj q7A+TreNozM0IvOIRzQJWVDMz3wzaIE= X-Google-Smtp-Source: AA6agR6ixuUNxZ1QbQPpj8kRx3rgoFIxt1xY79DfSxrwn5jJVpWVuYP2bqZXkL+p/wRnZuUEcRIUzQ== X-Received: by 2002:a05:6000:178b:b0:222:c6c4:b42e with SMTP id e11-20020a056000178b00b00222c6c4b42emr13897533wrg.275.1661243471084; Tue, 23 Aug 2022 01:31:11 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z3-20020a05600c0a0300b003a5c2abc412sm24013788wmp.44.2022.08.23.01.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 01:31:10 -0700 (PDT) Message-Id: <6aaa675301cc56081d07974a0eb8662700fe96f8.1661243464.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 23 Aug 2022 08:31:03 +0000 Subject: [PATCH v2 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 , 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 29d7e236ae1..b1306f95256 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