{"thread":{"id":"64291","subject":"[PATCH] ci: fix broken jobs on Ubuntu 25.10 caused by switch to sudo-rs(1)","startedAt":"2025-10-10T09:41:40Z","lastAt":"2025-10-13T14:27:59Z","messageCount":6,"participants":["Patrick Steinhardt","Junio C Hamano","brian m. carlson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"528479","messageId":"20251010-b4-pks-ci-ubuntu-sudo-rs-v1-1-88cc846d251c@pks.im","threadId":"64291","inReplyTo":null,"subject":"[PATCH] ci: fix broken jobs on Ubuntu 25.10 caused by switch to sudo-rs(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-10-10T09:41:14Z","receivedAt":"2025-10-10T09:41:40Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Ubuntu 25.10 has been released. One prominent change in this version of\nUbuntu is the switch to some Rust-based utilities. Part of this switch\nis also that Ubuntu now defaults to sudo-rs(1).\n\nUnfortunately, this breaks our CI because sudo-rs(1) does not support\nthe `--preserve-env` flag. Let's revert back to the C-based sudo(1)\nimplementation to fix this.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\nHi,\n\nthis breaks a bunch of our CI jobs, both for GitHub and GitLab. It would\nprobably make sense to fast-track the fix.\n\nThanks!\n\nPatrick\n---\n ci/install-dependencies.sh | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 0d3aa496fc..a8dcd9b9bc 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -65,6 +65,15 @@ ubuntu-*|i386/ubuntu-*|debian-*)\n \t\tlibsecret-1-dev libpcre2-dev meson ninja-build pkg-config cargo \\\n \t\t${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE\n \n+\t# Starting with Ubuntu 25.10, sudo can now be provided via either\n+\t# sudo(1) or sudo-rs(1), with the latter being the default. The problem\n+\t# is that it does not support `--preserve-env` though, which we rely on\n+\t# in our CI. We thus revert back to the C implementation.\n+\tif test -f /etc/alternatives/sudo\n+\tthen\n+\t\tsudo update-alternatives --set sudo /usr/bin/sudo.ws\n+\tfi\n+\n \tcase \"$distro\" in\n \tubuntu-*)\n \t\tmkdir --parents \"$CUSTOM_PATH\"\n\n---\nbase-commit: 60f3f52f17cceefa5299709b189ce6fe2d181e7b\nchange-id: 20251010-b4-pks-ci-ubuntu-sudo-rs-8e992b87ddf0\n\n"},{"id":"528523","messageId":"xmqqzf9y905f.fsf@gitster.g","threadId":"64291","inReplyTo":"20251010-b4-pks-ci-ubuntu-sudo-rs-v1-1-88cc846d251c@pks.im","subject":"Re: [PATCH] ci: fix broken jobs on Ubuntu 25.10 caused by switch to sudo-rs(1)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-10T16:44:44Z","receivedAt":"2025-10-10T16:44:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> Ubuntu 25.10 has been released. One prominent change in this version of\n> Ubuntu is the switch to some Rust-based utilities. Part of this switch\n> is also that Ubuntu now defaults to sudo-rs(1).\n>\n> Unfortunately, this breaks our CI because sudo-rs(1) does not support\n> the `--preserve-env` flag. Let's revert back to the C-based sudo(1)\n> implementation to fix this.\n>\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n> Hi,\n>\n> this breaks a bunch of our CI jobs, both for GitHub and GitLab. It would\n> probably make sense to fast-track the fix.\n\nIt is curious why this is done outside Ubuntu.  The context is that\nthe outermost case \"$distro\" has this arm\n\n    ubuntu-*|i386/ubuntu-*|debian-*)\n\nwhich is where the patched code appears.\n\n> @@ -65,6 +65,15 @@ ubuntu-*|i386/ubuntu-*|debian-*)\n>  \t\tlibsecret-1-dev libpcre2-dev meson ninja-build pkg-config cargo \\\n>  \t\t${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE\n>  \n> +\t# Starting with Ubuntu 25.10, sudo can now be provided via either\n> +\t# sudo(1) or sudo-rs(1), with the latter being the default. The problem\n> +\t# is that it does not support `--preserve-env` though, which we rely on\n> +\t# in our CI. We thus revert back to the C implementation.\n> +\tif test -f /etc/alternatives/sudo\n> +\tthen\n> +\t\tsudo update-alternatives --set sudo /usr/bin/sudo.ws\n> +\tfi\n\nSo at least shouldn't we be limiting ourselves to do this only when\n/usr/bin/sudo.ws exists?  Or do it in the nested case \"$distro\" that\nimmediately follows this one to limit the effect only to Ubuntu\n(which may need to make this into a helper function that is called\nfor both ubuntu-* and i386/ubuntu-* arms)?\n\n>  \tcase \"$distro\" in\n>  \tubuntu-*)\n>  \t\tmkdir --parents \"$CUSTOM_PATH\"\n\nThanks.\n"},{"id":"528540","messageId":"aOl7jFj9Ftd4wNH6@fruit.crustytoothpaste.net","threadId":"64291","inReplyTo":"20251010-b4-pks-ci-ubuntu-sudo-rs-v1-1-88cc846d251c@pks.im","subject":"Re: [PATCH] ci: fix broken jobs on Ubuntu 25.10 caused by switch to sudo-rs(1)","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2025-10-10T21:33:00Z","receivedAt":"2025-10-10T21:33:02Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2025-10-10 at 09:41:14, Patrick Steinhardt wrote:\n> Ubuntu 25.10 has been released. One prominent change in this version of\n> Ubuntu is the switch to some Rust-based utilities. Part of this switch\n> is also that Ubuntu now defaults to sudo-rs(1).\n> \n> Unfortunately, this breaks our CI because sudo-rs(1) does not support\n> the `--preserve-env` flag. Let's revert back to the C-based sudo(1)\n> implementation to fix this.\n\nI've requested that functionality (which I also use in a variety of\ncases) upstream:\nhttps://github.com/trifectatechfoundation/sudo-rs/issues/1299.\nHopefully it can be implemented in time for Ubuntu 26.04.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"528568","messageId":"aOo4ME3dNApd0xDL@pks.im","threadId":"64291","inReplyTo":"xmqqzf9y905f.fsf@gitster.g","subject":"Re: [PATCH] ci: fix broken jobs on Ubuntu 25.10 caused by switch to sudo-rs(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-10-11T10:57:52Z","receivedAt":"2025-10-11T10:57:56Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Oct 10, 2025 at 09:44:44AM -0700, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> > @@ -65,6 +65,15 @@ ubuntu-*|i386/ubuntu-*|debian-*)\n> >  \t\tlibsecret-1-dev libpcre2-dev meson ninja-build pkg-config cargo \\\n> >  \t\t${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE\n> >  \n> > +\t# Starting with Ubuntu 25.10, sudo can now be provided via either\n> > +\t# sudo(1) or sudo-rs(1), with the latter being the default. The problem\n> > +\t# is that it does not support `--preserve-env` though, which we rely on\n> > +\t# in our CI. We thus revert back to the C implementation.\n> > +\tif test -f /etc/alternatives/sudo\n> > +\tthen\n> > +\t\tsudo update-alternatives --set sudo /usr/bin/sudo.ws\n> > +\tfi\n> \n> So at least shouldn't we be limiting ourselves to do this only when\n> /usr/bin/sudo.ws exists?  Or do it in the nested case \"$distro\" that\n> immediately follows this one to limit the effect only to Ubuntu\n> (which may need to make this into a helper function that is called\n> for both ubuntu-* and i386/ubuntu-* arms)?\n\nNo other distro has this sudo.ws / sudo-rs split at the current point in\ntime, and because of this they don't have /etc/alternatives/sudo,\neither. So for now at least the condition should be sufficient, I think.\n\nIf we want to tighten this we could probably make this something like\n\"if test -f /etc/alternatives/sudo && test -f /usr/bin/sudo.ws\". But to\nbe honest, I feel like all variants are somewhat brittle here and\nthere's scenarios where all of them will fail with upstream changes. So\nI feel like the current version is good enough, but I'm happy to adjust\nif you continue to feel otherwise.\n\nAlso, we don't have to do this for i386/ubuntu. Ubuntu has dropped 32\nbit support, so it won't ever adopt this split. I have a patch series\npending that'll convert this CI job to instead use i386/debian, which\nstill continues to maintain 32 bit.\n\nThanks!\n\nPatrick\n"},{"id":"528569","messageId":"aOo4NC5zZDYMr0po@pks.im","threadId":"64291","inReplyTo":"aOl7jFj9Ftd4wNH6@fruit.crustytoothpaste.net","subject":"Re: [PATCH] ci: fix broken jobs on Ubuntu 25.10 caused by switch to sudo-rs(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-10-11T10:57:56Z","receivedAt":"2025-10-11T10:57:58Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Oct 10, 2025 at 09:33:00PM +0000, brian m. carlson wrote:\n> On 2025-10-10 at 09:41:14, Patrick Steinhardt wrote:\n> > Ubuntu 25.10 has been released. One prominent change in this version of\n> > Ubuntu is the switch to some Rust-based utilities. Part of this switch\n> > is also that Ubuntu now defaults to sudo-rs(1).\n> > \n> > Unfortunately, this breaks our CI because sudo-rs(1) does not support\n> > the `--preserve-env` flag. Let's revert back to the C-based sudo(1)\n> > implementation to fix this.\n> \n> I've requested that functionality (which I also use in a variety of\n> cases) upstream:\n> https://github.com/trifectatechfoundation/sudo-rs/issues/1299.\n> Hopefully it can be implemented in time for Ubuntu 26.04.\n\nAwesome, thanks!\n\nPatrick\n"},{"id":"528625","messageId":"xmqqo6qa511v.fsf@gitster.g","threadId":"64291","inReplyTo":"aOo4NC5zZDYMr0po@pks.im","subject":"Re: [PATCH] ci: fix broken jobs on Ubuntu 25.10 caused by switch to sudo-rs(1)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-13T14:27:56Z","receivedAt":"2025-10-13T14:27:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> On Fri, Oct 10, 2025 at 09:33:00PM +0000, brian m. carlson wrote:\n>> On 2025-10-10 at 09:41:14, Patrick Steinhardt wrote:\n>> > Ubuntu 25.10 has been released. One prominent change in this version of\n>> > Ubuntu is the switch to some Rust-based utilities. Part of this switch\n>> > is also that Ubuntu now defaults to sudo-rs(1).\n>> > \n>> > Unfortunately, this breaks our CI because sudo-rs(1) does not support\n>> > the `--preserve-env` flag. Let's revert back to the C-based sudo(1)\n>> > implementation to fix this.\n>> \n>> I've requested that functionality (which I also use in a variety of\n>> cases) upstream:\n>> https://github.com/trifectatechfoundation/sudo-rs/issues/1299.\n>> Hopefully it can be implemented in time for Ubuntu 26.04.\n>\n> Awesome, thanks!\n\nYeah, solving the problem at its root instead of having to work\naround is a good thing to do.\n\nThanks.\n"}]}