Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dereference symlinks #34

Merged
merged 1 commit into from
Aug 18, 2019
Merged

Dereference symlinks #34

merged 1 commit into from
Aug 18, 2019

Conversation

sgerrand
Copy link
Owner

💁 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

This flag needs to be passed to tar in order for any symlinks added to
the archive to be referenced correctly. Otherwise, the following output
can occur:

  >>> 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
@sgerrand sgerrand added the bug label Aug 18, 2019
@sgerrand sgerrand merged commit bbfae7c into master Aug 18, 2019
@adzil
Copy link

adzil commented Oct 2, 2019

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
Copy link

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

@sgerrand sgerrand deleted the dereference-symlinks branch April 1, 2020 15:57
@Dexus
Copy link

Dexus commented Aug 2, 2021

@sgerrand ping

@prantlf
Copy link
Contributor

prantlf commented Sep 22, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants