Collin Funk wrote:
> My complaint about GitHub Actions was that they only support one
> distribution for GNU/Linux jobs. I guess their answer, which is
> perfectly reasonable, is that they support container images, which would
> allow you to use any distribution as long as they have container images,
> which they all do nowadays.

Right, and incidentally my CI's 'check-newest-clang' job makes use of
a Debian docker container (rather than installing things in Ubuntu).

> > But I can make sure it has GNU coreutils installed, like this:
> >
> >   # apt remove --allow-remove-essential coreutils-from-uutils
> >   Create /etc/apt/preferences.d/uutils with contents:
> >     Package: coreutils-from-uutils
> >     Pin: release a=*
> >     Pin-Priority: -10
> >
> > Should I?
> 
> TLDR: it is probably not worth the effort.

OK.

> Even more annoyingly, your strategy would prevent you from installing
> the build-essential package if the CI uses it:
> 
>     $ podman run --rm -it ubuntu:26.04
>     $ apt update -y && apt upgrade -y && echo $?
>     [...]
>     0
>     $ apt remove --allow-remove-essential coreutils-from-uutils
>     [...]
>     $ cat <<\EOF > /etc/apt/preferences.d/uutils
>     Package: coreutils-from-uutils
>     Pin: release a=*
>     Pin-Priority: -10
>     EOF
>     $ apt install build-essential 
>     Solving dependencies... Error!  
>     Some packages could not be installed. This may mean that you have
>     requested an impossible situation or if you are using the unstable
>     distribution that some required packages have not yet been created
>     or been moved out of Incoming.
>     The following information may help to resolve the situation:
>     
>     Unsatisfied dependencies:
>      build-essential : Depends: coreutils-from-uutils but it is not 
> installable
>     Error: Unable to satisfy dependencies. Reached two conflicting 
> assignments:
>        1. coreutils-from-uutils:amd64 is selected for install because:
>           1. build-essential:amd64=12.12ubuntu2.26.04.2 is selected for 
> install
>           2. build-essential:amd64 Depends coreutils-from-uutils
>        2. coreutils-from-uutils:amd64 is available in version 0.0.0~ubuntu25
>           but none of the choices are installable:
>           - coreutils-from-uutils:amd64=0.0.0~ubuntu25 is not selected for 
> install
> 
> That would be okay if build-essential was used as intended, i.e., only
> packages required for building Debian packages depended on it, but that
> is not the case in practice. See a few notable examples that make it
> unlikely that you can actually use GNU coreutils on that distribution:
> 
>     cuda-crt-13-1
>     cuda-nvcc-13-1
>     cuda-crt-13-1
>     python3-virtualenv
>     python3-torch-rocm
>     python3-torch
>     python3-pip
>     pyenv
>     opam
>     nim
>     gnulib
>     flex
> 
> Those were taken from the output of the following command:
> 
>     $ apt-cache rdepends build-essential

Right. I noticed the conflict with 'opam' by myself, and now mention
your 'apt-cache rdepends' command in a blog post:
  https://dev.to/bhaible/ubuntu-kubuntu-2604-prefer-gnu-coreutils-c01

> Perhaps 'flex' will cause problems for some packages you maintain CI
> for

Strange: I did not get a problem with 'flex'. Maybe that dependency has
only been added recently?

> In the meantime, here is the only way I have found to use GNU coreutils
> there:
> 
>     $ podman run --rm -it ubuntu:26.04
>     $ apt update -y && apt upgrade -y && echo $?
>     [...]
>     0
>     $ apt install equivs
>     [...]
>     $ mkdir -p tmp; cd tmp
>     $ apt remove --allow-remove-essential coreutils-from-uutils
>     [...]
>     $ cat <<\EOF > uutils
>     Source: coreutils-from
>     Section: utils
>     Priority: optional
>     Standards-Version: 4.6.2
> 
>     Package: coreutils-from-uutils
>     Description: :)
>     EOF
>     $ equivs-build uutils
>     [...]
>     $ dpkg -i coreutils-from-uutils_1.0_all.deb
>     $ dpkg -l | grep coreutils-from                      
>     ii  coreutils-from-gnu               0.0.0~ubuntu25                     
> all          coreutils from the GNU coreutils project
>     ii  coreutils-from-uutils            1.0                                
> all          Dummy package to fulfill package dependencies
> 
> Of course, that is a complete hack and may break your system in strange
> and unexpected ways, if not now, then sometime in the unforeseen future.

Should I add this recipe to the blog post?

Bruno




Reply via email to