ci: avoid ubuntu:rolling in most jobs for now
PATCH 1/1 ci: avoid ubuntu:rolling in most jobs for now
We just was hit by buggy uutils dirname in ubuntu:rolling. Avoid breakage caused by being on the bleeding edge.
---
* 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/[email protected]/
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(-)
.github/workflows/main.yml +7 -7
@@ -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
Signature · 1 line
2.53.0-181-gfd50f4332d
Quoted 12 lines · Junio C Hamano
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 <[email protected]>---
* 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/[email protected]/
Quoted 7 lines
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.5I'm not familiar with the CI, so I am not voting for either option. I'll let others decide. :)
Collin
Quoted 10 lines · Junio C Hamano
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 <[email protected]>---
* 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
Quoted 6 lines
https://lore.kernel.org/git/[email protected]/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
Quoted 15 lines · Patrick Steinhardt
Quoted 13 lines · Collin Funk
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
Quoted 3 lines
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.
--- ci/install-dependencies.sh | 11 +++++++++++ 1 file changed, 11 insertions(+)
ci/install-dependencies.sh +11 -0
@@ -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
Signature · 1 line
2.43.0
Quoted 9 lines · Colin Stagner
Subject: [PATCH] ci: ubuntu: use GNU coreutils for dirname
The uutils version of
dirnamehas output that is inconsistent with GNU coreutils. Prefer the GNU implementation of this command.Signed-off-by Colin Stagner <[email protected]>--- 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...
Quoted 12 lines
ci/install-dependencies.sh +0
-0@@ -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
ci/install-dependencies.sh ubuntu-*|i386/ubuntu-*|debian-*) · line 87
Quoted 10 lines
ci/install-dependencies.sh +9
-0+ # 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?
Quoted 12 lines
ci/install-dependencies.sh +2
-0+ 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
Quoted 5 lines · Junio C Hamano
ci/install-dependencies.sh ubuntu-*|i386/ubuntu-*|debian-*) · line 87
Quoted 3 lines
ci/install-dependencies.sh +3
-0+ 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