Open LukeShu opened 2 years ago
@LukeShu I believe that this PR is still VERY relevant and should be merged. But with the change I suggested:
depends="$depends !libc6-compat" # conflicts with this package
Would you be willing to rebase this PR with the latest and push an update?
I tried to build and install this PR, however, I ran into the following issue:
/pkgs/builder/x86_64 # apk add --allow-untrusted glibc-2.37-r0.apk
(1/1) Installing glibc (2.37-r0)
ERROR: glibc-2.37-r0: trying to overwrite etc/nsswitch.conf owned by alpine-baselayout-data-3.6.5-r0.
1 error; 13 MiB in 15 packages
@LukeShu any thoughts on this?
When upgrading 2.34→2.35, https://github.com/sgerrand/alpine-pkg-glibc/pull/171 also made the change that it drops the
/lib64/ld-linux-x86-64.so.2
symlink and instead depend onlibc6-compat
's version of that symlink.This broke us, as
/lib/ld-linux-x86-64.so.2
was going for glibc, while/lib64/ld-linux-x86-64.so.2
was going for musl, and that managed to confuse our binary.Dropping the symlink was justified by
ERROR: glibc*: Packages must not put anything under /lib64, use /lib instead
; butman apkbuild
tells us about thelib64
value foroptions=
:That's exactly the case for us! So say
options="lib64"
and add the symlink back. Since this means that we file-conflict withlibc6-compat
, explicitly declare that and sayconflicts="libc6-compat"
.What does
libc6-compat
do, what are the consequences of not being able to install both it andglibc
at the same time? It adds glibc binary compatibility to musl, allowing binaries linked against glibc to use Alpine's native musl. So it doesn't really make sense to have bothglibc
andlibc6-compat
to be installed at once; if you haveglibc
installed that's a strong indicator that you want glibc-linked binaries to use the actual glibc and not musl. So the aboveconflicts=
is probably the right thing. At the same time, the intent oflibc6-compat
can be written as "I'd like to be able to run binaries that are linked against glibc", so also sayprovides="libc6-compat"
.The commit that added
glibc-bin
's dependency onlibc6-compat
(39878629cbf803bc70323f35dfeb674da9a5c0ac) said "This package not being installed is a very common cause of reported user errors." I'm not sure what those reported user errors are; that claim doesn't make much sense to me.I also added a
glibc-utils
counterpart tomusl-utils
; it just symlinks programs fromglibc-bin
's/usr/glibc-compat
in to/usr
.I also gave
glibc-bin
a dependency onperl
, asmtrace
uses perl in its shebang.I have not actually built or tested this.