Thread View: linux.kernel.git
8 messages
8 total messages
Started by "Harald Nordgren via GitGitGadge...
Fri, 23 Oct 2026 16:50
[PATCH v2] ci: fail the build if perforce, git-lfs, or JGit fail to install
Author: "Harald Nordgren via GitGitGadge...
Date: Fri, 23 Oct 2026 16:50
Date: Fri, 23 Oct 2026 16:50
280 lines
20974 bytes
20974 bytes
From: Harald Nordgren <haraldnordgren@gmail.com>
A failed install of perforce, git-lfs, or JGit was silently
tolerated. The corresponding tests would just skip and the build
stayed green, so a broken download could go unnoticed indefinitely.
Fail the build immediately instead on the platforms that install
these tools. The presence checks and warnings at the end of the
script are gone too, since we already know by then that everything
installed or the build wouldn't have gotten this far.
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
---
ci: fail the build if perforce, git-lfs or JGit fail to install
Fail the build if perforce, git-lfs or JGit fail to install on the
platforms that install them.
Changes in v2:
* Perforce, git-lfs, and JGit install failures now fail the build
instead of being silently swallowed. Removed the presence checks and
warnings at the end of the script, dead code once install failure is
fatal.
* Version output (p4d -V, git-lfs version, jgit version) moved inline
right after each successful install.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2403%2FHaraldNordgren%2Fci-scope-optional-tool-warnings-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2403/HaraldNordgren/ci-scope-optional-tool-warnings-v2
Pull-Request: https://github.com/git/git/pull/2403
Range-diff vs v1:
1: 3ce51dc322 ! 1: dde1b38567 ci: only warn about perforce/git-lfs/JGit on platforms that need them
@@ Metadata
Author: Harald Nordgren <haraldnordgren@gmail.com>
## Commit message ##
- ci: only warn about perforce/git-lfs/JGit on platforms that need them
+ ci: fail the build if perforce, git-lfs, or JGit fail to install
- perforce, git-lfs, and JGit test git's own interop code, not anything
- platform-specific, so installing them once on ubuntu-* (all three)
- and macos-* (perforce) is enough coverage. debian, i386/ubuntu,
- alpine, fedora and almalinux never install them, yet the presence
- check at the end of the script warned on all of them anyway.
+ A failed install of perforce, git-lfs, or JGit was silently
+ tolerated. The corresponding tests would just skip and the build
+ stayed green, so a broken download could go unnoticed indefinitely.
- Scope each check to the platforms that attempt the install, so a
- warning means one actually failed.
+ Fail the build immediately instead on the platforms that install
+ these tools. The presence checks and warnings at the end of the
+ script are gone too, since we already know by then that everything
+ installed or the build wouldn't have gotten this far.
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
## ci/install-dependencies.sh ##
+@@ ci/install-dependencies.sh: ubuntu-*|i386/ubuntu-*|debian-*)
+ "$P4WHENCE/bin.linux26x86_64/p4d" \
+ "$P4WHENCE/bin.linux26x86_64/p4" &&
+ chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4" || {
+- rm -f "$CUSTOM_PATH/p4"
+- rm -f "$CUSTOM_PATH/p4d"
++ echo >&2 "error: could not install perforce"
++ exit 1
+ }
++ echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
++ p4d -V
++ echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
++ p4 -V
+
+ wget --quiet \
+ "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" &&
+ tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
+ -C "$CUSTOM_PATH" --strip-components=1 \
+ "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs" &&
+- rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" ||
+- rm -f "$CUSTOM_PATH/git-lfs"
++ rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" || {
++ echo >&2 "error: could not install git-lfs"
++ exit 1
++ }
++ echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
++ git-lfs version
+
+ wget --quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit" &&
+- chmod a+x "$CUSTOM_PATH/jgit" ||
+- rm -f "$CUSTOM_PATH/jgit"
++ chmod a+x "$CUSTOM_PATH/jgit" || {
++ echo >&2 "error: could not install JGit"
++ exit 1
++ }
++ echo "$(tput setaf 6)JGit Version$(tput sgr0)"
++ jgit version
+ ;;
+ esac
+ ;;
+@@ ci/install-dependencies.sh: macos-*)
+
+ mkdir -p "$CUSTOM_PATH"
+ wget -q "$P4WHENCE/bin.macosx12arm64/helix-core-server.tgz" &&
+- tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d &&
++ tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d || {
++ echo >&2 "error: could not install perforce"
++ exit 1
++ }
+ sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true
+ rm helix-core-server.tgz
++ echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
++ p4d -V
++ echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
++ p4 -V
+
+ case "$jobname" in
+ osx-meson)
@@ ci/install-dependencies.sh: Documentation)
;;
esac
@@ ci/install-dependencies.sh: Documentation)
-else
- echo >&2 "::warning:: perforce wasn't installed, see above for clues why"
-fi
-+case "$distro" in
-+ubuntu-*|macos-*)
-+ if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1
-+ then
-+ echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
-+ p4d -V
-+ echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
-+ p4 -V
-+ else
-+ echo >&2 "::warning:: perforce wasn't installed, see above for clues why"
-+ fi
-+ ;;
-+esac
-
+-
-if type git-lfs >/dev/null 2>&1
-then
- echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
@@ ci/install-dependencies.sh: Documentation)
-else
- echo >&2 "::warning:: git-lfs wasn't installed, see above for clues why"
-fi
-+case "$distro" in
-+ubuntu-*)
-+ if type git-lfs >/dev/null 2>&1
-+ then
-+ echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
-+ git-lfs version
-+ else
-+ echo >&2 "::warning:: git-lfs wasn't installed, see above for clues why"
-+ fi
-
+-
-if type jgit >/dev/null 2>&1
-then
- echo "$(tput setaf 6)JGit Version$(tput sgr0)"
@@ ci/install-dependencies.sh: Documentation)
-else
- echo >&2 "::warning:: JGit wasn't installed, see above for clues why"
-fi
-+ if type jgit >/dev/null 2>&1
-+ then
-+ echo "$(tput setaf 6)JGit Version$(tput sgr0)"
-+ jgit version
-+ else
-+ echo >&2 "::warning:: JGit wasn't installed, see above for clues why"
-+ fi
-+ ;;
-+esac
-
+-
end_group "Install dependencies"
ci/install-dependencies.sh | 59 +++++++++++++++++---------------------
1 file changed, 26 insertions(+), 33 deletions(-)
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index d57dce5663..dad35db78b 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -95,21 +95,33 @@ ubuntu-*|i386/ubuntu-*|debian-*)
"$P4WHENCE/bin.linux26x86_64/p4d" \
"$P4WHENCE/bin.linux26x86_64/p4" &&
chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4" || {
- rm -f "$CUSTOM_PATH/p4"
- rm -f "$CUSTOM_PATH/p4d"
+ echo >&2 "error: could not install perforce"
+ exit 1
}
+ echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
+ p4d -V
+ echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
+ p4 -V
wget --quiet \
"$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" &&
tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
-C "$CUSTOM_PATH" --strip-components=1 \
"git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs" &&
- rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" ||
- rm -f "$CUSTOM_PATH/git-lfs"
+ rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" || {
+ echo >&2 "error: could not install git-lfs"
+ exit 1
+ }
+ echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
+ git-lfs version
wget --quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit" &&
- chmod a+x "$CUSTOM_PATH/jgit" ||
- rm -f "$CUSTOM_PATH/jgit"
+ chmod a+x "$CUSTOM_PATH/jgit" || {
+ echo >&2 "error: could not install JGit"
+ exit 1
+ }
+ echo "$(tput setaf 6)JGit Version$(tput sgr0)"
+ jgit version
;;
esac
;;
@@ -121,9 +133,16 @@ macos-*)
mkdir -p "$CUSTOM_PATH"
wget -q "$P4WHENCE/bin.macosx12arm64/helix-core-server.tgz" &&
- tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d &&
+ tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d || {
+ echo >&2 "error: could not install perforce"
+ exit 1
+ }
sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true
rm helix-core-server.tgz
+ echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
+ p4d -V
+ echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
+ p4 -V
case "$jobname" in
osx-meson)
@@ -171,30 +190,4 @@ Documentation)
;;
esac
-if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1
-then
- echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
- p4d -V
- echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
- p4 -V
-else
- echo >&2 "::warning:: perforce wasn't installed, see above for clues why"
-fi
-
-if type git-lfs >/dev/null 2>&1
-then
- echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
- git-lfs version
-else
- echo >&2 "::warning:: git-lfs wasn't installed, see above for clues why"
-fi
-
-if type jgit >/dev/null 2>&1
-then
- echo "$(tput setaf 6)JGit Version$(tput sgr0)"
- jgit version
-else
- echo >&2 "::warning:: JGit wasn't installed, see above for clues why"
-fi
-
end_group "Install dependencies"
base-commit: 7e34d8174dcda3435d1404c9a30bef46afe6c13e
--
gitgitgadget
Re: [PATCH v2] ci: fail the build if perforce, git-lfs, or JGit fail to install
Author: Junio C Hamano
Date: Fri, 23 Oct 2026 21:48
Date: Fri, 23 Oct 2026 21:48
83 lines
15655 bytes
15655 bytes
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> A failed install of perforce, git-lfs, or JGit was silently
> tolerated. The corresponding tests would just skip and the build
> stayed green, so a broken download could go unnoticed indefinitely.
>
> Fail the build immediately instead on the platforms that install
> these tools. The presence checks and warnings at the end of the
> script are gone too, since we already know by then that everything
> installed or the build wouldn't have gotten this far.
>
> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
> ...
> ci/install-dependencies.sh | 59 +++++++++++++++++---------------------
> 1 file changed, 26 insertions(+), 33 deletions(-)
>
> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
> index d57dce5663..dad35db78b 100755
> --- a/ci/install-dependencies.sh
> +++ b/ci/install-dependencies.sh
> @@ -95,21 +95,33 @@ ubuntu-*|i386/ubuntu-*|debian-*)
> "$P4WHENCE/bin.linux26x86_64/p4d" \
> "$P4WHENCE/bin.linux26x86_64/p4" &&
> chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4" || {
> - rm -f "$CUSTOM_PATH/p4"
> - rm -f "$CUSTOM_PATH/p4d"
> + echo >&2 "error: could not install perforce"
> + exit 1
> }
We used to attempt cleaning after ourselves before giving up (and
continuing), but now we explicitly die and there is no need to
remove the half-installed stuff, which makes sense. The same
comment for lfs and jgit (omitted from quotes).
> @@ -121,9 +133,16 @@ macos-*)
>
> mkdir -p "$CUSTOM_PATH"
> wget -q "$P4WHENCE/bin.macosx12arm64/helix-core-server.tgz" &&
> - tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d &&
> + tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d || {
> + echo >&2 "error: could not install perforce"
> + exit 1
> + }
> sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true
> rm helix-core-server.tgz
The earlier one tried to make them executable, and failed when it
cannot. I wonder you want to move "|| { ... fail ... }" below the
xattr line for consistency, but the command line says "we do not
care if we cannot remove the attribute and will keep going", so it
cannot be done without dropping "|| true" there. Hmm...
> + echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
> + p4d -V
> + echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
> + p4 -V
>
> case "$jobname" in
> osx-meson)
> @@ -171,30 +190,4 @@ Documentation)
> ;;
> esac
>
> -if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1
> -then
> ...
> - jgit version
> -else
> - echo >&2 "::warning:: JGit wasn't installed, see above for clues why"
> -fi
> -
And it is very nice to see these all go, as we have done the
reporting all very close to where they are installed.
> end_group "Install dependencies"
>
> base-commit: 7e34d8174dcda3435d1404c9a30bef46afe6c13e
Re: [PATCH v2] ci: fail the build if perforce, git-lfs, or JGit fail to install
Author: Harald Nordgren
Date: Fri, 23 Oct 2026 22:59
Date: Fri, 23 Oct 2026 22:59
7 lines
11802 bytes
11802 bytes
I interpret this as needing no further action now. Is that correct? Thanks for looking at this! Harald
Re: [PATCH v2] ci: fail the build if perforce, git-lfs, or JGit fail to install
Author: Junio C Hamano
Date: Fri, 23 Oct 2026 23:06
Date: Fri, 23 Oct 2026 23:06
8 lines
13035 bytes
13035 bytes
Harald Nordgren <haraldnordgren@gmail.com> writes: > I interpret this as needing no further action now. Is that correct? Not necessarily. It merely means that I just didn't find anything wrong within the time I could allocate for this topic. Somebody else may want to give a real positive review to move it forward.
Re: [PATCH v2] ci: fail the build if perforce, git-lfs, or JGit fail to install
Author: Harald Nordgren
Date: Mon, 26 Oct 2026 07:38
Date: Mon, 26 Oct 2026 07:38
50 lines
13775 bytes
13775 bytes
> > wget --quiet \
> > "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" &&
> > tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
> > -C "$CUSTOM_PATH" --strip-components=1 \
> > "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs" &&
> > - rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" ||
> > - rm -f "$CUSTOM_PATH/git-lfs"
> > + rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" || {
> > + echo >&2 "error: could not install git-lfs"
> > + exit 1
> > + }
>
> This could all be a bit less convoluted if we had `set -e` in
> "ci/lib.sh". But that certainly is outside the scope of this patch
> series, so meanwhile this looks good to me.
Yeah, `set -e` is a gem of a command. Would be good to do later!
> > @@ -121,9 +133,16 @@ macos-*)
> >
> > mkdir -p "$CUSTOM_PATH"
> > wget -q "$P4WHENCE/bin.macosx12arm64/helix-core-server.tgz" &&
> > - tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d &&
> > + tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d || {
> > + echo >&2 "error: could not install perforce"
> > + exit 1
> > + }
> > sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true
>
> This line is a bit curious, it makes me wonder whether we want to
> tighten it as well now. Any reason why we wouldn't?
I asked Claud about it and it said this, does it make sense?
'wget/curl never set com.apple.quarantine in the first place (only
Safari/Finder/AirDrop do, via the LaunchServices quarantine API), so
xattr -d on these files always fails with "No such xattr." Tightening
it to fatal would break every macOS build, every time.'
> > rm helix-core-server.tgz
>
> Nit: this is inconsistent with git-lfs, where we also have the call to
> rm as part of the condition chain.
Good point!
Harald
Re: [PATCH v2] ci: fail the build if perforce, git-lfs, or JGit fail to install
Author: Harald Nordgren
Date: Mon, 26 Oct 2026 07:41
Date: Mon, 26 Oct 2026 07:41
23 lines
12859 bytes
12859 bytes
> > > wget --quiet \
> > > "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" &&
> > > tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
> > > -C "$CUSTOM_PATH" --strip-components=1 \
> > > "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs" &&
> > > - rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" ||
> > > - rm -f "$CUSTOM_PATH/git-lfs"
> > > + rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" || {
> > > + echo >&2 "error: could not install git-lfs"
> > > + exit 1
> > > + }
> >
> > This could all be a bit less convoluted if we had `set -e` in
> > "ci/lib.sh". But that certainly is outside the scope of this patch
> > series, so meanwhile this looks good to me.
>
> Yeah, `set -e` is a gem of a command. Would be good to do later!
But wait, we already have it in "ci/lib.sh"!
Harald
Re: [PATCH v2] ci: fail the build if perforce, git-lfs, or JGit fail to install
Author: Harald Nordgren
Date: Mon, 26 Oct 2026 08:08
Date: Mon, 26 Oct 2026 08:08
25 lines
12666 bytes
12666 bytes
> > > > This could all be a bit less convoluted if we had `set -e` in > > > > "ci/lib.sh". But that certainly is outside the scope of this patch > > > > series, so meanwhile this looks good to me. > > > > > > Yeah, `set -e` is a gem of a command. Would be good to do later! > > > > But wait, we already have it in "ci/lib.sh"! > > Oh, I missed that! > > The question then becomes whether the error message is worth it. In case > we see traces (`set -x`) I think it's somewhat pointless as you'd > trivially see the last failing command anyway, so you'd know why it has > failed. Yes, probably. > Anyway, this is all a bit of a tangent, I don't think there's a strong > reason that this really must change. I'll take a look at what I can do without ballooning this topic. Harald
Re: [PATCH v2] ci: fail the build if perforce, git-lfs, or JGit fail to install
Author: Harald Nordgren
Date: Mon, 26 Oct 2026 08:13
Date: Mon, 26 Oct 2026 08:13
37 lines
13495 bytes
13495 bytes
On Mon, Oct 26, 2026 at 10:07 AM Patrick Steinhardt <ps@pks.im> wrote:
>
> On Mon, Oct 26, 2026 at 09:38:10AM +0200, Harald Nordgren wrote:
> > > > @@ -121,9 +133,16 @@ macos-*)
> > > >
> > > > mkdir -p "$CUSTOM_PATH"
> > > > wget -q "$P4WHENCE/bin.macosx12arm64/helix-core-server.tgz" &&
> > > > - tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d &&
> > > > + tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d || {
> > > > + echo >&2 "error: could not install perforce"
> > > > + exit 1
> > > > + }
> > > > sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true
> > >
> > > This line is a bit curious, it makes me wonder whether we want to
> > > tighten it as well now. Any reason why we wouldn't?
> >
> > I asked Claud about it and it said this, does it make sense?
> >
> > 'wget/curl never set com.apple.quarantine in the first place (only
> > Safari/Finder/AirDrop do, via the LaunchServices quarantine API), so
> > xattr -d on these files always fails with "No such xattr." Tightening
> > it to fatal would break every macOS build, every time.'
>
> Well, if so we should be able to remove it without any detriment, right?
> Maybe that could be part of a preparatory patch.
Best way to find out is just to do it, I guess. I can include it in v3
and then you can trigger a build on GitLab with it? I'll let GitHub CI
pass before pushing anything out.
Harald
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads