Skip to content

Commit

Permalink
aarch64: ship python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed Feb 20, 2024
1 parent 1a251d4 commit 3199333
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 13 deletions.
10 changes: 9 additions & 1 deletion build/illumos/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ build_aarch64() {
PKGPUBLISHER_REDIST=$PKGPUBLISHER
DMAKE_MAX_JOBS=$MJOBS
PYTHON3_VERSION=$PYTHONVER
BUILDPY3b=
PYTHON3b_VERSION=3.11
PYTHON3b_PKGVERS=-311
PYTHON3b_SUFFIX=
PERL_VERSION=$SPERLVER
DTC=$OOCEBIN/dtc
MKIMAGE=$OOCEOPT/u-boot/tools/mkimage
Expand All @@ -126,7 +130,11 @@ build_aarch64() {
# Allow dropping into the build environment with everything set up
# for manual builds via '-f bldenv'
if [ "$action" = bldenv ]; then
env - $env TERM=$TERM SHELL=$SHELL $bldenv
env - $env \
TERM=$TERM \
SHELL=$SHELL \
HOME=`git rev-parse --show-toplevel` \
$bldenv
return
fi

Expand Down
2 changes: 2 additions & 0 deletions build/illumos/files/aarch64.env
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export ADJUNCT_PROTO=$aarch64_SYSROOT

export PKGVERS_BRANCH=$ONNV_BUILDNUM.0

export PKG_CROSS_DEPEND=${pfx%.*}

export PERL_MACH=aarch64
export PERLDIR=$aarch64_CROSS_ROOT/perl5/$PERL_VERSION
export PERL_PKGVERS=
Expand Down
3 changes: 3 additions & 0 deletions build/python311/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ TMPDIR+="/python$PYVER"
DTMPDIR+="/python$PYVER"
BASE_TMPDIR=$TMPDIR

# Use the same python version for dependency resolution
PKGDEPEND="/usr/bin/python$PYTHONVER -Es $PKGDEPEND"

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
19 changes: 11 additions & 8 deletions build/python312/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ set_arch 64
set_standard XPG6

# Save arguments to the stack so that the mdb/pstack plugin can find them.
CFLAGS+=" -msave-args"
CFLAGS[amd64]+=" -msave-args"
CFLAGS[aarch64]+=" -mtls-dialect=trad"

export CCSHARED="-fPIC"
CPPFLAGS+=" -I/usr/include/ncurses"
Expand Down Expand Up @@ -104,11 +105,7 @@ export DTRACE_CPP=$GCCPATH/bin/cpp

CURSES_CFLAGS="-DHAVE_NCURSESW -D_XOPEN_SOURCE_EXTENDED"
LIBREADLINE_LIBS="-zrecord -lreadline -lncurses"
PANEL_LIBS=`pkg-config --libs panel`
export CURSES_CFLAGS LIBREADLINE_LIBS PANEL_LIBS

#export LIBREADLINE_CFLAGS
#export CURSES_LIBS
export CURSES_CFLAGS LIBREADLINE_LIBS

build_init() {
typeset s=${SYSROOT[aarch64]}
Expand All @@ -118,11 +115,17 @@ build_init() {
}

pre_configure() {
typeset arch="$1"

save_variable CC

! cross_arch $1 && return
PKG_CONFIG_PATH="${PKG_CONFIG_PATH[$arch]}" \
PANEL_LIBS=`pkg-config --libs panel`
export PANEL_LIBS

! cross_arch $arch && return

CC+=" --sysroot=${SYSROOT[$1]}"
CC+=" --sysroot=${SYSROOT[$arch]}"
}

post_configure() {
Expand Down
3 changes: 3 additions & 0 deletions build/python312/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ TMPDIR+="/python$PYVER"
DTMPDIR+="/python$PYVER"
BASE_TMPDIR=$TMPDIR

# Use the same python version for dependency resolution
PKGDEPEND="/usr/bin/python$PYTHONVER -Es $PKGDEPEND"

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
5 changes: 3 additions & 2 deletions build/python312/cryptography/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ PATH+=:$OOCEBIN
# This package uses cffi as part of the build, and so the usual python cross
# compilation method (using the `crossenv` module) does not work.
# Somewhat surprisingly, this simple workaround does, although we have to
# use a compiler wrapper to strip the `-m64` that is otherwise picked by
# cffi from the native system info.
# use a compiler wrapper to strip options that are not applicable to
# the cross compiler and are otherwise picked by cffi from the native system
# info.
python_build_aarch64() {
typeset arch=aarch64

Expand Down
5 changes: 4 additions & 1 deletion build/python312/cryptography/files/gcc.aarch64
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/ksh

set -- `echo $@ | sed 's/-m64//g'`
set -- `echo $@ | sed '
s/-m64//g
s/-msave-args//g
'`

exec /opt/cross/aarch64/bin/gcc "$@"

26 changes: 26 additions & 0 deletions doc/baseline.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -214,27 +214,49 @@ omnios library/print/open-printing
omnios library/print/open-printing/ipp
omnios library/print/open-printing/lpd
omnios library/python-3/asn1crypto-311
omnios library/python-3/asn1crypto-312
omnios library/python-3/attrs-311
omnios library/python-3/attrs-312
omnios library/python-3/cffi-311
omnios library/python-3/cffi-312
omnios library/python-3/coverage-311
omnios library/python-3/coverage-312
omnios library/python-3/cryptography-311
omnios library/python-3/cryptography-312
omnios library/python-3/idna-311
omnios library/python-3/idna-312
omnios library/python-3/js-regex-311
omnios library/python-3/js-regex-312
omnios library/python-3/jsonrpclib-311
omnios library/python-3/jsonrpclib-312
omnios library/python-3/jsonschema-311
omnios library/python-3/jsonschema-312
omnios library/python-3/pip-311
omnios library/python-3/pip-312
omnios library/python-3/pycodestyle-311
omnios library/python-3/pycodestyle-312
omnios library/python-3/pycparser-311
omnios library/python-3/pycparser-312
omnios library/python-3/pycurl-311
omnios library/python-3/pycurl-312
omnios library/python-3/pyopenssl-311
omnios library/python-3/pyopenssl-312
omnios library/python-3/pyrsistent-311
omnios library/python-3/pyrsistent-312
omnios library/python-3/pyyaml-311
omnios library/python-3/pyyaml-312
omnios library/python-3/rapidjson-311
omnios library/python-3/rapidjson-312
omnios library/python-3/semantic-version-311
omnios library/python-3/semantic-version-312
omnios library/python-3/setuptools-311
omnios library/python-3/setuptools-312
omnios library/python-3/six-311
omnios library/python-3/six-312
omnios library/python-3/tomli-311
omnios library/python-3/tomli-312
omnios library/python-3/typing-extensions-311
omnios library/python-3/typing-extensions-312
omnios library/readline
omnios library/security/openssl-3
omnios library/security/tcp-wrapper
Expand Down Expand Up @@ -379,6 +401,7 @@ omnios release/notices
omnios runtime/perl
omnios runtime/perl/module/sun-solaris
omnios runtime/python-311
omnios runtime/python-312
omnios security/bart
omnios security/sudo
omnios service/fault-management
Expand Down Expand Up @@ -512,10 +535,13 @@ omnios system/library/policykit
omnios system/library/processor o
omnios system/library/python/libbe-27 o
omnios system/library/python/libbe-311
omnios system/library/python/libbe-312
omnios system/library/python/solaris-27 o
omnios system/library/python/solaris-311
omnios system/library/python/solaris-312
omnios system/library/python/zfs-27 o
omnios system/library/python/zfs-311
omnios system/library/python/zfs-312
omnios system/library/security/crypto/pkcs11_kms o
omnios system/library/security/gss
omnios system/library/security/gss/diffie-hellman
Expand Down
23 changes: 23 additions & 0 deletions doc/pkglist.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ library/mpc
media/xorriso
network/dns/bind
runtime/python-311
runtime/python-312
service/network/chrony
shell/zsh
system/library/mozilla-nss
Expand All @@ -109,35 +110,57 @@ system/library/libdbus -f libsandheaders
###############################################################################
.SYSROOT
library/python-3/asn1crypto-311
library/python-3/asn1crypto-312
library/python-3/attrs-311
library/python-3/attrs-312
library/python-3/cffi-311
library/python-3/cffi-312
library/python-3/coverage-311
library/python-3/coverage-312
library/python-3/idna-311
library/python-3/idna-312
library/python-3/js-regex-311
library/python-3/js-regex-312
library/python-3/jsonrpclib-311
library/python-3/jsonrpclib-312
library/python-3/pip-311
library/python-3/pip-312
library/python-3/pycodestyle-311
library/python-3/pycodestyle-312
library/python-3/pycparser-311
library/python-3/pycparser-312
library/python-3/pycurl-311
library/python-3/pycurl-312
library/python-3/pyrsistent-311
library/python-3/pyrsistent-312
library/python-3/pyyaml-311
library/python-3/pyyaml-312
library/python-3/rapidjson-311
library/python-3/rapidjson-312
library/python-3/semantic-version-311
library/python-3/semantic-version-312
library/python-3/setuptools-311
library/python-3/setuptools-312
library/python-3/six-311
library/python-3/six-312
library/python-3/tomli-311
library/python-3/tomli-312
library/python-3/typing-extensions-311
library/python-3/typing-extensions-312
system/library/dbus
system/library/libdbus-glib
system/library/pcap
###############################################################################
.SYSROOT
library/python-3/cryptography-311
library/python-3/cryptography-312
library/python-3/jsonschema-311
library/python-3/jsonschema-312
system/management/snmp/net-snmp
###############################################################################
.SYSROOT
library/python-3/pyopenssl-311
library/python-3/pyopenssl-312
###############################################################################
.SYSROOT
illumos-gate
Expand Down
5 changes: 4 additions & 1 deletion lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3044,9 +3044,12 @@ python_cross_setup() {
# Prepare a cross compilation environment
logmsg "--- Preparing cross compilation environment"
set_crossgcc $arch
logcmd $PYTHON -mcrossenv ${SYSROOT[$arch]}$PYTHON $TMPDIR/venv \
logcmd $PYTHON -mcrossenv -vvv \
${SYSROOT[$arch]}$PYTHON \
$TMPDIR/venv \
|| logerr "Failed to set up crossenv"
source $TMPDIR/venv/bin/activate
logcmd $TMPDIR/venv/cross/bin/pip3 install setuptools
}

python_build_aarch64() {
Expand Down

0 comments on commit 3199333

Please sign in to comment.