diff --git a/Dockerfile b/Dockerfile index 8af9634..1633d70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,19 +24,22 @@ RUN apt update && apt install -y \ make \ patch \ pkg-config \ - python3.12 \ python3-pip \ + software-properties-common \ libpython3-dev \ texinfo \ wget \ xz-utils +RUN add-apt-repository ppa:deadsnakes/ppa +RUN apt update && apt install -y python3.14 + # We require aiohttp >= 3.12 (For client middleware support), which is newer than the currently # available python3-aiohttp's version in Ubuntu. -RUN python3.12 -m pip install --break-system-packages aiohttp +RUN python3.14 -m pip install --break-system-packages aiohttp COPY src/docker_utils/download_musl_toolchains.py . -RUN python3.12 -u download_musl_toolchains.py +RUN python3.14 -u download_musl_toolchains.py WORKDIR /app/gdb diff --git a/src/compilation/build.sh b/src/compilation/build.sh index de18264..483e8bf 100755 --- a/src/compilation/build.sh +++ b/src/compilation/build.sh @@ -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 >&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 \ --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 \ --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 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 diff --git a/src/compilation/frozen_python_modules.txt b/src/compilation/frozen_python_modules.txt index 573ad6b..3ea1fa6 100644 --- a/src/compilation/frozen_python_modules.txt +++ b/src/compilation/frozen_python_modules.txt @@ -1,4 +1,8 @@ _aix_support +_colorize +_opcode_metadata +_py_warnings +annotationlib antigravity argparse ast @@ -14,7 +18,7 @@ _collections_abc colorsys _compat_pickle compileall -_compression + configparser contextlib @@ -75,7 +79,7 @@ operator optparse os _osx_support -pathlib + pdb <__phello__.**.*> pickle @@ -114,12 +118,12 @@ socketserver statistics stat stringprep -string + _strptime struct subprocess symtable -sysconfig + tabnanny tempfile textwrap diff --git a/src/compilation/install_autoconf.sh b/src/compilation/install_autoconf.sh new file mode 100755 index 0000000..c23becd --- /dev/null +++ b/src/compilation/install_autoconf.sh @@ -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 + 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 \ No newline at end of file diff --git a/src/docker_utils/download_musl_toolchains.py b/src/docker_utils/download_musl_toolchains.py index 5391131..62b0ad3 100755 --- a/src/docker_utils/download_musl_toolchains.py +++ b/src/docker_utils/download_musl_toolchains.py @@ -61,7 +61,7 @@ async def download_file(url: str, filename: str): def extract_tarfile(filename: str, dst: Path): with tarfile.open(filename, "r") as tar: - tar.extractall(path=dst) + tar.extractall(path=dst, filter='tar') async def download_tarfile(tar_url: str, extraction_dir: Path): with tempfile.NamedTemporaryFile() as named_tempfile: diff --git a/src/submodule_packages/cpython-static b/src/submodule_packages/cpython-static index 3ab23e8..b050bb8 160000 --- a/src/submodule_packages/cpython-static +++ b/src/submodule_packages/cpython-static @@ -1 +1 @@ -Subproject commit 3ab23e8b1e263018fee7e6bf84109a532b9f01c0 +Subproject commit b050bb85878276e4d30c8afa81304fd84d6d3f3f