-
Notifications
You must be signed in to change notification settings - Fork 29
Upgrading built-in Python from Python 3.12 to Python 3.14 (#39) #78
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
base: develop
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -83,17 +83,20 @@ function set_up_base_lib_search_paths() { | |
| # $3: mpfr build dir | ||
| # $4: ncursesw build dir | ||
| # $5: expat build dir | ||
| # $6: lzma build dir | ||
| local iconv_build_dir="$1" | ||
| local gmp_build_dir="$2" | ||
| local mpfr_build_dir="$3" | ||
| local ncursesw_build_dir="$4" | ||
| local expat_build_dir="$5" | ||
| local lzma_build_dir="$6" | ||
|
|
||
| set_up_lib_search_path $iconv_build_dir 0 | ||
| set_up_lib_search_path $gmp_build_dir 0 | ||
| set_up_lib_search_path $mpfr_build_dir 0 | ||
| set_up_lib_search_path $ncursesw_build_dir 1 | ||
| set_up_lib_search_path $expat_build_dir 1 | ||
| set_up_lib_search_path $lzma_build_dir 1 | ||
| } | ||
|
|
||
| function build_iconv() { | ||
|
|
@@ -482,13 +485,14 @@ function build_python() { | |
| local target_arch="$2" | ||
| local gdb_python_parent="$3" | ||
| local pygments_source_dir="$4" | ||
|
|
||
| local python_lib_dir="$(realpath "$python_dir/build-$target_arch")" | ||
|
|
||
| echo "$python_lib_dir" | ||
| mkdir -p "$python_lib_dir" | ||
|
|
||
| # Having a python-config file is an indication that we successfully built python. | ||
| if [[ -f "$python_lib_dir/python-config" ]]; then | ||
| if [[ -f "$python_lib_dir/python-config" && -f "$python_lib_dir/libpython3.14.a" ]]; then | ||
|
Owner
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. try to make it generic by fetching the python version via python --version or which pythonX (might need to create a symlink so that it's name won't change each time we change a version, but you get the gist)
Owner
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. EDIT - even a global variable exported in the dockerfile is more then fine by me :) |
||
| >&2 echo "Skipping build: libpython already built for $target_arch" | ||
| return 0 | ||
| fi | ||
|
|
@@ -499,14 +503,14 @@ function build_python() { | |
| export LINKFORSHARED=" " | ||
| export MODULE_BUILDTYPE="static" | ||
| export CONFIG_SITE="$python_dir/config.site-static" | ||
| >&2 CFLAGS="-static" LDFLAGS="-static" ../configure \ | ||
| >&2 CFLAGS="${CFLAGS} -static" LDFLAGS="${LDFLAGS} -static -llzma" ../configure \ | ||
|
Owner
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. LOL good catch |
||
| --prefix="$(realpath .)" \ | ||
| --disable-test-modules \ | ||
| --with-ensurepip=no \ | ||
| --without-decimal-contextvar \ | ||
| --build=x86_64-pc-linux-gnu \ | ||
| --host=$HOST \ | ||
| --with-build-python=/usr/bin/python3.12 \ | ||
| --with-build-python=/usr/bin/python3.14 \ | ||
|
Owner
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. same comment as before about making it generic |
||
| --disable-ipv6 \ | ||
| --disable-shared | ||
|
|
||
|
|
@@ -517,7 +521,7 @@ function build_python() { | |
|
|
||
| # Regenerate frozen modules with gdb env varaible. Do it after the configure because we need | ||
| # the `regen-frozen` makefile. | ||
| >&2 python3.12 ../Tools/build/freeze_modules.py | ||
| >&2 python3.14 ../Tools/build/freeze_modules.py | ||
|
Owner
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. same |
||
| if [[ $? -ne 0 ]]; then | ||
| return 1 | ||
| fi | ||
|
|
@@ -827,16 +831,19 @@ function build_gdb_with_dependencies() { | |
| "$gmp_build_dir" \ | ||
| "$mpfr_build_dir" \ | ||
| "$ncursesw_build_dir" \ | ||
| "$libexpat_build_dir" | ||
| "$libexpat_build_dir" \ | ||
| "$lzma_build_dir" | ||
|
|
||
| # Optional build components | ||
| if [[ $full_build == "yes" && $full_build_python_support -eq 1 ]]; then | ||
| local libffi_install_dir="$(build_libffi "${packages_dir}/libffi" "${target_arch}")" | ||
| setup_libffi_env "${libffi_install_dir}" | ||
|
|
||
| local gdb_python_dir="$packages_dir/binutils-gdb/gdb/python/lib/" | ||
| local pygments_source_dir="$packages_dir/pygments/" | ||
| local python_build_dir="$(build_python "$packages_dir/cpython-static" "$target_arch" "$gdb_python_dir" "$pygments_source_dir")" | ||
| local gdb_python_dir pygments_source_dir python_build_dir | ||
|
|
||
| gdb_python_dir="$packages_dir/binutils-gdb/gdb/python/lib/" | ||
| pygments_source_dir="$packages_dir/pygments/" | ||
| python_build_dir="$(build_python "$packages_dir/cpython-static" "$target_arch" "$gdb_python_dir" "$pygments_source_dir" )" | ||
| if [[ $? -ne 0 ]]; then | ||
| return 1 | ||
| fi | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| _aix_support | ||
| _colorize | ||
|
Owner
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. could you tag the needed modules for GEF via a comment - i don't want them getting removed accidentally in the future (thank you for not remembering it :) ) |
||
| _opcode_metadata | ||
| _py_warnings | ||
| annotationlib | ||
| antigravity | ||
| argparse | ||
| ast | ||
|
|
@@ -14,7 +18,7 @@ _collections_abc | |
| colorsys | ||
| _compat_pickle | ||
| compileall | ||
| _compression | ||
| <compression.**.*> | ||
| <concurrent.**.*> | ||
| configparser | ||
| contextlib | ||
|
|
@@ -75,7 +79,7 @@ operator | |
| optparse | ||
| os | ||
| _osx_support | ||
| pathlib | ||
| <pathlib.**.*> | ||
| pdb | ||
| <__phello__.**.*> | ||
| pickle | ||
|
|
@@ -114,12 +118,12 @@ socketserver | |
| statistics | ||
| stat | ||
| stringprep | ||
| string | ||
| <string.**.*> | ||
| _strptime | ||
| struct | ||
| subprocess | ||
| symtable | ||
| sysconfig | ||
| <sysconfig.**.*> | ||
| tabnanny | ||
| tempfile | ||
| textwrap | ||
|
|
||
|
Owner
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 do not see anyone using this specific script. Anyhow, please document the purpose of this script :) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||
| #!/usr/bin/env bash | ||||||
|
|
||||||
| set -e | ||||||
|
|
||||||
| # Download and install a specific autoconf version. | ||||||
|
|
||||||
| # Example: "2.10" | ||||||
| AUTOCONF_VERSION="${1}" | ||||||
| if [ -z "${AUTOCONF_VERSION}" ]; then | ||||||
|
Owner
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.
Suggested change
|
||||||
| echo "No autoconf version supplied" | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| AUTOCONF_URL_BASE="https://ftp.gnu.org/gnu/autoconf/" | ||||||
| AUTOCONF_BASENAME="autoconf-${AUTOCONF_VERSION}.tar.gz" | ||||||
| AUTOCONF_URL="${AUTOCONF_URL_BASE}${AUTOCONF_BASENAME}" | ||||||
|
|
||||||
| autoconf_dir="$(mktemp -d)" | ||||||
| pushd "${autoconf_dir}" | ||||||
| echo "Using directory: ${autoconf_dir}" | ||||||
|
|
||||||
| echo "Downloading: ${AUTOCONF_URL}" | ||||||
| wget -O - "${AUTOCONF_URL}" | tar -xzf - | ||||||
|
|
||||||
| pushd "autoconf-${AUTOCONF_VERSION}" | ||||||
|
|
||||||
| ./configure | ||||||
|
|
||||||
| make install | ||||||
|
|
||||||
| popd &> /dev/null | ||||||
|
|
||||||
| popd &> /dev/null | ||||||
|
Owner
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. Looking good 💯
Owner
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. EDIT: btw, since you added expat, we can add ncurses as well, no? we already support it in gdb static just like expat |
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.
Could you keep the list alphabetically ordered (also need to move libtool as well haha)