From patchwork Thu Jul 14 19:39:38 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: 12918461 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 ADB25C43334 for ; Thu, 14 Jul 2022 19:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240604AbiGNTj7 (ORCPT ); Thu, 14 Jul 2022 15:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237368AbiGNTj5 (ORCPT ); Thu, 14 Jul 2022 15:39:57 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 704F425599 for ; Thu, 14 Jul 2022 12:39:54 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id r10so3922655wrv.4 for ; Thu, 14 Jul 2022 12:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m1+b/mnR2nC4WSiSaWFef9CZN7ZruRY83nx+6ywzNsE=; b=EUWcaEYxjf+PctysJKJGEEGAnPH7Vst1KmniX2CgxEXzd8auRvlGcZji9qb1LdJBkQ pidWrjiEA6SyKqhmvJrnikBzAW4pW+UEkNZq0pd6EimlR2OFQWtfgxaN/T/HlIBfpsJw YhQYt79zHZRU/m69c4Zwce7c3exgtcdzjWdvy0FmRFjWHfj0NsPFcwKLRaR7bnDjnQ1C fMoMTTecnv+cIrxoicoDx+QkvS8h4DALZNYVw4JBxaGgE0QqZmr3mXYupY6f/ape+5zG OoSThzQyNKgcKq9ii4DgEsLSZHC42H/aDA+A/g2zYk55iPBwYy/l2NK4DlP4A79jFJij PeHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m1+b/mnR2nC4WSiSaWFef9CZN7ZruRY83nx+6ywzNsE=; b=ycKjMAfTrfWY8BTlxrp8i01M/3NdqNWDcVVRMHJBwVVvdjEziLwS9Ng37yEanjuHAu C/i+FWsTihNoNJp+xBcGIepfwMWHojo613YSO2p3fRZ4Qct77rLVfuATQkBBeCoL+FfT VsebG2tkeC0cKHIl68cziM9yz449KcOry33d/+4u8bH9eerAprLGss0AEHv4tvT7kNY/ H3wbmiwJ+0rqvumdajvNTY0zr9mL8BgOm387NqufI071WYNt6FZHKyRiswZvch81wd+e nJydaIQwz78kpTsQuIFEacQHn83tQMN5TjOOgsJGJJpWn440hOcZrDLVU5s0N4FYHMQ0 gQww== X-Gm-Message-State: AJIora+RNcjJXiYi4wTr0A5dz6cFhLcpvY9hA4j4ySkDwF7lsqWibzcQ Wr85rXdh3plzXau58sIkYziClMBiSKWV+w== X-Google-Smtp-Source: AGRyM1sRpNS0jk7sNSsm7fjuMSZS+vO1h6JynAeBGEui5MBaLSzvgRzx3LnuH56VOXOelW+34papiw== X-Received: by 2002:a05:6000:1210:b0:21d:7d54:45cf with SMTP id e16-20020a056000121000b0021d7d5445cfmr9203304wrx.639.1657827592571; Thu, 14 Jul 2022 12:39:52 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:39:52 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 01/10] CI: run "set -ex" early in ci/lib.sh Date: Thu, 14 Jul 2022 21:39:38 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change ci/lib.sh to run "set -e" before it does anything else, this help us to assert that we have no failing commands early on in the file. While we're at it let's fix a stray typo in ecaba2ad4c0 (ci/run-build-and-tests: add some structure to the GitHub workflow output, 2022-05-21), which seemingly added "#" to the middle of a line while re-wrapping a comment. Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/lib.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index f095519f8db..4f12bcaabb9 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -1,5 +1,13 @@ # Library of functions shared by all CI scripts +# Set 'exit on error' for all CI scripts to let the caller know that +# something went wrong. +# +# We'll enable "set -x" below for tracing executed commands, that will +# help to show how environment variables are set and and dependencies +# are installed. +set -e + if test true != "$GITHUB_ACTIONS" then begin_group () { :; } @@ -44,13 +52,6 @@ else begin_group "CI setup" fi -# Set 'exit on error' for all CI scripts to let the caller know that -# something went wrong. -# -# We already enabled tracing executed commands earlier. This helps by showing -# how # environment variables are set and and dependencies are installed. -set -e - skip_branch_tip_with_tag () { # Sometimes, a branch is pushed at the same time the tag that points # at the same commit as the tip of the branch is pushed, and building From patchwork Thu Jul 14 19:39:39 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: 12918463 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 267E8C433EF for ; Thu, 14 Jul 2022 19:40:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240647AbiGNTkD (ORCPT ); Thu, 14 Jul 2022 15:40:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231500AbiGNTj6 (ORCPT ); Thu, 14 Jul 2022 15:39:58 -0400 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 13D822A416 for ; Thu, 14 Jul 2022 12:39:56 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id r14so3936075wrg.1 for ; Thu, 14 Jul 2022 12:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V91dvfWnHDATESKUq6V1HP5ZKYjWEgYrFH4URvLY1Vg=; b=fJr7ca+iSRdDoycX7UQna/GV2kfEP9uhTzoidpnqYB9rF6ZpHGsH/+l9zXYrYP8k1i rBJpMvuntVgoTKgDdmNn9kTzxRWKcVH8/GKO7RDrBGy5tW0M4EENPBBd5la87o1qigCe lwowUGbliBJHU0m+fRYTT6CGtGBev1QKKwooEDweoc8QlyN1r52xLBJbtqllWjrU+REj B2AkJ/L+1yKzTsS9O1lqG7O0hta+SbYpw98Gxit/yinGmG06g3kXS/PyP5Y6MS94W6oc 8PQb6dpLHk5JuU58WJzN4qPSQ2NmXchbSoiIHDH61NvTosVM74NwEWt5bJ8Cz/rj1geD sH3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V91dvfWnHDATESKUq6V1HP5ZKYjWEgYrFH4URvLY1Vg=; b=XEP5ZLvqS1bWLWJOFTGwEQ5O5dFsc79slMfOWutdsw9wBveTtWL/S6cCNp04Kxyixp YxWGMraBgZKOziwboMlk2VpWcDFIRT0FNUilzMw4ql6gyq8zLIYBFb3t/8erwIU0tlJ3 0KQVXfdqargmQbjIk/ry+bHNGjLY7DqtI0JfqJdgamevKHbpZVVNxHsVOlbuAZugZvnE g4w2AOT7l08tkC7ScnNfmYOaR/PcON4h3fjrjPaR31ROXiowYYbHmIZzbaTMVsyXaPHc kUMGUWlkbvEMecEe6iz9wbTfLs3bjAY2VYxVhO3QOMrcwkl1Qxx57aHjV5cCk63bVFSj 0jrQ== X-Gm-Message-State: AJIora+9A6ZAAnZ41m+29G6sqOTFabbaRvgeuH3SYkO4kHZiPm9jWQXj FLXlVUdouIYiMT53WU5SNGLrLgOLElcUvg== X-Google-Smtp-Source: AGRyM1uUA1gLgVKRqGB46PyoXN2Iomtx+XTYAdBVHbBhXotmm5OZlh42JaWorrvZrr02Syigt7LLlA== X-Received: by 2002:a05:6000:68e:b0:21d:76e3:cc80 with SMTP id bo14-20020a056000068e00b0021d76e3cc80mr9629037wrb.327.1657827594272; Thu, 14 Jul 2022 12:39:54 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:39:53 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 02/10] CI: remove more dead Travis CI support Date: Thu, 14 Jul 2022 21:39:39 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove code that I missed in 4a6e4b96026 (CI: remove Travis CI support, 2021-11-23). This code was only called from or used by the now-removed .travis.yml, or needed by the Travis CI environment. For the symlinking in ci/run-build-and-tests.sh: Back when 3c93b829205 (travis-ci: build Git during the 'script' phase, 2018-01-08) and 4b060a4d973 (ci: use a junction on Windows instead of a symlink, 2019-01-27) adjusted this "ln" command, the Windows build would use ci/run-build-and-tests.sh. As seen in 889cacb6897 (ci: configure GitHub Actions for CI/PR, 2020-04-11) the current windows build uses a different entry point under the GitHub CI, which doesn't use this .prove caching. Namely "ci/run-test-slice.sh". We can be certain that it's never used in "ci/run-test-slice.sh" because to have a ".prove" file we'd need to use "--state=save", which we only do in the dead Azure codepath in ci/lib.sh. If it were used it would do the wrong thing, because the different test slices would each try to clobber the same "t/.prove" file. If a subsequent run then used the "--state=failed,slow,save" it would defeat the purpose of "ci/run-test-slice.sh", since all slices would then run all tests. I.e. behavior of prove's "--state" options is to select tests to run from the provided "--state" file, in addition to those specified on the command-line. For ci/run-docker{,-build}.sh: It was likewise last referenced in the .travis.yml removed in my 4a6e4b96026. The current "dockerized" run in ".github/workflows/main.yml" calls the same entry points as the main "regular" job. For "ci/print-test-failures.sh" the creation of the tarball added in aea8879a6ac (travis-ci: include the trash directories of failed tests in the trace log, 2018-08-01) has been dead since my 4a6e4b96026, which removed the fall-through case from the "case/esac" statement. Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/lib.sh | 10 ++---- ci/print-test-failures.sh | 39 --------------------- ci/run-build-and-tests.sh | 5 --- ci/run-docker-build.sh | 66 ----------------------------------- ci/run-docker.sh | 47 ------------------------- ci/run-test-slice.sh | 5 --- ci/util/extract-trash-dirs.sh | 50 -------------------------- 7 files changed, 2 insertions(+), 220 deletions(-) delete mode 100755 ci/run-docker-build.sh delete mode 100755 ci/run-docker.sh delete mode 100755 ci/util/extract-trash-dirs.sh diff --git a/ci/lib.sh b/ci/lib.sh index 4f12bcaabb9..f32c588f6ad 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -148,9 +148,6 @@ then CI_COMMIT="$BUILD_SOURCEVERSION" CI_JOB_ID="$BUILD_BUILDID" CI_JOB_NUMBER="$BUILD_BUILDNUMBER" - CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)" - test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx - CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')" CC="${CC:-gcc}" # use a subdirectory of the cache dir (because the file share is shared @@ -160,16 +157,13 @@ then export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save" export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml" MAKEFLAGS="$MAKEFLAGS --jobs=10" - test windows_nt != "$CI_OS_NAME" || + test Windows_NT != "$AGENT_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" elif test true = "$GITHUB_ACTIONS" then CI_TYPE=github-actions CI_BRANCH="$GITHUB_REF" CI_COMMIT="$GITHUB_SHA" - CI_OS_NAME="$(echo "$RUNNER_OS" | tr A-Z a-z)" - test macos != "$CI_OS_NAME" || CI_OS_NAME=osx - CI_REPO_SLUG="$GITHUB_REPOSITORY" CI_JOB_ID="$GITHUB_RUN_ID" CC="${CC_PACKAGE:-${CC:-gcc}}" DONT_SKIP_TAGS=t @@ -200,7 +194,7 @@ then export GIT_PROVE_OPTS="--timer --jobs 10" export GIT_TEST_OPTS="--verbose-log -x --github-workflow-markup" MAKEFLAGS="$MAKEFLAGS --jobs=10" - test windows != "$CI_OS_NAME" || + test Windows != "$RUNNER_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" else echo "Could not identify CI type" >&2 diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh index 57277eefcd0..740ebb7c529 100755 --- a/ci/print-test-failures.sh +++ b/ci/print-test-failures.sh @@ -16,15 +16,6 @@ then exit fi -case "$jobname" in -osx-clang|osx-gcc) - # base64 in OSX doesn't wrap its output at 76 columns by - # default, but prints a single, very long line. - base64_opts="-b 76" - ;; -esac - -combined_trash_size=0 for TEST_EXIT in test-results/*.exit do if [ "$(cat "$TEST_EXIT")" != "0" ] @@ -42,47 +33,17 @@ do azure-pipelines) mkdir -p failed-test-artifacts mv "$trash_dir" failed-test-artifacts - continue ;; github-actions) mkdir -p failed-test-artifacts echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/ tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir" - continue ;; *) echo "Unhandled CI type: $CI_TYPE" >&2 exit 1 ;; esac - trash_tgz_b64="trash.$test_name.base64" - if [ -d "$trash_dir" ] - then - tar czp "$trash_dir" |base64 $base64_opts >"$trash_tgz_b64" - - trash_size=$(wc -c <"$trash_tgz_b64") - if [ $trash_size -gt 1048576 ] - then - # larger than 1MB - echo "$(tput setaf 1)Didn't include the trash directory of '$test_name' in the trace log, it's too big$(tput sgr0)" - continue - fi - - new_combined_trash_size=$(($combined_trash_size + $trash_size)) - if [ $new_combined_trash_size -gt 1048576 ] - then - echo "$(tput setaf 1)Didn't include the trash directory of '$test_name' in the trace log, there is plenty of trash in there already.$(tput sgr0)" - continue - fi - combined_trash_size=$new_combined_trash_size - - # DO NOT modify these two 'echo'-ed strings below - # without updating 'ci/util/extract-trash-dirs.sh' - # as well. - echo "$(tput setaf 1)Start of trash directory of '$test_name':$(tput sgr0)" - cat "$trash_tgz_b64" - echo "$(tput setaf 1)End of trash directory of '$test_name'$(tput sgr0)" - fi fi done diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 8ebff425967..9a5032e6a77 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -5,11 +5,6 @@ . ${0%/*}/lib.sh -case "$CI_OS_NAME" in -windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";; -*) ln -s "$cache_dir/.prove" t/.prove;; -esac - run_tests=t case "$jobname" in diff --git a/ci/run-docker-build.sh b/ci/run-docker-build.sh deleted file mode 100755 index 6cd832efb9c..00000000000 --- a/ci/run-docker-build.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# -# Build and test Git inside container -# -# Usage: -# run-docker-build.sh -# - -set -ex - -if test $# -ne 1 || test -z "$1" -then - echo >&2 "usage: run-docker-build.sh " - exit 1 -fi - -case "$jobname" in -linux32) - switch_cmd="linux32 --32bit i386" - ;; -linux-musl) - switch_cmd= - useradd () { adduser -D "$@"; } - ;; -*) - exit 1 - ;; -esac - -"${0%/*}/install-docker-dependencies.sh" - -# If this script runs inside a docker container, then all commands are -# usually executed as root. Consequently, the host user might not be -# able to access the test output files. -# If a non 0 host user id is given, then create a user "ci" with that -# user id to make everything accessible to the host user. -HOST_UID=$1 -if test $HOST_UID -eq 0 -then - # Just in case someone does want to run the test suite as root. - CI_USER=root -else - CI_USER=ci - if test "$(id -u $CI_USER 2>/dev/null)" = $HOST_UID - then - echo "user '$CI_USER' already exists with the requested ID $HOST_UID" - else - useradd -u $HOST_UID $CI_USER - fi -fi - -# Build and test -command $switch_cmd su -m -l $CI_USER -c " - set -ex - export DEVELOPER='$DEVELOPER' - export DEFAULT_TEST_TARGET='$DEFAULT_TEST_TARGET' - export GIT_PROVE_OPTS='$GIT_PROVE_OPTS' - export GIT_TEST_OPTS='$GIT_TEST_OPTS' - export GIT_TEST_CLONE_2GB='$GIT_TEST_CLONE_2GB' - export MAKEFLAGS='$MAKEFLAGS' - export cache_dir='$cache_dir' - cd /usr/src/git - test -n '$cache_dir' && ln -s '$cache_dir/.prove' t/.prove - make - make test -" diff --git a/ci/run-docker.sh b/ci/run-docker.sh deleted file mode 100755 index af89d1624a4..00000000000 --- a/ci/run-docker.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# -# Download and run Docker image to build and test Git -# - -. ${0%/*}/lib.sh - -case "$jobname" in -linux32) - CI_CONTAINER="daald/ubuntu32:xenial" - ;; -linux-musl) - CI_CONTAINER=alpine - ;; -*) - exit 1 - ;; -esac - -docker pull "$CI_CONTAINER" - -# Use the following command to debug the docker build locally: -# must be 0 if podman is used as drop-in replacement for docker -# $ docker run -itv "${PWD}:/usr/src/git" --entrypoint /bin/sh "$CI_CONTAINER" -# root@container:/# export jobname= -# root@container:/# /usr/src/git/ci/run-docker-build.sh - -container_cache_dir=/tmp/container-cache - -docker run \ - --interactive \ - --env DEVELOPER \ - --env DEFAULT_TEST_TARGET \ - --env GIT_PROVE_OPTS \ - --env GIT_TEST_OPTS \ - --env GIT_TEST_CLONE_2GB \ - --env MAKEFLAGS \ - --env jobname \ - --env cache_dir="$container_cache_dir" \ - --volume "${PWD}:/usr/src/git" \ - --volume "$cache_dir:$container_cache_dir" \ - "$CI_CONTAINER" \ - /usr/src/git/ci/run-docker-build.sh $(id -u $USER) - -check_unignored_build_artifacts - -save_good_tree diff --git a/ci/run-test-slice.sh b/ci/run-test-slice.sh index a3c67956a8d..312a3ef73fe 100755 --- a/ci/run-test-slice.sh +++ b/ci/run-test-slice.sh @@ -5,11 +5,6 @@ . ${0%/*}/lib.sh -case "$CI_OS_NAME" in -windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";; -*) ln -s "$cache_dir/.prove" t/.prove;; -esac - group "Run tests" make --quiet -C t T="$(cd t && ./helper/test-tool path-utils slice-tests "$1" "$2" t[0-9]*.sh | tr '\n' ' ')" || diff --git a/ci/util/extract-trash-dirs.sh b/ci/util/extract-trash-dirs.sh deleted file mode 100755 index 8e67bec21a2..00000000000 --- a/ci/util/extract-trash-dirs.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -error () { - echo >&2 "error: $@" - exit 1 -} - -find_embedded_trash () { - while read -r line - do - case "$line" in - *Start\ of\ trash\ directory\ of\ \'t[0-9][0-9][0-9][0-9]-*\':*) - test_name="${line#*\'}" - test_name="${test_name%\'*}" - - return 0 - esac - done - - return 1 -} - -extract_embedded_trash () { - while read -r line - do - case "$line" in - *End\ of\ trash\ directory\ of\ \'$test_name\'*) - return - ;; - *) - printf '%s\n' "$line" - ;; - esac - done - - error "unexpected end of input" -} - -# Raw logs from Linux build jobs have CRLF line endings, while OSX -# build jobs mostly have CRCRLF, except an odd line every now and -# then that has CRCRCRLF. 'base64 -d' from 'coreutils' doesn't like -# CRs and complains about "invalid input", so remove all CRs at the -# end of lines. -sed -e 's/\r*$//' | \ -while find_embedded_trash -do - echo "Extracting trash directory of '$test_name'" - - extract_embedded_trash |base64 -d |tar xzp -done From patchwork Thu Jul 14 19:39:40 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: 12918464 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 0CB5CC43334 for ; Thu, 14 Jul 2022 19:40:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240655AbiGNTkH (ORCPT ); Thu, 14 Jul 2022 15:40:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240282AbiGNTj6 (ORCPT ); Thu, 14 Jul 2022 15:39:58 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 504C21007 for ; Thu, 14 Jul 2022 12:39:57 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id ay11-20020a05600c1e0b00b003a3013da120so1687134wmb.5 for ; Thu, 14 Jul 2022 12:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TiWimMImiJ2P6vfBDEN+5JpV/1VEgcm+Vnof8/up89U=; b=VcSlGsnMvA0in25Kqg543cGzpMe34poFeFHxU2RjaxgBxs/3DH8edw03MGx/NvxBIY v4BgNuGSzQbaKkRKCU4zbsWXbJN7vUDWC4JCAvlX7j577HHRl9os8cvz2y77GfGjVFYW fXPwCVZvmXJZQxlJC36DmnwqPy0bfCx+ONs9jpFJWNhSVSUYNtOxgw6/GiN5N6PkLauw aFPSME/oRr86k8sfDHPONkrJSVm4KwpZqi4U6FN7jXgYKQTaowrhMpTPU5bHXuJWDvZE UDKYfO8rFmrgiGpquRCiRyIOwDlgD89ViuO6QR889lVQ7wU11G/cbQuW60pUY5075o5X RHNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TiWimMImiJ2P6vfBDEN+5JpV/1VEgcm+Vnof8/up89U=; b=LOhcVKQ08lv7lNSXNdQCQoqaetzPvVh8YBuedCWzV21csH+ZJqLOTcZFb1OgPVVvn1 ZhDKfj1sLprXWtvB+zwtix2lXZ8/TmGj0NzLt+UY6jy5jplHbe16Zgk93MeATnPn86Q0 +V7QZPH/xm63XddHCFGR8rOdYO6uLD3jjvrFMIKepRzzpMlfaULRvdxgYTMtsmbWOIxL 1AKBfeDjJYXbHZVuR+Hdtf9jIUu5PqrtW8ThF0qJvrtNCE4gZFVJdnMANH7nPmmUn/MF zkNErrXejk/1ZG7h04AqR9RkTt/hq9qvvxw5LKUZVFRCeMEx4VUs87wkwBBcktC6N/4C rTbg== X-Gm-Message-State: AJIora/93EtxRHumznIMNwt5OenK/IvAMsd7VTwKCRBpxNdBzOT4Vlme rNzPSjaSCe3Z34i818qpPKjMSlncnDr0CA== X-Google-Smtp-Source: AGRyM1veCapb9X1Gr+6nsgqKDGTRKDMf/8z1qbLERYB/hSXj2WBdISLbBFcoBEO4/sXAE6HkYkvGZQ== X-Received: by 2002:a05:600c:3b8d:b0:3a2:ea2b:d0f9 with SMTP id n13-20020a05600c3b8d00b003a2ea2bd0f9mr10680247wms.120.1657827595447; Thu, 14 Jul 2022 12:39:55 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:39:54 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 03/10] CI: remove dead "tree skipping" code Date: Thu, 14 Jul 2022 21:39:40 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove the code related to skipping CI runs if the tree was successfully tested before. With the GitHub CI this is done with the "ci-config" step, see e76eec35540 (ci: allow per-branch config for GitHub Actions, 2020-05-07) and 7d78d5fc1a9 (ci: skip GitHub workflow runs for already-tested commits/trees, 2020-10-08). This code hasn't been used since 4a6e4b96026 (CI: remove Travis CI support, 2021-11-23). At one point it was used for the now-removed Azure Pipelines support. That support was removed in 6081d3898fe (ci: retire the Azure Pipelines definition, 2020-04-11), but before in 50b206371d2 (travis: remove the hack to build the Windows job on Azure Pipelines, 2019-02-28) the "save_good_tree" function had not been called by the Azure Pipelines code. Therefore even for those who'd like to resurrect the azure-pipelines.yml for occasional ad-hoc use (see the thread(s) starting at [1]) this change should be OK. This code was really only used for the now-removed Travis CI. This change also removes a subtle potential logic error introduced in 0e7696c64db (ci: disallow directional formatting, 2021-11-04). The "ci/check-directional-formatting.bash" script would have been made to run after the "save_good_tree" in invoked in "ci/run-static-analysis.sh". So if e.g. the "make coccicheck" failed we'd still mark the tree as good. I.e. the addition of "ci/check-directional-formatting.bash" didn't take into account that the various users of the "save_good_tree" function in ci/*.sh made a hard assumption that they're the only ci/*.sh script that's being run (and they use "set -e"). This is entirely academic since we weren't actually running this code, but is something to be careful of if anyone ever needs to resurrect parts of this. Finally, the cache_dir="$HOME/none" added in a3f2eec862b (ci/lib: allow running in GitHub Actions, 2020-04-08) for the GitHub CI can be removed. It appears to have been added to appease the subsequent 'mkdir -p "$cache_dir"', which wasn't needed in GitHub CI. 1. https://lore.kernel.org/git/220609.86r13xsj00.gmgdl@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/lib.sh | 91 --------------------------------------- ci/run-build-and-tests.sh | 2 - ci/run-static-analysis.sh | 2 - ci/test-documentation.sh | 2 - 4 files changed, 97 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index f32c588f6ad..fcb79c83087 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -52,75 +52,6 @@ else begin_group "CI setup" fi -skip_branch_tip_with_tag () { - # Sometimes, a branch is pushed at the same time the tag that points - # at the same commit as the tip of the branch is pushed, and building - # both at the same time is a waste. - # - # When the build is triggered by a push to a tag, $CI_BRANCH will - # have that tagname, e.g. v2.14.0. Let's see if $CI_BRANCH is - # exactly at a tag, and if so, if it is different from $CI_BRANCH. - # That way, we can tell if we are building the tip of a branch that - # is tagged and we can skip the build because we won't be skipping a - # build of a tag. - - if TAG=$(git describe --exact-match "$CI_BRANCH" 2>/dev/null) && - test "$TAG" != "$CI_BRANCH" - then - echo "$(tput setaf 2)Tip of $CI_BRANCH is exactly at $TAG$(tput sgr0)" - exit 0 - fi -} - -# Save some info about the current commit's tree, so we can skip the build -# job if we encounter the same tree again and can provide a useful info -# message. -save_good_tree () { - echo "$(git rev-parse $CI_COMMIT^{tree}) $CI_COMMIT $CI_JOB_NUMBER $CI_JOB_ID" >>"$good_trees_file" - # limit the file size - tail -1000 "$good_trees_file" >"$good_trees_file".tmp - mv "$good_trees_file".tmp "$good_trees_file" -} - -# Skip the build job if the same tree has already been built and tested -# successfully before (e.g. because the branch got rebased, changing only -# the commit messages). -skip_good_tree () { - if test true = "$GITHUB_ACTIONS" - then - return - fi - - if ! good_tree_info="$(grep "^$(git rev-parse $CI_COMMIT^{tree}) " "$good_trees_file")" - then - # Haven't seen this tree yet, or no cached good trees file yet. - # Continue the build job. - return - fi - - echo "$good_tree_info" | { - read tree prev_good_commit prev_good_job_number prev_good_job_id - - if test "$CI_JOB_ID" = "$prev_good_job_id" - then - cat <<-EOF - $(tput setaf 2)Skipping build job for commit $CI_COMMIT.$(tput sgr0) - This commit has already been built and tested successfully by this build job. - To force a re-build delete the branch's cache and then hit 'Restart job'. - EOF - else - cat <<-EOF - $(tput setaf 2)Skipping build job for commit $CI_COMMIT.$(tput sgr0) - This commit's tree has already been built and tested successfully in build job $prev_good_job_number for commit $prev_good_commit. - The log of that build job is available at $SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$prev_good_job_id - To force a re-build delete the branch's cache and then hit 'Restart job'. - EOF - fi - } - - exit 0 -} - check_unignored_build_artifacts () { ! git ls-files --other --exclude-standard --error-unmatch \ -- ':/*' 2>/dev/null || @@ -144,16 +75,8 @@ if test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI" then CI_TYPE=azure-pipelines # We are running in Azure Pipelines - CI_BRANCH="$BUILD_SOURCEBRANCH" - CI_COMMIT="$BUILD_SOURCEVERSION" - CI_JOB_ID="$BUILD_BUILDID" - CI_JOB_NUMBER="$BUILD_BUILDNUMBER" CC="${CC:-gcc}" - # use a subdirectory of the cache dir (because the file share is shared - # among *all* phases) - cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME" - export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save" export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml" MAKEFLAGS="$MAKEFLAGS --jobs=10" @@ -162,11 +85,7 @@ then elif test true = "$GITHUB_ACTIONS" then CI_TYPE=github-actions - CI_BRANCH="$GITHUB_REF" - CI_COMMIT="$GITHUB_SHA" - CI_JOB_ID="$GITHUB_RUN_ID" CC="${CC_PACKAGE:-${CC:-gcc}}" - DONT_SKIP_TAGS=t handle_failed_tests () { mkdir -p t/failed-test-artifacts echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV @@ -189,8 +108,6 @@ then return 1 } - cache_dir="$HOME/none" - export GIT_PROVE_OPTS="--timer --jobs 10" export GIT_TEST_OPTS="--verbose-log -x --github-workflow-markup" MAKEFLAGS="$MAKEFLAGS --jobs=10" @@ -202,14 +119,6 @@ else exit 1 fi -good_trees_file="$cache_dir/good-trees" - -mkdir -p "$cache_dir" - -test -n "${DONT_SKIP_TAGS-}" || -skip_branch_tip_with_tag -skip_good_tree - if test -z "$jobname" then jobname="$CI_OS_NAME-$CC" diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 9a5032e6a77..1a89a4967bf 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -47,5 +47,3 @@ then handle_failed_tests fi check_unignored_build_artifacts - -save_good_tree diff --git a/ci/run-static-analysis.sh b/ci/run-static-analysis.sh index 0d51e5ce0e7..faae31f0078 100755 --- a/ci/run-static-analysis.sh +++ b/ci/run-static-analysis.sh @@ -30,5 +30,3 @@ make hdr-check || exit 1 make check-pot - -save_good_tree diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh index de41888430a..9e0652c30dd 100755 --- a/ci/test-documentation.sh +++ b/ci/test-documentation.sh @@ -41,5 +41,3 @@ grep ' X-Patchwork-Id: 12918465 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 923BBC43334 for ; Thu, 14 Jul 2022 19:40:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240625AbiGNTkJ (ORCPT ); Thu, 14 Jul 2022 15:40:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240579AbiGNTj7 (ORCPT ); Thu, 14 Jul 2022 15:39:59 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B5D0BCBB for ; Thu, 14 Jul 2022 12:39:58 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id bk26so3890391wrb.11 for ; Thu, 14 Jul 2022 12:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RGDbRm9Pks4vmfqob4fy12ZJBmfseF25WvQRYLgkgLk=; b=HOWI471MjGHi82luuKkDE2RMPj/ENxol+svQeRhYjiboBPsrzCONENYCmmw1jaHHxI tcC6kqjKx04yMntj0/o982qL+VJs9pc8f9qMlTESbUBk3Rh8jQyvL8XjrvaB+CKKfmgJ Y7/Fj2JXSS8+7jBzRje2+IvBA6GMbpjgu+DnRc11JO7Q4qntUIPUbvfJWkjvw2UqMNE2 3hv1qkWVMvrouTeDH35qWzNFdMNIk5hGRV6IdvJHvPYYvOOKV4P2YlOJDtZZU/UgBT7z 10oenG9Mtm6WBOB/Ssf5b0nDFAr3VChJ+mMMq7Juj4SuSoIoNkJ8Q2PYHkx1O+KBLZup 69jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RGDbRm9Pks4vmfqob4fy12ZJBmfseF25WvQRYLgkgLk=; b=OKUA4D8pZM/pHo4U6UFqWSEdNLnab4fd4Hs01RJ1SXvvAGBFHkQsPBstoDU8OuyBkV GoRvLTXpuwh+3Oeo4ztEsqh8S/puZBt6rE3p4yc8GiWAQR/TKbhYuQJKBgnzE0eDLE1P bXYrd0BNWX2TZoE40q+mbe1sp1pBMHBOKt9jlPd1tLUjWobFZD1U9fVyOzfhHS/5MME7 Izf/EQOLVgy83AMROlssxZROGSp5R2IsVuLCJH+QqJhGPElJLtOkEXhHgBYBrVYQRD7D 7UgFn6+h+naEGi/+Ff3SnDF4Y4pGJTzWLLzvezGXOZQpCp/EGVfBUPritW6eSndjg3/5 Ymqg== X-Gm-Message-State: AJIora8aEq5ffc8+/1F+b5Gj1idBmn/nVyGyFefslPJiRc618KFDFvcG rldx5Yg+JyxoGLmhLjqCx7mqX2/K0LsRFA== X-Google-Smtp-Source: AGRyM1uuXDGnpPai6MNMbywy4mg6ZdfbLLQaXvYaLnlaG/4379mpa+Lon+nurT59iEMVt4BbK2wcgw== X-Received: by 2002:adf:f9c3:0:b0:21d:7b3d:d924 with SMTP id w3-20020adff9c3000000b0021d7b3dd924mr9774196wrr.536.1657827596796; Thu, 14 Jul 2022 12:39:56 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.39.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:39:55 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 04/10] CI: make "$jobname" explicit, remove fallback Date: Thu, 14 Jul 2022 21:39:41 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove the $jobname fallback last adjusted in b011fabd6e0 (ci/lib.sh: encapsulate Travis-specific things, 2019-01-27). This makes all of our CI jobs have an explicit $jobname, and removes the special-case of the Windows jobs implicitly setting one (that they don't currently use). This is a follow-up to my 25715419bf4 (CI: don't run "make test" twice in one job, 2021-11-23), since then all the jobs except the Windows jobs have had an explicit $jobname. In the case of the Windows jobs we were using a jobname of windows-gcc for both, due to picking "gcc" as a default fallback for "$CC" in ci/lib.sh. Since we'll need this to run ci/lib.sh it makes sense to move the check to the top of the file. Signed-off-by: Ævar Arnfjörð Bjarmason --- .github/workflows/main.yml | 7 +++++++ ci/lib.sh | 12 +++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cd1f52692a5..8b7697df9fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,6 +79,8 @@ jobs: windows-build: name: win build + env: + jobname: windows-build needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' runs-on: windows-latest @@ -100,6 +102,8 @@ jobs: path: artifacts windows-test: name: win test + env: + jobname: windows-test runs-on: windows-latest needs: [windows-build] strategy: @@ -134,6 +138,7 @@ jobs: needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' env: + jobname: vs-build NO_PERL: 1 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'" runs-on: windows-latest @@ -183,6 +188,8 @@ jobs: path: artifacts vs-test: name: win+VS test + env: + jobname: vs-test runs-on: windows-latest needs: vs-build strategy: diff --git a/ci/lib.sh b/ci/lib.sh index fcb79c83087..969ba2ff0d0 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -8,6 +8,13 @@ # are installed. set -e +# Starting assertions +if test -z "$jobname" +then + echo "error: must set a CI jobname in the environment" >&2 + exit 1 +fi + if test true != "$GITHUB_ACTIONS" then begin_group () { :; } @@ -119,11 +126,6 @@ else exit 1 fi -if test -z "$jobname" -then - jobname="$CI_OS_NAME-$CC" -fi - export DEVELOPER=1 export DEFAULT_TEST_TARGET=prove export GIT_TEST_CLONE_2GB=true From patchwork Thu Jul 14 19:39:42 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: 12918466 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 CB5B1C43334 for ; Thu, 14 Jul 2022 19:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240671AbiGNTkM (ORCPT ); Thu, 14 Jul 2022 15:40:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240612AbiGNTkA (ORCPT ); Thu, 14 Jul 2022 15:40:00 -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 A20CE1007 for ; Thu, 14 Jul 2022 12:39:59 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id c131-20020a1c3589000000b003a2cc290135so3656017wma.2 for ; Thu, 14 Jul 2022 12:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VXcQ/XYGJF9+zRwBf2FIM7RUWzPBNwae1i2D7wouGU8=; b=hntpwM2c6ub2UsFYm9kd5z6w1XvfnJXIQM7IecNuuVqvgWc3kLVH+Hpg26/nRSuTAk xhcCU4ZgmdWecvAmA5jrL6JolbsFoCeInyO0R9ZCtvFV/PhIoyQmUvjGSFqdDynLyW9k uF7KFLMxHMTOcnTrdpavZml/DmnsJiU4ItKdwcYabPhKwkrSW27n3bUdAIdFTu6XIpWK 9Oyl6jyJvtKxkWE9QF5zmDzHDV9fmihEQ0A51rp/fUgVkk4S6jr45eTm6wp++0y/fHps 764K/P1md0e1RVgBaw9dvuAcgXVcHhoCkKjvR3nsuS4Mq3X3z0ycC5Fnhby4QZPc+b39 Lqlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VXcQ/XYGJF9+zRwBf2FIM7RUWzPBNwae1i2D7wouGU8=; b=m5hkIgr4wHYQr4eVryWy2Crhx4Mz9kEVGg5gh8GqloHmKoTxToL45/4sRs88yKwYZB d+27UbmwTRTuMFRviTLnBjOqasHkdyVQZDwESll7diHue8GpWdtvNi3hiw40f3kGFEvj Nb6qYiy3MvI4MPno/ZPeNJQ86kTkN4I25NofRE7A/+tOUFanKmZodTnqMtoH1fODaKmG ul6/sTGI9eXtk4UKWX/qVEgaEWIPDhHN54INFuYOZZ24ExIzhW0L5l10phWQuSirEbff B3rFshohpgKbfyWtr0QLinwd7tGf/WeL0BLHwLasTwCH04kYw165XfRzoYUvk5JwxqzG mbmg== X-Gm-Message-State: AJIora8VpuU0Gi4gUSOD/OaDuQ6nuUJmgbjHmhuRUCLSQ2EU9Gm15JQn MJDlc++ffz7yMPnVNmISZsqcsM4udAr16A== X-Google-Smtp-Source: AGRyM1vmcWwx/oubAX3Hqsc7IZFjfInF8eUOBlp5LXFrIv4fJRJAeiFU5Y5fntnXrtBT/8unKPe1JA== X-Received: by 2002:a7b:c413:0:b0:3a1:8f03:29d0 with SMTP id k19-20020a7bc413000000b003a18f0329d0mr17280628wmi.160.1657827597871; Thu, 14 Jul 2022 12:39:57 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:39:57 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 05/10] CI/lib.sh: stop adding leading whitespace to $MAKEFLAGS Date: Thu, 14 Jul 2022 21:39:42 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In a8c51f77d16 (ci: clear and mark MAKEFLAGS exported just once, 2019-02-07) the assignment of MAKEFLAGS was done up-front to future-proof this code for the bug fixed in 406f93ae488 (ci: make sure we build Git parallel, 2019-02-07). But since 4a6e4b96026 (CI: remove Travis CI support, 2021-11-23) the --jobs=10 has been an invariant here, so let's assign --jobs=$NPROC to the MAKEFLAGS right away, this gets rid of the leading whitespace from the $MAKEFLAGS variable, as it would previously be empty on the first assignment. Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/lib.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index 969ba2ff0d0..3591919ba44 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -75,8 +75,11 @@ handle_failed_tests () { # GitHub Action doesn't set TERM, which is required by tput export TERM=${TERM:-dumb} +# How many jobs to run in parallel? +NPROC=10 + # Clear MAKEFLAGS that may come from the outside world. -export MAKEFLAGS= +export MAKEFLAGS=--jobs=$NPROC if test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI" then @@ -84,9 +87,8 @@ then # We are running in Azure Pipelines CC="${CC:-gcc}" - export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save" + export GIT_PROVE_OPTS="--timer --jobs $NPROC --state=failed,slow,save" export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml" - MAKEFLAGS="$MAKEFLAGS --jobs=10" test Windows_NT != "$AGENT_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" elif test true = "$GITHUB_ACTIONS" @@ -115,9 +117,8 @@ then return 1 } - export GIT_PROVE_OPTS="--timer --jobs 10" + export GIT_PROVE_OPTS="--timer --jobs $NPROC" export GIT_TEST_OPTS="--verbose-log -x --github-workflow-markup" - MAKEFLAGS="$MAKEFLAGS --jobs=10" test Windows != "$RUNNER_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" else From patchwork Thu Jul 14 19:39:43 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: 12918467 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 9BF9FC433EF for ; Thu, 14 Jul 2022 19:40:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240677AbiGNTkO (ORCPT ); Thu, 14 Jul 2022 15:40:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240635AbiGNTkB (ORCPT ); Thu, 14 Jul 2022 15:40:01 -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 C52441D32C for ; Thu, 14 Jul 2022 12:40:00 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id v16so3880627wrd.13 for ; Thu, 14 Jul 2022 12:40:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6UJdv3K0kTgAA6wYDJ3g8i+QiAw7NGl4foKsXfp8768=; b=P/25D0u7NsehC+0ggUmfluslhUuYLsswskf+EQ/5RuSYB8VH7q2kB4HVaxruKUxCZv tSTFvs+zeacgidv3BJPfd32Mt11tCdYvV9Ox5oZgHyRuAFXFCw9EB3rdbELMpO7md5LY 6d9c3vdEEnnrX9D3DHWt3Zw9s+dsPko7BzOeLoMKOUs6h+QnszZNJaWhT3zy26rV9bnW lMTQfAeCl6pb39yhyuyMMUScsOHDInmEKwHLTSmlKjY33Hu0HhYoR0rD0ek98AWyirxX alI8iru81DaKb/8yYbVBVZvREhqzIalycV6zJeSLoHE/0dtTH908y1UENkBKid7qkdYP K9cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6UJdv3K0kTgAA6wYDJ3g8i+QiAw7NGl4foKsXfp8768=; b=VKvTWkFXF92NNuWSHwq8qBAlMksod8SkeeaAzfoz+VXgp69k8Nho00YgKyRWEachP+ OlKYOnqorv9gHKvU/uYuSHEtiCMGhmvd86p0FR7N8ybbuU6edVhBz2CkEj7Rk+3bcyly 2HvzRh1nF5Hub6SUEYvHB0vYa0r8Ubu7yIJWCphWOEPL96dTC1GndBrMK8vxim1L+4fE 9gqTD5QXSH9kxv++UV+tkyHDcP+cYJKWoPx/uLZ4Evrpj71Z5wp7ohbZhyJSGHo2v4WD 4qjoxsoD9KVljSS6uvnzW1mTQuWPXtAN62IKyCg79xOzS0LJ0pZNqhvWISoto6AF+mAb yp6g== X-Gm-Message-State: AJIora8i6lAsSwILM+5nBj6PMlD6g1neoxoB0+a8xn15tOpBAZGOHtDT 0tRFeVOiwjeO5vJW/KsM4FZQcbIlGQzXhg== X-Google-Smtp-Source: AGRyM1tI8Rx93QbfpM/4Mb+HDdRBK5lpw1YGThHI2rLaGenYsQEH2YbFzIckKFp8N8LZU6attRJMfw== X-Received: by 2002:a5d:6c67:0:b0:21d:b9bf:5e1c with SMTP id r7-20020a5d6c67000000b0021db9bf5e1cmr9703737wrz.133.1657827599047; Thu, 14 Jul 2022 12:39:59 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.39.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:39:58 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 06/10] CI: consistently use "export" in ci/lib.sh Date: Thu, 14 Jul 2022 21:39:43 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change the "ci/lib.sh" script to consistently use "export", for e.g. MAKEFLAGS we were exporting it, and then assigning to it, let's do it the other way around. Right now this doesn't matter, since we in e.g. "ci/install-dependencies.sh" source this file, and don't use something like "env(1)" to retrieve these variables. But in a subsequent commit we'll "export" these variables through a wrapper (and to eventually write them to a GitHub CI-specific $GITHUB_ENV file). This change makes that subsequent change easier to read, as it won't need to do any control flow refactoring. Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/lib.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index 3591919ba44..44039152ebc 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -79,7 +79,7 @@ export TERM=${TERM:-dumb} NPROC=10 # Clear MAKEFLAGS that may come from the outside world. -export MAKEFLAGS=--jobs=$NPROC +MAKEFLAGS=--jobs=$NPROC if test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI" then @@ -88,9 +88,10 @@ then CC="${CC:-gcc}" export GIT_PROVE_OPTS="--timer --jobs $NPROC --state=failed,slow,save" - export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml" + GIT_TEST_OPTS="--verbose-log -x --write-junit-xml" test Windows_NT != "$AGENT_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" + export GIT_TEST_OPTS elif test true = "$GITHUB_ACTIONS" then CI_TYPE=github-actions @@ -118,9 +119,10 @@ then } export GIT_PROVE_OPTS="--timer --jobs $NPROC" - export GIT_TEST_OPTS="--verbose-log -x --github-workflow-markup" + GIT_TEST_OPTS="--verbose-log -x --github-workflow-markup" test Windows != "$RUNNER_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" + export GIT_TEST_OPTS else echo "Could not identify CI type" >&2 env >&2 @@ -187,6 +189,7 @@ linux-leaks) esac MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}" +export MAKEFLAGS end_group set -x From patchwork Thu Jul 14 19:39:44 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: 12918468 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 F1642C43334 for ; Thu, 14 Jul 2022 19:40:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240660AbiGNTkX (ORCPT ); Thu, 14 Jul 2022 15:40:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240654AbiGNTkG (ORCPT ); Thu, 14 Jul 2022 15:40:06 -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 534F26759A for ; Thu, 14 Jul 2022 12:40:02 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id b6so1128961wmq.5 for ; Thu, 14 Jul 2022 12:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tC51mi1gwvw/qYlzGL+ciz40B/m09U3lklboHEXXElo=; b=qzQ3XmGif31jAkfxX/fcGg1nUvd0/ourVEGEao3Y3aafKbZuhfuEOk2JnUULFZKnCL zfLH+kqPJDkDCDtppfAe66Kj8fjXY+eHtFFieQh0kP7ghN6dRxQRwulrM4Ro/ZBPJ99i 8aK0T865+lQt/sVKa+9H/vzvyespGl4j42JzFCQjUSeo0Uo7mbeYhk1uX++l6UpMrjax nUi1tnSiAcRucAPM4aZzIWpMv8r6qXL1a1MWGe8QpsCXouhxVVIMDTTVWK/nEsgI2L9J DLeuYFtfuljOLyFwaa4qPrFOG/YSDxfx+nUfYEesspLmdmn4qMOPziDpRqejYfUXL9px FDGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tC51mi1gwvw/qYlzGL+ciz40B/m09U3lklboHEXXElo=; b=lJxL7GMC8R3GQ7VCFEEPRsqEodw7nV9m37rl0nKJSQt/lws1Bd+5m6lNWryCxXmvy0 5LbLUwm3q5UIYaAFter9p+v4Z6l8xffGBxnh9zmNpyyA9FDzuoN7eBHVLSEsfhy5+VJM lzXLAfpBU2+2g2bDaXB68rX/e+tvV9043MPrytopqACbsO+5Uguo8i5bSScW+UaWLqKG jLg038sX1FXcy2HgxIimdNOSqsfUNJcmNUC+lSlbRADNvYcOsc8SUf2Vom6fp7pKUv/8 OiJrnORk6T0OK13X5s2NHGq4hTlcBX7eoi2NXYdq8BKj1EpQfkzObFyKXjmHTtZSINOq 8aEg== X-Gm-Message-State: AJIora9nkhE/kxpKkTSVdRR1E6+nakr0AaPnlZarvryVqttMOcuMnaae w4IVhxg9uDVmFaSqQqtYpkXncwF4RrWboQ== X-Google-Smtp-Source: AGRyM1v9OwCD/mIjXxG7JuyOVuE7wVDH0ML6DD36dmy20E3EZEsoKb1Sd/Q7lwcI8Phbo8lcNhwG5A== X-Received: by 2002:a05:600c:3227:b0:3a3:be7:2917 with SMTP id r39-20020a05600c322700b003a30be72917mr68978wmp.83.1657827600305; Thu, 14 Jul 2022 12:40:00 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:39:59 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 07/10] CI: export variables via a wrapper Date: Thu, 14 Jul 2022 21:39:44 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add and use a "setenv" wrapper to export the variables set in ci/lib.sh. For now this merely adds debugging information about what variables are set, but in a subsequent commit we'll expand this to set variables in $GITHUB_ENV instead of the environment, and thus carry variable settings between steps in a job. We'll also eventually be interested in what type of variable we're setting, and when it needs to be used, because we'll prominently expose what variables we set in what CI "step", so having only the ones we actually use will improve readability. To that end call the "setenv" function with optional "--install", "--build", "--test" and "--all" parameters to indicate whether they're needed for building, testing or both. We currently ignore the "varname" parameter, but will make use of it in a subsequent commit. Adding it here reduces the needless churn, as we won't need to change all these lines again for that subsequent change. Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/lib.sh | 69 +++++++++++++++++++++++++++++---------- ci/run-build-and-tests.sh | 34 +++++++++---------- 2 files changed, 68 insertions(+), 35 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index 44039152ebc..67b7b32a0f1 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -59,6 +59,38 @@ else begin_group "CI setup" fi +# Helper functions +setenv () { + while test $# != 0 + do + case "$1" in + --install) + ;; + --build) + ;; + --test) + ;; + --all) + ;; + -*) + echo "BUG: bad setenv() option '$1'" >&2 + exit 1 + ;; + *) + break + ;; + esac + shift + done + + key=$1 + val=$2 + shift 2 + + eval "$key=\"$val\"" + eval "export $key" +} + check_unignored_build_artifacts () { ! git ls-files --other --exclude-standard --error-unmatch \ -- ':/*' 2>/dev/null || @@ -73,7 +105,7 @@ handle_failed_tests () { } # GitHub Action doesn't set TERM, which is required by tput -export TERM=${TERM:-dumb} +setenv --all TERM ${TERM:-dumb} # How many jobs to run in parallel? NPROC=10 @@ -87,11 +119,11 @@ then # We are running in Azure Pipelines CC="${CC:-gcc}" - export GIT_PROVE_OPTS="--timer --jobs $NPROC --state=failed,slow,save" + setenv --test GIT_PROVE_OPTS "--timer --jobs $NPROC --state=failed,slow,save" GIT_TEST_OPTS="--verbose-log -x --write-junit-xml" test Windows_NT != "$AGENT_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" - export GIT_TEST_OPTS + setenv --test GIT_TEST_OPTS "$GIT_TEST_OPTS" elif test true = "$GITHUB_ACTIONS" then CI_TYPE=github-actions @@ -118,21 +150,21 @@ then return 1 } - export GIT_PROVE_OPTS="--timer --jobs $NPROC" + setenv --test GIT_PROVE_OPTS "--timer --jobs $NPROC" GIT_TEST_OPTS="--verbose-log -x --github-workflow-markup" test Windows != "$RUNNER_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" - export GIT_TEST_OPTS + setenv --test GIT_TEST_OPTS "$GIT_TEST_OPTS" else echo "Could not identify CI type" >&2 env >&2 exit 1 fi -export DEVELOPER=1 -export DEFAULT_TEST_TARGET=prove -export GIT_TEST_CLONE_2GB=true -export SKIP_DASHED_BUILT_INS=YesPlease +setenv --build DEVELOPER 1 +setenv --test DEFAULT_TEST_TARGET prove +setenv --test GIT_TEST_CLONE_2GB true +setenv --build SKIP_DASHED_BUILT_INS YesPlease case "$runs_on_pool" in ubuntu-latest) @@ -148,19 +180,20 @@ ubuntu-latest) MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python2" fi - export GIT_TEST_HTTPD=true + setenv --test GIT_TEST_HTTPD true # The Linux build installs the defined dependency versions below. # The OS X build installs much more recent versions, whichever # were recorded in the Homebrew database upon creating the OS X # image. # Keep that in mind when you encounter a broken OS X build! - export LINUX_P4_VERSION="16.2" - export LINUX_GIT_LFS_VERSION="1.5.2" + setenv --install LINUX_P4_VERSION "16.2" + setenv --install LINUX_GIT_LFS_VERSION "1.5.2" - P4_PATH="$HOME/custom/p4" - GIT_LFS_PATH="$HOME/custom/git-lfs" - export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH" + setenv --install P4_PATH "$HOME/custom/p4" + setenv --install GIT_LFS_PATH "$HOME/custom/git-lfs" + setenv --all PATH "$GIT_LFS_PATH:$P4_PATH:$PATH" + setenv --test GIT_TEST_HTTPD true ;; macos-latest) if [ "$jobname" = osx-gcc ] @@ -183,13 +216,13 @@ linux-musl) MAKEFLAGS="$MAKEFLAGS GIT_TEST_UTF8_LOCALE=C.UTF-8" ;; linux-leaks) - export SANITIZE=leak - export GIT_TEST_PASSING_SANITIZE_LEAK=true + setenv --build SANITIZE leak + setenv --test GIT_TEST_PASSING_SANITIZE_LEAK true ;; esac MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}" -export MAKEFLAGS +setenv --all MAKEFLAGS "$MAKEFLAGS" end_group set -x diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 1a89a4967bf..b7774e4abcf 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -9,33 +9,33 @@ run_tests=t case "$jobname" in linux-gcc) - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + setenv --test GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME main ;; linux-TEST-vars) - export GIT_TEST_SPLIT_INDEX=yes - export GIT_TEST_MERGE_ALGORITHM=recursive - export GIT_TEST_FULL_IN_PACK_ARRAY=true - export GIT_TEST_OE_SIZE=10 - export GIT_TEST_OE_DELTA_SIZE=5 - export GIT_TEST_COMMIT_GRAPH=1 - export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1 - export GIT_TEST_MULTI_PACK_INDEX=1 - export GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=1 - export GIT_TEST_ADD_I_USE_BUILTIN=0 - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_WRITE_REV_INDEX=1 - export GIT_TEST_CHECKOUT_WORKERS=2 + setenv --test GIT_TEST_SPLIT_INDEX yes + setenv --test GIT_TEST_MERGE_ALGORITHM recursive + setenv --test GIT_TEST_FULL_IN_PACK_ARRAY true + setenv --test GIT_TEST_OE_SIZE 10 + setenv --test GIT_TEST_OE_DELTA_SIZE 5 + setenv --test GIT_TEST_COMMIT_GRAPH 1 + setenv --test GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS 1 + setenv --test GIT_TEST_MULTI_PACK_INDEX 1 + setenv --test GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP 1 + setenv --test GIT_TEST_ADD_I_USE_BUILTIN 0 + setenv --test GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME master + setenv --test GIT_TEST_WRITE_REV_INDEX 1 + setenv --test GIT_TEST_CHECKOUT_WORKERS 2 ;; linux-clang) - export GIT_TEST_DEFAULT_HASH=sha1 + setenv --test GIT_TEST_DEFAULT_HASH sha1 ;; linux-sha256) - export GIT_TEST_DEFAULT_HASH=sha256 + setenv --test GIT_TEST_DEFAULT_HASH sha256 ;; pedantic) # Don't run the tests; we only care about whether Git can be # built. - export DEVOPTS=pedantic + setenv --build DEVOPTS pedantic run_tests= ;; esac From patchwork Thu Jul 14 19:39:45 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: 12918469 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 69CA5C43334 for ; Thu, 14 Jul 2022 19:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240723AbiGNTk1 (ORCPT ); Thu, 14 Jul 2022 15:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240678AbiGNTkR (ORCPT ); Thu, 14 Jul 2022 15:40:17 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7278B4E604 for ; Thu, 14 Jul 2022 12:40:03 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id h17so3976043wrx.0 for ; Thu, 14 Jul 2022 12:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mu5304LIRy4EjJa/BSabxbQ9vfo8KhdGjNbQqovpLRA=; b=Wq93WQfC1rtQhYqZ3OzQ10FDZocmCmEu4kK6o2KwDQ2YanVcgSd4vS6s5Q1qvzJPv6 97ApdPtZvewJZUK5TOQkES2t6MPLj4vea8nAS7zkMcBecSdhxIyv0Rsc4Zv7ohk6Tm5d 2QhzB3C6M+8SYitykd/zEpEVDqClOi1k2ZWxGXJuyZ0mtvSOu8hhorkWPO8OkkqWrbqj aVVDo9or6HS1yjyJwlm15o0QjrvlDVl4lz4I8Pcb6XoLFFSlivTZ7jFXdTOHgd1TewYs 93WP94cAhkTDOVQhnYrzqsx/aoTR/CZAAa1lHoz5BSEFY2+TLg8ICLgDnLVGLpzcELiZ CGqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mu5304LIRy4EjJa/BSabxbQ9vfo8KhdGjNbQqovpLRA=; b=EcUV0YpbtEN0aQ3c4MnEGGl3aJITgSPafg0gRfH325ry9fTqvSOxM5FqtAzpLX1r71 hKcMoEWkr5QkHH9Tv1LzxBXb5q3/rOCAt6BYwBA8tqVx67AFGE6DOcGBTjytgbPIu5y5 BV14/ozt2nqDbCeRWR+jf80/gN3aV9u9YOEsNj98NB5PAcA8hs/I/k6BucEp3yr5tAcs Lh90fL9G+iDwpTfV5qakOdHSuYX/Y0BMBOSKKRiCsWlhqQBh4Q7cth9Uh7XKS92fI1W8 fxZsuszECi13gmYUIGHkgV5oS85OPXxw74z8r6KyLmhQP1iQmlcucfL+2mIOaDndw2e4 OzQA== X-Gm-Message-State: AJIora/Kr1bo9+zL0A7kxmogl68gB2DwiuZ8oG+M65bsACpYnBiY/xaS 3M5EcDR2PvyDQq5DXhm0NPDYt1MsFxnzGg== X-Google-Smtp-Source: AGRyM1vh/57Eo9ClLcYvR8/OfcEUEcs9Uhu8aqvPanj63nJdXNuZZTNs3JaUsEYfiYeocp+ffvDPRg== X-Received: by 2002:adf:f64f:0:b0:21d:76c6:d98 with SMTP id x15-20020adff64f000000b0021d76c60d98mr9561219wrp.299.1657827601743; Thu, 14 Jul 2022 12:40:01 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.40.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:40:00 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 08/10] CI: don't have "git grep" invoke a pager in tree content check Date: Thu, 14 Jul 2022 21:39:45 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Fix the omission of not adding "-P" (a.k.a. "--no-pager") to the "git" invocation that spaws "git grep", added in 0e7696c64db (ci: disallow directional formatting, 2021-11-04). This didn't matter for the GitHub CI, but does when running the check locally. A subsequent commit will start invoking it via a new check from the top-level Makefile, and without this we'd visibly spawn a pager when doing so. Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/check-directional-formatting.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/check-directional-formatting.bash b/ci/check-directional-formatting.bash index e6211b141aa..de8e6e486f0 100755 --- a/ci/check-directional-formatting.bash +++ b/ci/check-directional-formatting.bash @@ -23,5 +23,5 @@ # U+2066..U+2069: LRI, RLI, FSI and PDI regex='(\u202a|\u202b|\u202c|\u202d|\u202e|\u2066|\u2067|\u2068|\u2069)' -! LC_CTYPE=C git grep -El "$(LC_CTYPE=C.UTF-8 printf "$regex")" \ +! LC_CTYPE=C git -P grep -El "$(LC_CTYPE=C.UTF-8 printf "$regex")" \ -- ':(exclude,attr:binary)' ':(exclude)*.po' From patchwork Thu Jul 14 19:39:46 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: 12918471 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 46167C43334 for ; Thu, 14 Jul 2022 19:40:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240737AbiGNTka (ORCPT ); Thu, 14 Jul 2022 15:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240681AbiGNTkT (ORCPT ); Thu, 14 Jul 2022 15:40:19 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D644A67C83 for ; Thu, 14 Jul 2022 12:40:04 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id r2so2887906wrs.3 for ; Thu, 14 Jul 2022 12:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=67zCS8QrRmMaaIxEzKVkATJBA2wVj3iyoC5a4Md1UR0=; b=mVQqHW/2Kd4oYpLh1V9NrGy8bdzEh+g5b5zqve0ek6LDqhxdE4mQNMF04/GNRGi3ao KXHwMZNR+9zMbw9rhEK/+fg9iUNeU7DL7hGnueZiu6AjEDsktZ5r62kNJQioGFXlf9VU 0sQ0qDRCYIIfbXX8DvSbm9Z7PO/FcPIi5OfL38uTyckfLhQxOKcw5i33QA9FF6XYCQxl PGnknKcZ4Ab/tSf6k+BLbcQiTmio6NBbf0lvYzvqixf1w8sSf9rBIb5eLEKeApC93mdX yz3hi5mHGSbfQqC3j3opBnOumtnocC/GUv3dMdqnESdND1JMbdTGf+30rZCmOm39ASs/ H/qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=67zCS8QrRmMaaIxEzKVkATJBA2wVj3iyoC5a4Md1UR0=; b=mG/nZiQ/d/YWklBFBxBGVtsCbPnma5pzNZyBvQPTUBTBYFCfONId4dAwnXFQA9/fEj BVZWl/Et+jxCog52sByCDPE724PdEphGszds54HFHajB4htcC6ObngizkpRRzxdredPn UPoIK75J7kSw7sGfBrPaSWbDfRSrr9gAeLCYHLGmUyTXUtup3Zy6sJm3DAVD96S7+VCu 4Tnjo+P6U263xiG65s/05xQBRp7daOy3i+BnvOV0qXK3yJuBEUJz71Y/ZQ1zyxXDpoPP 0RGDz0sfGy+CV3lq6/D3A5l32eDi+LD4qt087E9iLnOV6ZGFqPlBTKQz/mwldywiPVxQ T9Vw== X-Gm-Message-State: AJIora/H9KBG4YPOYRhpoJiVGCCzljevUfP7EMP3rC42zSZMS0uy92Sg aS0QnOhtDIVM/VHxtOCL6m/a8h+tkkSSyQ== X-Google-Smtp-Source: AGRyM1uiiaEW8yJ89YXIBg4c1kBRKJTFgi8tDQDdzxPxhr63wnwSh20OTk2eUgCRb0cDutpok78JOw== X-Received: by 2002:a5d:434a:0:b0:21d:aa7e:b1bb with SMTP id u10-20020a5d434a000000b0021daa7eb1bbmr9974017wrr.619.1657827603065; Thu, 14 Jul 2022 12:40:03 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:40:02 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 09/10] CI: have "static-analysis" run a "make ci-static-analysis" target Date: Thu, 14 Jul 2022 21:39:46 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Make it easier to run the CI logic locally by creating "ci-static-analysis" target. Now the "check-coccicheck" logic added in 0860a7641ba (travis-ci: fail if Coccinelle static analysis found something to transform, 2018-07-23) can be easily tested outside of CI, and likewise the sanity check added in 0e7696c64db (ci: disallow directional formatting, 2021-11-04). These targets could be improved, the "hdr-check" target will re-do all of its work every time it's run, and could with a change similar to my c234e8a0ecf (Makefile: make the "sparse" target non-.PHONY, 2021-09-23). The same goes for the new "ci-check-directional-formatting" target. But without those improvements being able to easily run a 1=1 equivalent of the checks we do in CI during a local build is already an improvement. This change will also make the CI check faster, since we can take advantage of parallelism across these "make" invocations. The "make coccicheck" command in particular takes a long to finish its last job, at the end we might only have one job pegging 100% of one CPU core. Now any extra cores will be free to run the rest of the targets under "ci-static-analysis". Because we're now going to invoke "make" directly from the CI recipe we'll need to amend the new "setenv" wrapper to write the "MAKEFLAGS" and other variables to "$GITHUB_ENV". In my testing the "static-analysis" job runs in just over 10 minutes without this change, but this change cuts just over a minute off the runtime. Signed-off-by: Ævar Arnfjörð Bjarmason --- .github/workflows/main.yml | 6 ++++-- Makefile | 29 +++++++++++++++++++++++++++++ ci/lib.sh | 7 ++++++- ci/run-static-analysis.sh | 32 -------------------------------- shared.mak | 1 + 5 files changed, 40 insertions(+), 35 deletions(-) delete mode 100755 ci/run-static-analysis.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b7697df9fb..fa6d861c75a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -319,9 +319,11 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 + - run: ci/lib.sh + env: + NO_CI_GROUPS: 1 - run: ci/install-dependencies.sh - - run: ci/run-static-analysis.sh - - run: ci/check-directional-formatting.bash + - run: make ci-static-analysis sparse: needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' diff --git a/Makefile b/Makefile index 04d0fd1fe60..c328e190d64 100644 --- a/Makefile +++ b/Makefile @@ -3147,6 +3147,20 @@ coccicheck: $(addsuffix .patch,$(filter-out %.pending.cocci,$(wildcard contrib/c # See contrib/coccinelle/README coccicheck-pending: $(addsuffix .patch,$(wildcard contrib/coccinelle/*.pending.cocci)) +.PHONY: check-coccicheck +check-coccicheck: coccicheck + $(QUIET_CHECK)for cocci_patch in contrib/coccinelle/*.patch; do \ + if test -s "$$cocci_patch"; then \ + echo "Coccinelle suggests the following changes in '$$cocci_patch':"; \ + cat "$$cocci_patch"; \ + fail=UnfortunatelyYes; \ + fi \ + done; \ + if test -n "$$fail"; then \ + echo "error: Coccinelle suggested some changes"; \ + exit 1; \ + fi + .PHONY: coccicheck coccicheck-pending ### Installation rules @@ -3589,3 +3603,18 @@ $(FUZZ_PROGRAMS): all $(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@ fuzz-all: $(FUZZ_PROGRAMS) + +### CI "check" targets +# +# These targets are run from the CI, see .github/workflows/main.yml, +# but can also be run manually to run the same assertions locally. + +.PHONY: ci-check-directional-formatting +ci-check-directional-formatting: + $(QUIET_CHECK)ci/check-directional-formatting.bash + +.PHONY: ci-static-analysis +ci-static-analysis: ci-check-directional-formatting +ci-static-analysis: check-coccicheck +ci-static-analysis: hdr-check +ci-static-analysis: check-pot diff --git a/ci/lib.sh b/ci/lib.sh index 67b7b32a0f1..14d0af2fa7f 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -15,7 +15,7 @@ then exit 1 fi -if test true != "$GITHUB_ACTIONS" +if test true != "$GITHUB_ACTIONS" || test -n "$NO_CI_GROUPS" then begin_group () { :; } end_group () { :; } @@ -89,6 +89,11 @@ setenv () { eval "$key=\"$val\"" eval "export $key" + eval "export $key=\"$val\"" + if test -n "$GITHUB_ENV" + then + echo "$key=$val" >>"$GITHUB_ENV" + fi } check_unignored_build_artifacts () { diff --git a/ci/run-static-analysis.sh b/ci/run-static-analysis.sh deleted file mode 100755 index faae31f0078..00000000000 --- a/ci/run-static-analysis.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# Perform various static code analysis checks -# - -. ${0%/*}/lib.sh - -make coccicheck - -set +x - -fail= -for cocci_patch in contrib/coccinelle/*.patch -do - if test -s "$cocci_patch" - then - echo "$(tput setaf 1)Coccinelle suggests the following changes in '$cocci_patch':$(tput sgr0)" - cat "$cocci_patch" - fail=UnfortunatelyYes - fi -done - -if test -n "$fail" -then - echo "$(tput setaf 1)error: Coccinelle suggested some changes$(tput sgr0)" - exit 1 -fi - -make hdr-check || -exit 1 - -make check-pot diff --git a/shared.mak b/shared.mak index 4330192e9c3..3bd846aaf9e 100644 --- a/shared.mak +++ b/shared.mak @@ -58,6 +58,7 @@ ifndef V ## Used in "Makefile" QUIET_CC = @echo ' ' CC $@; QUIET_AR = @echo ' ' AR $@; + QUIET_CHECK = @echo ' ' CHECK $@; QUIET_LINK = @echo ' ' LINK $@; QUIET_BUILT_IN = @echo ' ' BUILTIN $@; QUIET_LNCP = @echo ' ' LN/CP $@; From patchwork Thu Jul 14 19:39:47 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: 12918470 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 666CDC433EF for ; Thu, 14 Jul 2022 19:40:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240733AbiGNTk3 (ORCPT ); Thu, 14 Jul 2022 15:40:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240650AbiGNTkT (ORCPT ); Thu, 14 Jul 2022 15:40:19 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04B5B675A0 for ; Thu, 14 Jul 2022 12:40:05 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id r10so3923192wrv.4 for ; Thu, 14 Jul 2022 12:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5IpB1WaWFqwrOFCg2h5vGzP4eena/PfGuElhSyAnirk=; b=fl2gUPekHzOcPDr5FMrB226iq5iCimd3wPBgKKLJR0AaYApmigUHH6BHnveC1R48xT 1Wd1LL1ZGlYg+p+47MFQF49VVHRJkndojlzQaDmcnAxRqmx7m0w4yWYxkzD7JjpdyU4F ipkBAA6uwWmifaEKFiGcV+nTnLlfYRN/RlhF7VNKmyk0dO2rZVILzlcn7kQNiVWcRLop XkRJEE132TC0YB5Ql52w+n6/diHBba1t+OMZOI7drGCPcD9alPjddPlFSrX2tRfVbKDi 2lZPhqJFU9qpQC1/3h0X24PrDVqzpS69R1MRCVc3rbFGXF1rEhVK82s/mN+pVKAoDA2O 3NaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5IpB1WaWFqwrOFCg2h5vGzP4eena/PfGuElhSyAnirk=; b=JhjYWOkakYWXRyRUvIjjpoMkqtW63NdOkZQFCbHZFGOZx/yBY+IHDbo7eqBNEm568P +oKyUxe/YrU3vdy92KMVSzSnnVIN+1itWdxAukNo6LRaokfiu7tA9phqMrDEG3VdUvet 1evOXPRp0x8+fn0lNuhDyyUaT4dnB3yz13vnszE4umvkss1e2LSa3wjuL3Lwu9x0BC1Y hE5ge/4+YfpAdc3qL1JgyovNysJ2ZnO6qq4CcsN/lZnQsbNwKalHbS7HtmFkV9nNFKCt aLlW3Iu/+OsA0vIGCNYR4NKI1ILtVg5WvfCwJO3LCmUnXCLEAeR9wnygRkDIajqHhjaZ k+hw== X-Gm-Message-State: AJIora9gwxVnNS7r90Ig7n5J4qaUvq01YEgz6A+xzXzf/la7S2XRNRdx AgpD47og82gW4nGf4mroh8gy1eHGlczWWg== X-Google-Smtp-Source: AGRyM1uTiFzqcpCx0NsAOqknZOI7BlJ6tJlFc6qUYjVZIaevtYUA7PstxYVqF/t5jqtzOuuqnHYSAQ== X-Received: by 2002:a05:6000:2aa:b0:21d:ac4f:587c with SMTP id l10-20020a05600002aa00b0021dac4f587cmr9832535wry.675.1657827604267; Thu, 14 Jul 2022 12:40:04 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w9-20020a05600018c900b0021dac657337sm2145145wrq.75.2022.07.14.12.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 12:40:03 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Carlo_Marce?= =?utf-8?q?lo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFz?= =?utf-8?b?b24=?= Subject: [PATCH 10/10] CI: have "static-analysis" run "check-builtins", not "documentation" Date: Thu, 14 Jul 2022 21:39:47 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.996.g651fc6e809f In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Move the "make check-builtins" check from the "documentation" job to the "static-analysis" job. The "check-builtins" target added in c74390e4a1d (cherry is built-in, do not ship git-cherry.sh, 2006-11-05) is unrelated to the documentation, so it's odd that b98712b9aa9 (travis-ci: build documentation, 2016-05-04) added it to the "documentation" job. Let's just move it to the "ci-static-analysis" target, and while we're at it improve the output with $(QUIET_CHECK). Signed-off-by: Ævar Arnfjörð Bjarmason --- Makefile | 3 ++- ci/test-documentation.sh | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c328e190d64..c2b0a728df5 100644 --- a/Makefile +++ b/Makefile @@ -3520,7 +3520,7 @@ check-docs:: ### Make sure built-ins do not have dups and listed in git.c # check-builtins:: - ./check-builtins.sh + $(QUIET_CHECK)./check-builtins.sh ### Test suite coverage testing # @@ -3615,6 +3615,7 @@ ci-check-directional-formatting: .PHONY: ci-static-analysis ci-static-analysis: ci-check-directional-formatting +ci-static-analysis: check-builtins ci-static-analysis: check-coccicheck ci-static-analysis: hdr-check ci-static-analysis: check-pot diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh index 9e0652c30dd..41e2b126311 100755 --- a/ci/test-documentation.sh +++ b/ci/test-documentation.sh @@ -14,7 +14,6 @@ filter_log () { "$1" } -make check-builtins make check-docs # Build docs with AsciiDoc