docker-library / pypy

Docker Official Image packaging for pypy
http://pypy.org/
MIT License
69 stars 46 forks source link

truncate lib #35

Closed jobdiogenes closed 4 years ago

jobdiogenes commented 4 years ago

I run under docker image

apt-get update \ && apt-get install -y build-essential \ libjpeg-dev gettext zlib1g-dev git \ libmariadb-dev

and return many truncated lib. as:

ldconfig: file /usr/local/lib/libexpat.so.1.5.2 is truncated

ldconfig: file /usr/local/lib/libffi.so.6 is truncated

ldconfig: file /usr/local/lib/libffi.so.6.0.4 is truncated

ldconfig: file /usr/local/lib/libgdbm.so.2 is truncated .....

tianon commented 4 years ago

This looks like image corruption to me -- did your disk fill up? Have you tried deleting the image and re-pulling it?

tianon commented 4 years ago

I'm able to reproduce the messages, but not a build failure:

$ cat Dockerfile
FROM pypy

RUN apt-get update && apt-get install -y build-essential libjpeg-dev gettext zlib1g-dev git libmariadb-dev

$ docker build .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM pypy
 ---> 086e41afe893
Step 2/2 : RUN apt-get update && apt-get install -y build-essential libjpeg-dev gettext zlib1g-dev git libmariadb-dev
 ---> Running in b1b3a75e2d3e
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:1 http://security-cdn.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:6 http://deb.debian.org/debian stretch-updates/main amd64 Packages [27.9 kB]
Get:7 http://deb.debian.org/debian stretch/main amd64 Packages [7083 kB]
Get:8 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 Packages [520 kB]
Fetched 7937 kB in 1s (7487 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
git is already the newest version (1:2.11.0-3+deb9u5).
libjpeg-dev is already the newest version (1:1.5.1-2).
zlib1g-dev is already the newest version (1:1.2.8.dfsg-5).
The following additional packages will be installed:
  gettext-base libmariadb2
Suggested packages:
  gettext-doc autopoint libasprintf-dev libgettextpo-dev
The following NEW packages will be installed:
  build-essential gettext gettext-base libmariadb-dev libmariadb2
0 upgraded, 5 newly installed, 0 to remove and 25 not upgraded.
Need to get 1962 kB of archives.
After this operation, 9435 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 gettext-base amd64 0.19.8.1-2+deb9u1 [122 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 build-essential amd64 12.3 [7346 B]
Get:3 http://deb.debian.org/debian stretch/main amd64 gettext amd64 0.19.8.1-2+deb9u1 [1496 kB]
Get:4 http://deb.debian.org/debian stretch/main amd64 libmariadb2 amd64 2.3.2-2 [130 kB]
Get:5 http://deb.debian.org/debian stretch/main amd64 libmariadb-dev amd64 2.3.2-2 [206 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 1962 kB in 0s (2755 kB/s)
Selecting previously unselected package gettext-base.
(Reading database ... 30350 files and directories currently installed.)
Preparing to unpack .../gettext-base_0.19.8.1-2+deb9u1_amd64.deb ...
Unpacking gettext-base (0.19.8.1-2+deb9u1) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../build-essential_12.3_amd64.deb ...
Unpacking build-essential (12.3) ...
Selecting previously unselected package gettext.
Preparing to unpack .../gettext_0.19.8.1-2+deb9u1_amd64.deb ...
Unpacking gettext (0.19.8.1-2+deb9u1) ...
Selecting previously unselected package libmariadb2:amd64.
Preparing to unpack .../libmariadb2_2.3.2-2_amd64.deb ...
Unpacking libmariadb2:amd64 (2.3.2-2) ...
Selecting previously unselected package libmariadb-dev.
Preparing to unpack .../libmariadb-dev_2.3.2-2_amd64.deb ...
Unpacking libmariadb-dev (2.3.2-2) ...
Setting up build-essential (12.3) ...
Setting up gettext-base (0.19.8.1-2+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
ldconfig: file /usr/local/lib/liblzma.so.0.0.0 is truncated

ldconfig: file /usr/local/lib/libffi.so.6 is truncated

ldconfig: file /usr/local/lib/libtinfow.so.6.1 is truncated

ldconfig: file /usr/local/lib/libsqlite3.so.0.8.6 is truncated

ldconfig: file /usr/local/lib/libtinfow.so.6 is truncated

ldconfig: file /usr/local/lib/libsqlite3.so.0 is truncated

ldconfig: file /usr/local/lib/libpanelw.so.6 is truncated

ldconfig: file /usr/local/lib/libtcl8.5.so is truncated

ldconfig: file /usr/local/lib/libtk8.5.so is truncated

ldconfig: file /usr/local/lib/libpanelw.so.6.1 is truncated

ldconfig: file /usr/local/lib/libncursesw.so.6.1 is truncated

ldconfig: file /usr/local/lib/liblzma.so.0 is truncated

ldconfig: file /usr/local/lib/libgdbm.so.2.0.0 is truncated

ldconfig: file /usr/local/lib/libgdbm.so.2 is truncated

ldconfig: file /usr/local/lib/libexpat.so.1 is truncated

ldconfig: file /usr/local/lib/libffi.so.6.0.4 is truncated

ldconfig: file /usr/local/lib/libexpat.so.1.5.2 is truncated

ldconfig: file /usr/local/lib/libncursesw.so.6 is truncated

Setting up libmariadb2:amd64 (2.3.2-2) ...
Setting up gettext (0.19.8.1-2+deb9u1) ...
ldconfig: file /usr/local/lib/liblzma.so.0.0.0 is truncated

ldconfig: file /usr/local/lib/libffi.so.6 is truncated

ldconfig: file /usr/local/lib/libtinfow.so.6.1 is truncated

ldconfig: file /usr/local/lib/libsqlite3.so.0.8.6 is truncated

ldconfig: file /usr/local/lib/libtinfow.so.6 is truncated

ldconfig: file /usr/local/lib/libsqlite3.so.0 is truncated

ldconfig: file /usr/local/lib/libpanelw.so.6 is truncated

ldconfig: file /usr/local/lib/libtcl8.5.so is truncated

ldconfig: file /usr/local/lib/libtk8.5.so is truncated

ldconfig: file /usr/local/lib/libpanelw.so.6.1 is truncated

ldconfig: file /usr/local/lib/libncursesw.so.6.1 is truncated

ldconfig: file /usr/local/lib/liblzma.so.0 is truncated

ldconfig: file /usr/local/lib/libgdbm.so.2.0.0 is truncated

ldconfig: file /usr/local/lib/libgdbm.so.2 is truncated

ldconfig: file /usr/local/lib/libexpat.so.1 is truncated

ldconfig: file /usr/local/lib/libffi.so.6.0.4 is truncated

ldconfig: file /usr/local/lib/libexpat.so.1.5.2 is truncated

ldconfig: file /usr/local/lib/libncursesw.so.6 is truncated

Setting up libmariadb-dev (2.3.2-2) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
ldconfig: file /usr/local/lib/liblzma.so.0.0.0 is truncated

ldconfig: file /usr/local/lib/libffi.so.6 is truncated

ldconfig: file /usr/local/lib/libtinfow.so.6.1 is truncated

ldconfig: file /usr/local/lib/libsqlite3.so.0.8.6 is truncated

ldconfig: file /usr/local/lib/libtinfow.so.6 is truncated

ldconfig: file /usr/local/lib/libsqlite3.so.0 is truncated

ldconfig: file /usr/local/lib/libpanelw.so.6 is truncated

ldconfig: file /usr/local/lib/libtcl8.5.so is truncated

ldconfig: file /usr/local/lib/libtk8.5.so is truncated

ldconfig: file /usr/local/lib/libpanelw.so.6.1 is truncated

ldconfig: file /usr/local/lib/libncursesw.so.6.1 is truncated

ldconfig: file /usr/local/lib/liblzma.so.0 is truncated

ldconfig: file /usr/local/lib/libgdbm.so.2.0.0 is truncated

ldconfig: file /usr/local/lib/libgdbm.so.2 is truncated

ldconfig: file /usr/local/lib/libexpat.so.1 is truncated

ldconfig: file /usr/local/lib/libffi.so.6.0.4 is truncated

ldconfig: file /usr/local/lib/libexpat.so.1.5.2 is truncated

ldconfig: file /usr/local/lib/libncursesw.so.6 is truncated

Removing intermediate container b1b3a75e2d3e
 ---> d389faf0c5a9
Successfully built d389faf0c5a9
tianon commented 4 years ago

I think these are part of what's described in https://www.pypy.org/download.html#linux-binaries-and-common-distributions:

Since version 7.3, the linux x86 binaries in the links below ship with versions of OpenSSL, SQLite3, libffi, expat, and TCL/TK binary libraries linked in. This make the binaries "portable" so that they should run on any current glibc-based linux platform. The ideas were adopted from the portable-pypy package.

If I delete these files, pypy3 (expectedly) fails to start.

wglambert commented 4 years ago

Since this isn't a blocking (non-zero exit) error and seems intentional by upstream I'm going to close. I don't see anything we could change in the Dockerfile to alleviate the warning messages

glyph commented 4 years ago

@fijal @arigo is this behavior indeed "intentional" on behalf of PyPy upstream? I still see this every time I update my pypy-based docker images, and it is still annoying.

arigo commented 4 years ago

Sorry, I have no idea about these errors. You should ask whoever builds this Docker image to investigate; I personally have little clue about docker at all.

mattip commented 4 years ago

@wglambert what do you mean by "intentional"? The image creation is breaking before you even download PyPy. PyPy does not install packages in /usr/local.

wglambert commented 4 years ago

The image install pypy from source to /usr/local https://github.com/docker-library/pypy/blob/709d8823acade04e6b67b685311642892e9d582e/3.6/Dockerfile#L45-L49

Those truncated files are the exact ones mentioned in upstream's documentation OpenSSL, SQLite3, libffi, expat, and TCL/TK binary libraries linked in. This make the binaries "portable"

libffi.so.6.0.4 is truncated libexpat.so.1.5.2 is truncated

mattip commented 4 years ago

Installing to /usr/local seems wrong to me, since this can be confused with the default location for install-from-source components, and may well be the cause of the failure. Other docker providers who install python install to /opt instead, and do not have problems with the tarball. Also: the canonical location for downloads is https://downloads.python.org/pypy/

tianon commented 4 years ago

Our download URLs come from https://www.pypy.org/download.html -- moving to /opt will hide these warnings by making ldconfig no longer look at the included .so files, which I guess is a win.

Perhaps the "Installing" section on https://www.pypy.org/download.html should be a little more explicit about where to install? It's pretty common to install non-packaged tools to /usr/local (and those instructions even suggest making a symlink in /usr/local/bin).

I'll get a PR up shortly moving us to /opt/pypy instead.

mattip commented 4 years ago

Perhaps the "Installing" section on https://www.pypy.org/download.html should be a little more explicit about where to install?

Yes, thanks for that. About the download URL location: I will update that as well.

which I guess is a win.

well, it is a win only if the strange corruption disappears, otherwise there is more debugging to do :).

tianon commented 4 years ago

Well, I don't think there's actually any corruption happening here -- I think that ldconfig is just reporting a warning when it scans these bundled files, and the text of the warning makes it sound like the files are horribly broken, which I don't think is true given that PyPy generally works. :smile:

tianon commented 4 years ago

PR up! https://github.com/docker-library/pypy/pull/44 :+1: