threads / patch / 64930

patchci: avoid ubuntu:rolling in most jobs for now

Subject: [PATCH] ci: avoid ubuntu:rolling in most jobs for now

## tl;dr

6 messages between Feb 5, 2026 and Feb 7, 2026. Diffs are folded; open one to read it.

replies: 5people: 4as markdown or json

Junio C Hamano· Feb 5, 2026, 21:26 UTC · lore

We just was hit by buggy uutils dirname in ubuntu:rolling. Avoid breakage caused by being on the bleeding edge.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * So here is what I have near the merge of "let's test contrib/
   stuff as well" in 'seen' for today's integration to avoid getting
   hit by broken dirname in ubuntu:rolling reported earlier in
    https://lore.kernel.org/git/ef128e1d-dd3e-4573-bfcd-6a98a0a1f394@howdoi.land/
   Until uutils used by ubuntu:rolling stabilizes a bit more, we may
   want to keep a patch like this in our CI jobs.  Or we may offer
   ourselves as a guinea-pig?  I do not have strong preference
   either way.
 .github/workflows/main.yml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Show changes to .github/workflows/main.yml +7 −7
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f2e93f5461..0b4567c99f 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -377,10 +377,10 @@ jobs:
       matrix:
         vector:
         - jobname: linux-sha256
-          image: ubuntu:rolling
+          image: ubuntu:latest
           cc: clang
         - jobname: linux-reftable
-          image: ubuntu:rolling
+          image: ubuntu:latest
           cc: clang
         - jobname: linux-TEST-vars
           image: ubuntu:20.04
@@ -388,20 +388,20 @@ jobs:
           cc_package: gcc-8
         - jobname: linux-breaking-changes
           cc: gcc
-          image: ubuntu:rolling
+          image: ubuntu:latest
         - jobname: fedora-breaking-changes-meson
           image: fedora:latest
         - jobname: linux-leaks
-          image: ubuntu:rolling
+          image: ubuntu:latest
           cc: gcc
         - jobname: linux-reftable-leaks
-          image: ubuntu:rolling
+          image: ubuntu:latest
           cc: gcc
         - jobname: linux-asan-ubsan
-          image: ubuntu:rolling
+          image: ubuntu:latest
           cc: clang
         - jobname: linux-meson
-          image: ubuntu:rolling
+          image: ubuntu:latest
           cc: gcc
         - jobname: linux-musl-meson
           image: alpine:latest
-- 
2.53.0-181-gfd50f4332d
Collin Funk· Feb 5, 2026, 21:55 UTC · re: Junio C Hamano · lore

Re: [PATCH] ci: avoid ubuntu:rolling in most jobs for now

Junio C Hamano <gitster@pobox.com> writes:
Show 19 quoted lines
> We just was hit by buggy uutils dirname in ubuntu:rolling.
> Avoid breakage caused by being on the bleeding edge.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>
>  * So here is what I have near the merge of "let's test contrib/
>    stuff as well" in 'seen' for today's integration to avoid getting
>    hit by broken dirname in ubuntu:rolling reported earlier in
>
>     https://lore.kernel.org/git/ef128e1d-dd3e-4573-bfcd-6a98a0a1f394@howdoi.land/
>
>    Until uutils used by ubuntu:rolling stabilizes a bit more, we may
>    want to keep a patch like this in our CI jobs.  Or we may offer
>    ourselves as a guinea-pig?  I do not have strong preference
>    either way.
>
>  .github/workflows/main.yml | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)

If you would prefer to keep using ubuntu:rolling, you can do something like this:

    $ podman run --rm -it ubuntu:25.10
    $ dirname --version
    dirname (uutils coreutils) 0.2.2
    $ apt-get upgrade -y; apt-get update -y;
    [...]
    $ apt-get install -y coreutils-from-gnu coreutils-from-uutils- \
        --allow-remove-essential
    [...]
    $ dirname --version | head -n 1
    dirname (GNU coreutils) 9.5

I'm not familiar with the CI, so I am not voting for either option. I'll let others decide. :)

Collin
Patrick Steinhardt· Feb 6, 2026, 07:39 UTC · re: Junio C Hamano · lore

Re: [PATCH] ci: avoid ubuntu:rolling in most jobs for now

On Thu, Feb 05, 2026 at 01:26:42PM -0800, Junio C Hamano wrote:
Show 16 quoted lines
> We just was hit by buggy uutils dirname in ubuntu:rolling.
> Avoid breakage caused by being on the bleeding edge.
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> 
>  * So here is what I have near the merge of "let's test contrib/
>    stuff as well" in 'seen' for today's integration to avoid getting
>    hit by broken dirname in ubuntu:rolling reported earlier in
> 
>     https://lore.kernel.org/git/ef128e1d-dd3e-4573-bfcd-6a98a0a1f394@howdoi.land/
> 
>    Until uutils used by ubuntu:rolling stabilizes a bit more, we may
>    want to keep a patch like this in our CI jobs.  Or we may offer
>    ourselves as a guinea-pig?  I do not have strong preference
>    either way.

I think being a guinea-pig and reporting any issues we find to upstream would be the best outcome. It's feasible that eventually, Ubuntu may fully switch over to uutils, and if that's the case it would be great if we had already ironed out all the bugs that we happen to hit ourselves.

So I think demoting to "latest" is a fine intermediate step to fix our CI, but ideally we'd do a similar workaround to the sudo.ws workaround we have in "ci/install-dependencies.sh" so that we only disable the pieces that _don't_ work. That'd make it easy to contiue using the parts that _do_ work, and once the bug has been fixed upstreamed and has become part of Ubuntu we can then disable the workaround.

I plan to have a deeper look at our CI next week anyway to fix some small warts and a test failure that we hit on GitLab with the MSVC job. So maybe we commit your fix as an intermediate step, and I'll then revert it and come up with a more localized fix?

Thanks!
Patrick
Colin Stagner· Feb 7, 2026, 04:27 UTC · re: Patrick Steinhardt · lore

Re: [PATCH] ci: avoid ubuntu:rolling in most jobs for now

On 2/6/26 01:39, Patrick Steinhardt wrote:
Show 18 quoted lines
> On 2/5/26 15:55, Collin Funk wrote:
>> If you would prefer to keep usingubuntu:rolling, you can do something
>> like this:
>> 
>>      $ podman run --rm -itubuntu:25.10
>>      $ dirname --version
>>      dirname (uutils coreutils) 0.2.2
>>      $ apt-get upgrade -y; apt-get update -y;
>>      [...]
>>      $ apt-get install -y coreutils-from-gnu coreutils-from-uutils- \
>>          --allow-remove-essential
>>      [...]
>>      $ dirname --version | head -n 1
>>      dirname (GNU coreutils) 9.5
>
> ideally we'd do a similar workaround to the sudo.ws workaround
> we have in "ci/install-dependencies.sh" so that we only disable the
> pieces that _don't_ work.

The ubuntu:rolling image still has GNU coreutils installed, but all the command names are prefixed with "gnu". This approach replaces only `dirname`. Feel free to adapt or discard as you like---this isn't my CI!

Colin
-- >8 --
Subject: [PATCH] ci: ubuntu: use GNU coreutils for dirname

The uutils version of `dirname` has output that is inconsistent with GNU coreutils. Prefer the GNU implementation of this command.

Signed-off-by: Colin Stagner <ask+git@howdoi.land>
---
 ci/install-dependencies.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
Show changes to ci/install-dependencies.sh +11 −0
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index 6ee8216a05..617b90cbc9 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -71,16 +71,27 @@ ubuntu-*|i386/ubuntu-*|debian-*)
 	# sudo(1) or sudo-rs(1), with the latter being the default. The problem
 	# is that it does not support `--preserve-env` though, which we rely on
 	# in our CI. We thus revert back to the C implementation.
 	if test -f /etc/alternatives/sudo
 	then
 		sudo update-alternatives --set sudo /usr/bin/sudo.ws
 	fi
 
+	# on uutils v0.2.2 from rust-coreutils,
+	#     dirname "foo/."
+	# outputs "." instead of "foo" like it should.
+	# Use GNU coreutils to provide dirname instead.
+	#
+	# See <https://github.com/uutils/coreutils/issues/10508>.
+	if test -x /usr/bin/gnudirname
+	then
+		ln -sfT /usr/bin/gnudirname /usr/bin/dirname
+	fi
+
 	case "$distro" in
 	ubuntu-*)
 		mkdir --parents "$CUSTOM_PATH"
 
 		wget --quiet --directory-prefix="$CUSTOM_PATH" \
 			"$P4WHENCE/bin.linux26x86_64/p4d" \
 			"$P4WHENCE/bin.linux26x86_64/p4" &&
 		chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4" || {

base-commit: 3e0db84c88c57e70ac8be8c196dfa92c5d656fbc
-- 
2.43.0
Junio C Hamano· Feb 7, 2026, 04:56 UTC · re: Colin Stagner · lore

Re: [PATCH] ci: avoid ubuntu:rolling in most jobs for now

Colin Stagner <ask+git@howdoi.land> writes:
Show 9 quoted lines
> Subject: [PATCH] ci: ubuntu: use GNU coreutils for dirname
>
> The uutils version of `dirname` has output that is inconsistent
> with GNU coreutils. Prefer the GNU implementation of this command.
>
> Signed-off-by: Colin Stagner <ask+git@howdoi.land>
> ---
>  ci/install-dependencies.sh | 11 +++++++++++
>  1 file changed, 11 insertions(+)

Hmm, this certainly is a more focused solution. Let me revert my demote-from-rolling-to-latest hack and replace it with this one.

If we hit more breakages and at unacceptable high frequency, we may want to change our mind and write off rolling as not stable enough yet, but if we are lucky we won't have to. Knock, knock...

Show 22 quoted lines
> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
> index 6ee8216a05..617b90cbc9 100755
> --- a/ci/install-dependencies.sh
> +++ b/ci/install-dependencies.sh
> @@ -71,16 +71,27 @@ ubuntu-*|i386/ubuntu-*|debian-*)
>  	# sudo(1) or sudo-rs(1), with the latter being the default. The problem
>  	# is that it does not support `--preserve-env` though, which we rely on
>  	# in our CI. We thus revert back to the C implementation.
>  	if test -f /etc/alternatives/sudo
>  	then
>  		sudo update-alternatives --set sudo /usr/bin/sudo.ws
>  	fi
>  
> +	# on uutils v0.2.2 from rust-coreutils,
> +	#     dirname "foo/."
> +	# outputs "." instead of "foo" like it should.
> +	# Use GNU coreutils to provide dirname instead.
> +	#
> +	# See <https://github.com/uutils/coreutils/issues/10508>.
> +	if test -x /usr/bin/gnudirname
> +	then
> +		ln -sfT /usr/bin/gnudirname /usr/bin/dirname

"-T" is somewhat exotic, certainly outside POSIX, and is not needed in this case, no?

Show 12 quoted lines
> +	fi
> +
>  	case "$distro" in
>  	ubuntu-*)
>  		mkdir --parents "$CUSTOM_PATH"
>  
>  		wget --quiet --directory-prefix="$CUSTOM_PATH" \
>  			"$P4WHENCE/bin.linux26x86_64/p4d" \
>  			"$P4WHENCE/bin.linux26x86_64/p4" &&
>  		chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4" || {
>
> base-commit: 3e0db84c88c57e70ac8be8c196dfa92c5d656fbc
Colin Stagner· Feb 7, 2026, 05:35 UTC · re: Junio C Hamano · lore

Re: [PATCH] ci: avoid ubuntu:rolling in most jobs for now

On 2/6/26 22:56, Junio C Hamano wrote:
Show 5 quoted lines
>> +	if test -x /usr/bin/gnudirname
>> +	then
>> +		ln -sfT /usr/bin/gnudirname /usr/bin/dirname
> "-T" is somewhat exotic, certainly outside POSIX, and is not needed
> in this case, no?
Correct, this works just fine without it. You can omit it.

When requesting an ln, I usually know and specify both filenames exactly. I do not desire directory behavior as I might for cp or mv. -T / --no-target-directory is useful for this, if perhaps non-portable.

The coreutils info docs [1] highlight an interesting race condition that is avoided by --no-target-directory:

   when the command ‘mv /tmp/source /tmp/dest’ succeeds,
   there is no guarantee that /tmp/source was renamed
   to /tmp/dest: it could have been renamed to
   /tmp/dest/source ...  if mv -T /tmp/source /tmp/dest
   succeeds, there is no question that /tmp/source was
   renamed to /tmp/dest.

but I avoid writing to /tmp itself with anything other than mktemp or rm, for this very reason.

[1]: https://www.gnu.org/software/coreutils/manual/html_node/Target-directory.html

← back to recent threads