Skip to content

Python 3.7: Install libuuid packages for native _uuid module #326

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

Merged
merged 3 commits into from
Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 3.7/alpine3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ RUN set -ex \
tcl-dev \
tk \
tk-dev \
util-linux-dev \
xz-dev \
zlib-dev \
# add build deps before removing fetch deps in case there's overlap
Expand Down
1 change: 1 addition & 0 deletions 3.7/alpine3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ RUN set -ex \
tcl-dev \
tk \
tk-dev \
util-linux-dev \
xz-dev \
zlib-dev \
# add build deps before removing fetch deps in case there's overlap
Expand Down
1 change: 1 addition & 0 deletions 3.7/stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ENV LANG C.UTF-8
# extra dependencies (over what buildpack-deps already includes)
RUN apt-get update && apt-get install -y --no-install-recommends \
tk-dev \
uuid-dev \
&& rm -rf /var/lib/apt/lists/*

ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
Expand Down
1 change: 1 addition & 0 deletions 3.7/stretch/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN set -ex \
libssl-dev \
make \
tk-dev \
uuid-dev \
wget \
xz-utils \
zlib1g-dev \
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ RUN set -ex \
tcl-dev \
tk \
tk-dev \
util-linux-dev \
xz-dev \
zlib-dev \
# add build deps before removing fetch deps in case there's overlap
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Python 3.4 on Stretch+ needs to use an older version of "libssl-dev" (these lines both get removed for every other combination)
libssl-dev \
tk-dev \
uuid-dev \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, we finally found a popular -dev that isn't already part of buildpack-deps! 😄

If we can find more examples of it being used (Ruby gems, etc), I'd be +1 to adding it to buildpack-deps itself, but that's a separate discussion. 😇

&& rm -rf /var/lib/apt/lists/*

ENV GPG_KEY %%PLACEHOLDER%%
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-slim.template
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ RUN set -ex \
libssl-dev \
make \
tk-dev \
uuid-dev \
wget \
xz-utils \
zlib1g-dev \
Expand Down
11 changes: 10 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,18 @@ for version in "${versions[@]}"; do
;;& # (3.5*/alpine* needs to match the next block too)
# Libraries to build the nis module only available in Alpine 3.7+.
# Also require this patch https://bugs.python.org/issue32521 only available in Python 2.7, 3.6+.
3.4*/alpine* | 3.5*/alpine* | */alpine3.6)
3.[4-5]*/alpine* | */alpine3.6)
sed -ri -e '/libnsl-dev/d' -e '/libtirpc-dev/d' "$dir/Dockerfile"
;;& # (3.4*/alpine* and 3.5*/alpine* need to match the next block too)
# https://bugs.python.org/issue11063, https://bugs.python.org/issue20519 (Python 3.7.0+)
# A new native _uuid module improves uuid import time and avoids using ctypes.
# This requires the development libuuid headers.
3.[4-6]*/alpine*)
sed -ri -e '/util-linux-dev/d' "$dir/Dockerfile"
;;
3.[4-6]*)
sed -ri -e '/uuid-dev/d' "$dir/Dockerfile"
;;& # (other Debian variants need to match later blocks)
3.4/stretch*)
sed -ri -e 's/libssl-dev/libssl1.0-dev/g' "$dir/Dockerfile"
;;
Expand Down