sgerrand / docker-glibc-builder

A glibc binary package builder in Docker
138 stars 100 forks source link

Dereference symlinks #34

Closed sgerrand closed 5 years ago

sgerrand commented 5 years ago

💁 The --dereference flag needs to be passed to tar in order for any symlinks added to the archive to be referenced correctly. Otherwise, the following error can occur when abuild unpacks the tar archive:

>>> glibc: Fetching https://github.com/sgerrand/docker-glibc-builder/releases/download/2.30-0/glibc-bin-2.30-0-x86_64.tar.gz
>>> glibc: Checking sha512sums...
glibc-bin-2.30-0-x86_64.tar.gz: OK
nsswitch.conf: OK
ld.so.conf: OK
>>> glibc: Unpacking /var/cache/distfiles/glibc-bin-2.30-0-x86_64.tar.gz...
tar: usr/glibc-compat/lib/libnss_compat.so.2: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libnss_dns.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libpthread.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libcrypt.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libnss_files.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libnss_db.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libmvec.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libdl.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libanl.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libthread_db.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libcrypt.so.1: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libc.so.6: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libresolv.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libutil.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libBrokenLocale.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libnss_files.so.2: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libmvec.so.1: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libdl.so.2: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libanl.so.1: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/librt.so: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libnsl.so.1: Cannot utime: No such file or directory
tar: usr/glibc-compat/lib/libnss_db.so.2: Cannot utime: No such file or directory
tar: Exiting with failure status due to previous errors
>>> ERROR: glibc: unpack failed
adzil commented 5 years ago

Hi, I think the --dereference flag causes ldconfig to complain about non-symlinked ld-linux-x86-64.so.2. For example, if I use frolvlad/alpine-glibc:alpine-3.10 which uses glibc 2.30 generated from this repository and run ldconfig:

> docker run --rm frolvlad/alpine-glibc:alpine-3.10 /usr/glibc-compat/sbin/ldconfig
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link
zhangyoufu commented 4 years ago

This PR should be reverted. It seems that the error only occurs on Docker for Mac. See this and this

Dexus commented 3 years ago

@sgerrand ping

prantlf commented 3 years ago

The message about the non-symlinked ld-linux-x86-64.so.2 is not specific to Docker on Mac. It happens in a Linux container for a GitLab runner too. See an example of a build job log:

(2/2) Installing glibc-bin (2.33-r0)
Executing glibc-bin-2.33-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link
OK: 17 MiB in 17 packages

The symlinks could be created after installing the glibc package as a workaround.