Skip to content

Commit ad9f7ee

Browse files
Merge branch 'master' into trishank_kuppusamy/curl-ssl
2 parents 1957026 + 72d7f7e commit ad9f7ee

File tree

4 files changed

+7767
-11
lines changed

4 files changed

+7767
-11
lines changed

docker/build_scripts/build.sh

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,33 @@ CPYTHON_VERSIONS="2.6.9 2.7.13 3.3.6 3.4.6 3.5.3 3.6.0"
99

1010
# openssl version to build, with expected sha256 hash of .tar.gz
1111
# archive
12-
OPENSSL_ROOT=openssl-1.0.2m
13-
# Hash from https://www.openssl.org/source/openssl-1.0.2?.tar.gz.sha256
14-
OPENSSL_HASH=8c6ff15ec6b319b50788f42c7abc2890c08ba5a1cdcd3810eb9092deada37b0f
12+
OPENSSL_ROOT=openssl-1.0.2n
13+
# Hash from https://www.openssl.org/source/openssl-1.0.2n.tar.gz.sha256
14+
# Matches hash at https://github.com/Homebrew/homebrew-core/blob/99b8ea3594d1f1f78b0fff1fd8ca7d782aa07e13/Formula/openssl.rb#L11
15+
OPENSSL_HASH=370babb75f278c39e0c50e8c4e7493bc0f18db6867478341a832a982fd15a8fe
1516
EPEL_RPM_HASH=0dcc89f9bf67a2a515bad64569b7a9615edc5e018f676a578d5fd0f17d3c81d4
1617
DEVTOOLS_HASH=a8ebeb4bed624700f727179e6ef771dafe47651131a00a78b342251415646acc
17-
PATCHELF_VERSION=6bfcafbba8d89e44f9ac9582493b4f27d9d8c369
18+
# Update to slightly newer, verified Git commit:
19+
# https://github.com/NixOS/patchelf/commit/2a9cefd7d637d160d12dc7946393778fa8abbc58
20+
PATCHELF_VERSION=2a9cefd7d637d160d12dc7946393778fa8abbc58
21+
PATCHELF_HASH=12da4727f09be42ae0b54878e1b8e86d85cb7a5b595731cdc1a0a170c4873c6d
1822
CURL_ROOT=curl-7.57.0
1923
# https://github.com/Homebrew/homebrew-core/blob/e3a8622111ecefe444194cade5cca3c69165e26c/Formula/curl.rb#L6
2024
CURL_HASH=c92fe31a348eae079121b73884065e600c533493eb50f1f6cee9c48a3f454826
2125
AUTOCONF_ROOT=autoconf-2.69
2226
AUTOCONF_HASH=954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969
2327
AUTOMAKE_ROOT=automake-1.15
2428
AUTOMAKE_HASH=7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924
29+
LIBTOOL_ROOT=libtool-2.4.6
30+
LIBTOOL_HASH=e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3
31+
SQLITE_AUTOCONF_VERSION=sqlite-autoconf-3210000
32+
# Homebrew saw the same hash: https://github.com/Homebrew/homebrew-core/blob/e3a8622111ecefe444194cade5cca3c69165e26c/Formula/sqlite.rb#L6
33+
SQLITE_AUTOCONF_HASH=d7dd516775005ad87a57f428b6f86afd206cb341722927f104d3f0cf65fbbbe3
2534

2635
# Dependencies for compiling Python that we want to remove from
2736
# the final image after compiling Python
28-
PYTHON_COMPILE_DEPS="zlib-devel bzip2-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel"
37+
# GPG installed to verify signatures on Python source tarballs.
38+
PYTHON_COMPILE_DEPS="zlib-devel bzip2-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel gpg"
2939

3040
# Libraries that are allowed as part of the manylinux1 profile
3141
MANYLINUX1_DEPS="glibc-devel libstdc++-devel glib2-devel libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel libSM-devel ncurses-devel"
@@ -55,6 +65,7 @@ yum -y update
5565

5666
# EPEL support
5767
yum -y install wget curl
68+
# https://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
5869
cp $MY_DIR/epel-release-5-4.noarch.rpm .
5970
check_sha256sum epel-release-5-4.noarch.rpm $EPEL_RPM_HASH
6071

@@ -81,14 +92,19 @@ autoconf --version
8192
build_automake $AUTOMAKE_ROOT $AUTOMAKE_HASH
8293
automake --version
8394

95+
# Install newest libtool
96+
build_libtool $LIBTOOL_ROOT $LIBTOOL_HASH
97+
libtool --version
98+
8499
# Install a more recent SQLite3
85-
curl -fsSLO https://sqlite.org/2017/sqlite-autoconf-3160200.tar.gz
86-
tar xfz sqlite-autoconf-3160200.tar.gz
87-
cd sqlite-autoconf-3160200
100+
curl -fsSLO https://sqlite.org/2017/$SQLITE_AUTOCONF_VERSION.tar.gz
101+
check_sha256sum $SQLITE_AUTOCONF_VERSION.tar.gz $SQLITE_AUTOCONF_HASH
102+
tar xfz $SQLITE_AUTOCONF_VERSION.tar.gz
103+
cd $SQLITE_AUTOCONF_VERSION
88104
./configure
89105
make install
90106
cd ..
91-
rm -rf sqlite-autoconf-3160200*
107+
rm -rf $SQLITE_AUTOCONF_VERSION*
92108

93109
# Compile the latest Python releases.
94110
# (In order to have a proper SSL module, Python is compiled
@@ -123,6 +139,7 @@ rm -rf /usr/local/ssl
123139

124140
# Install patchelf (latest with unreleased bug fixes)
125141
curl -fsSL -o patchelf.tar.gz https://github.com/NixOS/patchelf/archive/$PATCHELF_VERSION.tar.gz
142+
check_sha256sum patchelf.tar.gz $PATCHELF_HASH
126143
tar -xzf patchelf.tar.gz
127144
(cd patchelf-$PATCHELF_VERSION && ./bootstrap.sh && ./configure && make && make install)
128145
rm -rf patchelf.tar.gz patchelf-$PATCHELF_VERSION

docker/build_scripts/build_utils.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
1313

1414
AUTOCONF_DOWNLOAD_URL=http://ftp.gnu.org/gnu/autoconf
1515
AUTOMAKE_DOWNLOAD_URL=http://ftp.gnu.org/gnu/automake
16+
LIBTOOL_DOWNLOAD_URL=http://ftp.gnu.org/gnu/libtool
1617

1718

1819
function check_var {
@@ -75,14 +76,17 @@ function build_cpython {
7576
local py_ver=$1
7677
check_var $py_ver
7778
check_var $PYTHON_DOWNLOAD_URL
78-
wget -q $PYTHON_DOWNLOAD_URL/$py_ver/Python-$py_ver.tgz
79+
curl -fsSLO $PYTHON_DOWNLOAD_URL/$py_ver/Python-$py_ver.tgz
80+
curl -fsSLO $PYTHON_DOWNLOAD_URL/$py_ver/Python-$py_ver.tgz.asc
81+
gpg --verify Python-$py_ver.tgz.asc
7982
if [ $(lex_pyver $py_ver) -lt $(lex_pyver 3.3) ]; then
8083
do_cpython_build $py_ver ucs2
8184
do_cpython_build $py_ver ucs4
8285
else
8386
do_cpython_build $py_ver none
8487
fi
8588
rm -f Python-$py_ver.tgz
89+
rm -f Python-$py_ver.tgz.asc
8690
}
8791

8892

@@ -92,9 +96,14 @@ function build_cpythons {
9296
# versions used by the get-pip server. Keep trying though, because we'll
9397
# want to go back using $GET_PIP_URL when we upgrade to a newer CentOS...
9498
curl -sSLO $GET_PIP_URL || cp ${MY_DIR}/get-pip.py .
99+
# Import public keys used to verify downloaded Python source tarballs.
100+
# https://www.python.org/static/files/pubkeys.txt
101+
gpg --import ${MY_DIR}/cpython-pubkeys.txt
95102
for py_ver in $@; do
96103
build_cpython $py_ver
97104
done
105+
# Remove GPG hidden directory.
106+
rm -rf /root/.gnupg/
98107
rm -f get-pip.py
99108
}
100109

@@ -173,6 +182,7 @@ function build_autoconf {
173182
rm -rf ${autoconf_fname} ${autoconf_fname}.tar.gz
174183
}
175184

185+
176186
function build_automake {
177187
local automake_fname=$1
178188
check_var ${automake_fname}
@@ -185,3 +195,17 @@ function build_automake {
185195
(cd ${automake_fname} && do_standard_install)
186196
rm -rf ${automake_fname} ${automake_fname}.tar.gz
187197
}
198+
199+
200+
function build_libtool {
201+
local libtool_fname=$1
202+
check_var ${libtool_fname}
203+
local libtool_sha256=$2
204+
check_var ${libtool_sha256}
205+
check_var ${LIBTOOL_DOWNLOAD_URL}
206+
curl -sSLO ${LIBTOOL_DOWNLOAD_URL}/${libtool_fname}.tar.gz
207+
check_sha256sum ${libtool_fname}.tar.gz ${libtool_sha256}
208+
tar -zxf ${libtool_fname}.tar.gz
209+
(cd ${libtool_fname} && do_standard_install)
210+
rm -rf ${libtool_fname} ${libtool_fname}.tar.gz
211+
}

0 commit comments

Comments
 (0)