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

zlib's `libz.so` does not seems to be located in the proper folder #105

Closed
raphael-riel opened this Issue Nov 20, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@raphael-riel

raphael-riel commented Nov 20, 2015

Context: I was upgrading Python's Pillow to 3.0.0, which now requires zlib to build. zlib was in my apk add but the pip install command always failed complaining about zlib being missing.

Looks like libz.so wasn't located where others apk packages' files were put (/usr/lib/).
Seems zlib is built-in with alpine:3.2.
Maybe there is discrepancy between the "built-in" install method and "apk add" method?

Reproduce with Dockerfile:

FROM alpine:3.2
RUN apk add --update-cache bash build-base zlib zlib-dev curl jpeg jpeg-dev libpng libpng-dev python-dev
RUN curl -sSL https://raw.githubusercontent.com/pypa/pip/7.1.2/contrib/get-pip.py | python -

# Uncomment this to "fix" the problem.
#RUN ln -s /lib/libz.so /usr/lib/

RUN pip install Pillow==3.0.0

Notice apk add never report having installed zlib.
Running bash in the resulting docker, we can see libz.so is present in /lib/ but not /usr/lib
Also, a bare alpine:3.2 will also have /lib/libz.so.

Uncomment the ln -s line to fix/hack the issue.

RUN ln -s /lib/libz.so /usr/lib/

@andyshinn

This comment has been minimized.

Show comment
Hide comment
@andyshinn

andyshinn Nov 21, 2015

Collaborator

Specify the CFLAGS for the build to find zlib in the correct place:

/ # apk add py-pip
(1/2) Installing py-setuptools (1.1.7-r0)
(2/2) Installing py-pip (6.1.1-r0)
Executing busybox-1.23.2-r0.trigger
OK: 221 MiB in 71 packages
/ # CFLAGS="$CFLAGS -L/lib" pip install pillow

You are using pip version 6.1.1, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pillow
  Using cached Pillow-3.0.0.tar.gz
Installing collected packages: pillow
  Running setup.py install for pillow
Successfully installed pillow-3.0.0
/ #

You can usually find quick fixes like this from the equivalent Alpine packages that already exist: http://git.alpinelinux.org/cgit/aports/tree/main/py-pillow/APKBUILD. Is this an acceptable solution?

Collaborator

andyshinn commented Nov 21, 2015

Specify the CFLAGS for the build to find zlib in the correct place:

/ # apk add py-pip
(1/2) Installing py-setuptools (1.1.7-r0)
(2/2) Installing py-pip (6.1.1-r0)
Executing busybox-1.23.2-r0.trigger
OK: 221 MiB in 71 packages
/ # CFLAGS="$CFLAGS -L/lib" pip install pillow

You are using pip version 6.1.1, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pillow
  Using cached Pillow-3.0.0.tar.gz
Installing collected packages: pillow
  Running setup.py install for pillow
Successfully installed pillow-3.0.0
/ #

You can usually find quick fixes like this from the equivalent Alpine packages that already exist: http://git.alpinelinux.org/cgit/aports/tree/main/py-pillow/APKBUILD. Is this an acceptable solution?

@andyshinn andyshinn added the question label Nov 21, 2015

@andyshinn

This comment has been minimized.

Show comment
Hide comment
@andyshinn

andyshinn Nov 30, 2015

Collaborator

If this doesn't work or you need additional assistance please reopen or join us in Slack.

Collaborator

andyshinn commented Nov 30, 2015

If this doesn't work or you need additional assistance please reopen or join us in Slack.

@andyshinn andyshinn closed this Nov 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment