Bug 1872835 - Setup python 3.11 toolchain tasks r=jmaher

As a side effect, fix a few issues with how cpython is built on OSX:

- unset __PYVENV_LAUNCHER__
- make build script version-independent

Differential Revision: https://phabricator.services.mozilla.com/D197570
This commit is contained in:
serge-sans-paille 2024-01-08 15:37:08 +00:00
parent 3789811a83
commit 1ed5ce239c
4 changed files with 64 additions and 11 deletions

View File

@ -650,13 +650,22 @@ cpython-3.8.10.exe:
size: 28296784
artifact-name: python-3.8.10-amd64.exe
cpython-3.7.15:
description: cpython 3.7.15 source code
cpython-3.11.7:
description: cpython 3.11.7 source code
fetch:
type: static-url
url: https://www.python.org/ftp/python/3.7.15/Python-3.7.15.tgz
sha256: cf2993798ae8430f3af3a00d96d9fdf320719f4042f039380dca79967c25e436
size: 24033532
url: https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tgz
sha256: 068c05f82262e57641bd93458dfa883128858f5f4997aad7a36fd25b13b29209
size: 26601929
artifact-name: cpython-source.tar.zst
strip-components: 1
add-prefix: cpython-source/
cpython-3.11.7.exe:
description: cpython 3.11.7 installer
fetch:
type: static-url
url: https://www.python.org/ftp/python/3.11.7/python-3.11.7-amd64.exe
sha256: c117c6444494bbe4cc937e8a5a61899d53f7f5c5bc573c5d130304e457d54024
size: 26009544
artifact-name: python-3.11.7-amd64.exe

View File

@ -55,3 +55,43 @@ macosx64-python-3.8:
- macosx64-clang-toolchain
- macosx64-sdk-toolchain
- macosx64-xz
###
linux64-python-3.11:
treeherder:
symbol: TL(python3.11)
run:
toolchain-artifact: public/build/python.tar.zst
fetches:
fetch:
- cpython-3.11.7
worker:
docker-image: {in-tree: ubuntu1804-build-python}
win64-python-3.11:
description: "cpython 3.11.7"
treeherder:
symbol: TW64(python3.11)
run:
script: pack-cpython.sh
toolchain-artifact: public/build/python.tar.zst
fetches:
toolchain:
- linux64-wine
fetch:
- cpython-3.11.7.exe
macosx64-python-3.11:
treeherder:
symbol: TM(python3.11)
worker-type: b-osx-1015
run:
toolchain-artifact: public/build/python.tar.zst
fetches:
fetch:
- cpython-3.11.7
toolchain:
- macosx64-clang-toolchain
- macosx64-sdk-toolchain
- macosx64-xz

View File

@ -44,6 +44,9 @@ case `uname -s` in
export LDFLAGS="${LDFLAGS} ${sysroot_flags} -L${xz_prefix}/lib"
configure_flags_extra=--with-openssl=/usr/local/opt/openssl
# see https://bugs.python.org/issue22490
unset __PYVENV_LAUNCHER__
# see https://bugs.python.org/issue44065
sed -i -e 's,$CC --print-multiarch,:,' ${python_src}/configure
export LDFLAGS="${LDFLAGS} -Wl,-rpath -Wl,@loader_path/../.."
@ -65,6 +68,7 @@ tardir=python
cd `mktemp -d`
${python_src}/configure --prefix=/${tardir} --enable-optimizations ${configure_flags_extra} || { exit_status=$? && cat config.log && exit $exit_status ; }
export MAKEFLAGS=-j`nproc`
make
make DESTDIR=${work_dir} install
@ -80,13 +84,13 @@ case `uname -s` in
cp ${xz_prefix}/lib/liblzma.dylib ${work_dir}/python/lib/
# Instruct the loader to search for the lib in rpath instead of the one used during linking
install_name_tool -change /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib @rpath/libssl.1.1.dylib ${work_dir}/python/lib/python3.8/lib-dynload/_ssl.cpython-38-darwin.so
install_name_tool -change /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib @rpath/libcrypto.1.1.dylib ${work_dir}/python/lib/python3.8/lib-dynload/_ssl.cpython-38-darwin.so
otool -L ${work_dir}/python/lib/python3.8/lib-dynload/_ssl.cpython-38-darwin.so | grep @rpath/libssl.1.1.dylib
install_name_tool -change /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib @rpath/libssl.1.1.dylib ${work_dir}/python/lib/python3.*/lib-dynload/_ssl.cpython-3*-darwin.so
install_name_tool -change /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib @rpath/libcrypto.1.1.dylib ${work_dir}/python/lib/python3.*/lib-dynload/_ssl.cpython-3*-darwin.so
otool -L ${work_dir}/python/lib/python3.*/lib-dynload/_ssl.cpython-3*-darwin.so | grep @rpath/libssl.1.1.dylib
install_name_tool -change /xz/lib/liblzma.5.dylib @rpath/liblzma.5.dylib ${work_dir}/python/lib/python3.8/lib-dynload/_lzma.cpython-38-darwin.so
otool -L ${work_dir}/python/lib/python3.8/lib-dynload/_lzma.cpython-38-darwin.so | grep @rpath/liblzma.5.dylib
install_name_tool -change /xz/lib/liblzma.5.dylib @rpath/liblzma.5.dylib ${work_dir}/python/lib/python3.*/lib-dynload/_lzma.cpython-3*-darwin.so
otool -L ${work_dir}/python/lib/python3.*/lib-dynload/_lzma.cpython-3*-darwin.so | grep @rpath/liblzma.5.dylib
# Also modify the shipped libssl to use the shipped libcrypto
install_name_tool -change /usr/local/Cellar/openssl@1.1/1.1.1h/lib/libcrypto.1.1.dylib @rpath/libcrypto.1.1.dylib ${work_dir}/python/lib/libssl.1.1.dylib

View File

@ -13,7 +13,7 @@ tardir=python
mkdir $tardir
pushd $tardir
msiextract ../*
rm api-ms-win-*
rm -f api-ms-win-*
# bundle pip
$WINE python.exe -m ensurepip