-
Notifications
You must be signed in to change notification settings - Fork 223
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
Add UCS-2 builds of Python to the docker image #35
Changes from 1 commit
0e9db31
2799d61
919f52e
4c796c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,18 @@ function lex_pyver { | |
function do_python_build { | ||
local py_ver=$1 | ||
check_var $py_ver | ||
mkdir -p /opt/$py_ver/lib | ||
local soabi_flags=$2 | ||
check_var $soabi_flags | ||
mkdir -p /opt/${py_ver}${soabi_flags}/lib | ||
if [ $(lex_pyver $py_ver) -lt $(lex_pyver 3.3) ]; then | ||
local unicode_flags="--enable-unicode=ucs4" | ||
if [ $soabi_flags = "mu" ]; then | ||
local unicode_flags="--enable-unicode=ucs4" | ||
else | ||
local unicode_flags="--enable-unicode=ucs2" | ||
fi | ||
fi | ||
# -Wformat added for https://bugs.python.org/issue17547 on Python 2.6 | ||
CFLAGS="-Wformat" LDFLAGS="-Wl,-rpath /opt/$py_ver/lib" ./configure --prefix=/opt/$py_ver --disable-shared $unicode_flags > /dev/null | ||
CFLAGS="-Wformat" LDFLAGS="-Wl,-rpath /opt/${py_ver}${soabi_flags}/lib" ./configure --prefix=/opt/${py_ver}${soabi_flags} --disable-shared $unicode_flags > /dev/null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that now that we are using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense to me, there should be no reason we need an rpath pointing at the Python lib directory without a shared libpython. |
||
make -j2 > /dev/null | ||
make install > /dev/null | ||
} | ||
|
@@ -43,15 +49,22 @@ function build_python { | |
local py_ver2="$(echo $py_ver | cut -d. -f 1,2)" | ||
check_var $PYTHON_DOWNLOAD_URL | ||
wget -q $PYTHON_DOWNLOAD_URL/$py_ver/Python-$py_ver.tgz | ||
tar -xzf Python-$py_ver.tgz | ||
(cd Python-$py_ver && do_python_build $py_ver) | ||
if [ $(lex_pyver $py_ver) -ge $(lex_pyver 3) ]; then \ | ||
ln -s /opt/$py_ver/bin/python3 /opt/$py_ver/bin/python; | ||
fi; | ||
ln -s /opt/$py_ver/ /opt/$py_ver2 | ||
/opt/$py_ver/bin/python get-pip.py | ||
/opt/$py_ver/bin/pip install wheel | ||
rm -rf Python-$py_ver.tgz Python-$py_ver | ||
if [ $(lex_pyver $py_ver) -lt $(lex_pyver 3.3) ]; then | ||
local soabi_flags_list="mu m" | ||
fi | ||
for soabi_flags in ${soabi_flags_list:-m}; do | ||
tar -xzf Python-$py_ver.tgz | ||
(cd Python-$py_ver && do_python_build $py_ver $soabi_flags) | ||
if [ $(lex_pyver $py_ver) -ge $(lex_pyver 3) ]; then \ | ||
ln -s /opt/${py_ver}${soabi_flags}/bin/python3 /opt/${py_ver}${soabi_flags}/bin/python; | ||
fi; | ||
ln -s /opt/${py_ver}${soabi_flags}/ /opt/${py_ver2}${soabi_flags} | ||
[ ! -h /opt/${py_ver2} ] && ln -s /opt/${py_ver}${soabi_flags}/ /opt/$py_ver2 | ||
/opt/${py_ver}${soabi_flags}/bin/python get-pip.py | ||
/opt/${py_ver}${soabi_flags}/bin/pip install wheel | ||
rm -rf Python-$py_ver | ||
done | ||
rm -f Python-$py_ver.tgz | ||
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably just be
it's a bit redundant (checks the same interpreters repeatedly), but the test takes a fraction of a second so who cares -- being thorough and robust seems more important.