Skip to content

ci: fail the build if perforce, git-lfs, or JGit fail to install - #2403

Open
HaraldNordgren wants to merge 1 commit into
git:masterfrom
HaraldNordgren:ci-scope-optional-tool-warnings
Open

HaraldNordgren wants to merge 1 commit into
git:masterfrom
HaraldNordgren:ci-scope-optional-tool-warnings

Conversation

@HaraldNordgren

@HaraldNordgren HaraldNordgren commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

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.

cc: Patrick Steinhardt ps@pks.im

@HaraldNordgren
HaraldNordgren force-pushed the ci-scope-optional-tool-warnings branch from 35a6f20 to ec780d2 Compare September 12, 2026 12:10
@HaraldNordgren HaraldNordgren changed the title ci: only warn about perforce/git-lfs/JGit where we install them ci: only warn about perforce/git-lfs/JGit on platforms that need them Sep 12, 2026
@HaraldNordgren
HaraldNordgren force-pushed the ci-scope-optional-tool-warnings branch from ec780d2 to 3ce51dc Compare September 12, 2026 12:20
@HaraldNordgren

Copy link
Copy Markdown
Contributor Author

/submit

@gitgitgadget-git

Copy link
Copy Markdown

Submitted as pull.2403.git.git.1789223882471.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-2403/HaraldNordgren/ci-scope-optional-tool-warnings-v1

To fetch this version to local tag pr-git-2403/HaraldNordgren/ci-scope-optional-tool-warnings-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-2403/HaraldNordgren/ci-scope-optional-tool-warnings-v1

@Cyberverse-cent0

This comment was marked as low quality.

@gitgitgadget-git

Copy link
Copy Markdown

Junio C Hamano wrote on the Git mailing list (how to reply to this email):

"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> 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.
>
> Scope each check to the platforms that attempt the install, so a
> warning means one actually failed.
>
> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
>     ci: only warn about perforce/git-lfs/JGit on platforms that need them
>     
>     Only warn about a missing perforce/git-lfs/JGit install on the platforms
>     that actually need and attempt them (ubuntu-*, plus macOS for perforce),
>     since every other platform never installs them and was warning
>     regardless.

It is curious that nobody seems to have looked at this patch, as my
cursory look suggests it would be a no brainer to check correctness
of this under the assumption that nothing will change externally.

The maintenance to keep this in sync with what exactly are tested in
each platforms will be made more costly with this change, but I do
not know by how much.  If somebody wants to start testing p4 on a
different platform, for example, as I think t98xx will just punt
without failing if p4 is not available, it will probably be a while
until they eventually notice that their test do not run due to lack
of p4 and then they have to add their platform to the logic added by
this patch.  I think jgit is also the same; silent success when JGIT
prerequisite is not met.  But if they are motivated enough to add
tests, they will eventually notice when the tests they wanted to run
were not running, so it is a reasonably low risk.  If somebody wants
to drop testing jgit on a platform, we may still install jgit even
though we do not run tests that require jgit, which may take longer
for us to notice, but the result is just as bad at most as the state
without this change, so overall I think it makes sense.

Any volunteers to offer a second pair of eyes?

Thanks.


> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2403%2FHaraldNordgren%2Fci-scope-optional-tool-warnings-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2403/HaraldNordgren/ci-scope-optional-tool-warnings-v1
> Pull-Request: https://github.com/git/git/pull/2403
>
>  ci/install-dependencies.sh | 54 ++++++++++++++++++++++----------------
>  1 file changed, 31 insertions(+), 23 deletions(-)
>
> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
> index 2f61fbb07c..a68cec64b4 100755
> --- a/ci/install-dependencies.sh
> +++ b/ci/install-dependencies.sh
> @@ -171,30 +171,38 @@ 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
> +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)"
> -	git-lfs version
> -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)"
> -	jgit version
> -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"
>
> base-commit: 47ce80527c56f462cb97db4ca8125342204d3783

@gitgitgadget-git

Copy link
Copy Markdown

Patrick Steinhardt wrote on the Git mailing list (how to reply to this email):

On Sat, Sep 12, 2026 at 02:38:02PM +0000, Harald Nordgren via GitGitGadget wrote:
> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
> index 2f61fbb07c..a68cec64b4 100755
> --- a/ci/install-dependencies.sh
> +++ b/ci/install-dependencies.sh
> @@ -171,30 +171,38 @@ 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
> +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)"
> -	git-lfs version
> -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)"
> -	jgit version
> -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

I wonder whether it makes sense to have these warnings in the first
place.

Part of the reason why we have these checks is that we allow the
installation of these tools to fail, and if so we know to gracefully
continue anyway. Tests will be skipped, and the pipeline will be green
in such a case. But is that even a safe thing to do? I strongly doubt
that we'd start to notice such failures anytime soon, so it very much
gives us a false sense of confidence.

So I'd suggest that instead of warning, we should make the whole build
fail outright if we fail to install any of those tools. And once we do,
these warnings here become quite useless, because we know that the build
would fail on platforms where we expect the tools to be present. And on
platforms where we don't, the warning is pointless anyway.

Thanks!

Patrick

@gitgitgadget-git

Copy link
Copy Markdown

User Patrick Steinhardt <ps@pks.im> has been added to the cc: list.

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>
@HaraldNordgren
HaraldNordgren force-pushed the ci-scope-optional-tool-warnings branch from 3ce51dc to bb7e998 Compare September 28, 2026 19:36
@HaraldNordgren HaraldNordgren changed the title 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 Sep 28, 2026
@gitgitgadget-git

Copy link
Copy Markdown

Harald Nordgren wrote on the Git mailing list (how to reply to this email):

> I wonder whether it makes sense to have these warnings in the first
> place.
>
> Part of the reason why we have these checks is that we allow the
> installation of these tools to fail, and if so we know to gracefully
> continue anyway. Tests will be skipped, and the pipeline will be green
> in such a case. But is that even a safe thing to do? I strongly doubt
> that we'd start to notice such failures anytime soon, so it very much
> gives us a false sense of confidence.
>
> So I'd suggest that instead of warning, we should make the whole build
> fail outright if we fail to install any of those tools. And once we do,
> these warnings here become quite useless, because we know that the build
> would fail on platforms where we expect the tools to be present. And on
> platforms where we don't, the warning is pointless anyway.

Fine by me!


Harald

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants