From 39fb5d7612e37eb8fe42adddaa62bb0c5d2ae71d Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Wed, 6 Aug 2025 13:43:08 -0600 Subject: [PATCH] Add zstd as a build dependency and add note for Python 3.14 and compression.zstd. --- Home.md | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/Home.md b/Home.md index 00e968d..dc9945f 100644 --- a/Home.md +++ b/Home.md @@ -12,13 +12,20 @@ compilation succeeds but the new Python version exhibits weird failures at runtime. The following instructions are our recommendations for a sane build environment. +_**Note**_ + +Python 3.14 adds support for a `compression.zstd` module that depends on zstd +version 1.4.5 or newer. This version is not available in some extended-release +distros like Alma/Rocky Linux 8 and Ubuntu 20.04. See [PEP +784](https://peps.python.org/pep-0784/) for more details. + * **Mac OS X:** If you haven't done so, install Xcode Command Line Tools (`xcode-select --install`) and [Homebrew](http://brew.sh/). Then: ```sh - brew install openssl readline sqlite3 xz zlib tcl-tk@8 libb2 + brew install openssl readline sqlite3 xz zlib tcl-tk@8 libb2 zstd ``` For older operating systems `Homebrew` might not be available so install `pyenv` with: @@ -40,7 +47,7 @@ environment. For dependencies use [MacPorts](https://www.macports.org/install.php): ```sh - sudo port install pkgconfig openssl zlib xz gdbm tcl tk +quartz sqlite3 sqlite3-tcl + sudo port install pkgconfig openssl zlib xz gdbm tcl tk +quartz sqlite3 sqlite3-tcl zstd ``` * **Ubuntu/Debian/Mint:** @@ -51,6 +58,8 @@ environment. libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev ``` + Additionally, you should install `libstd-dev` if you are building Python 3.14 or newer but note that Ubuntu 20.04 does not include a sufficiently new version of this package to build the `compression.zstd` module. + The Python's documentation reports a different set of dependencies in the [documentation](https://devguide.python.org/getting-started/setup-building/#build-dependencies) and in the script used in the [GitHub Actions](https://github.com/python/cpython/blob/main/.github/workflows/posix-deps-apt.sh) If you are going build PyPy from source or install other Python flavors that require CLang, also install `llvm`. @@ -61,24 +70,31 @@ environment. yum install gcc make patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel ``` + Additionally, you should install `zstd-devel` if you are building Python 3.14 or newer but note that Python requires zstd 1.4.5 or newer, which may not be available in the default package repositories. + * **Amazon Linux 2:** ```sh yum install gcc make patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl11-devel tk-devel libffi-devel xz-devel ``` + + Additionally, you should install `zstd-devel` if you are building Python 3.14 or newer but note that Python requires zstd 1.4.5 or newer, which may not be available in the default package repositories. + * **Fedora 22 and above:** ```sh dnf install make gcc patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel libuuid-devel gdbm-libs libnsl2 ``` + Additionally, you should install `zstd-devel` if you are building Python 3.14 or newer but note that Python requires zstd 1.4.5 or newer, which may not be available in the default package repositories. + * **Fedora Silverblue** ```sh toolbox enter sudo dnf update vte-profile # https://github.com/containers/toolbox/issues/390 sudo dnf install "@Development Tools" zlib-devel bzip2 bzip2-devel readline-devel sqlite \ - sqlite-devel openssl-devel xz xz-devel libffi-devel findutils tk-devel + sqlite-devel openssl-devel xz xz-devel libffi-devel findutils tk-devel zstd-devel ``` * **openSUSE:** @@ -88,23 +104,25 @@ environment. readline-devel zlib-devel tk-devel libffi-devel sqlite3-devel gdbm-devel make findutils patch ``` + Additionally, you should install `libzstd-devel` if you are building Python 3.14 or newer but note that Python requires zstd 1.4.5 or newer, which may not be available in the default package repositories. + * **Arch Linux:** ```sh - pacman -S --needed base-devel openssl zlib xz tk + pacman -S --needed base-devel openssl zlib xz tk zstd ``` * **Solus:** ``` sudo eopkg it -c system.devel - sudo eopkg install git gcc make zlib-devel bzip2-devel readline-devel sqlite3-devel openssl-devel tk-devel + sudo eopkg install git gcc make zlib-devel bzip2-devel readline-devel sqlite3-devel openssl-devel tk-devel zstd-devel ``` * **Alpine Linux:** ```sh - apk add --no-cache git bash build-base libffi-dev openssl-dev bzip2-dev zlib-dev xz-dev readline-dev sqlite-dev tk-dev + apk add --no-cache git bash build-base libffi-dev openssl-dev bzip2-dev zlib-dev xz-dev readline-dev sqlite-dev tk-dev zstd-dev ``` * Installation of Python 3.7 may fail due to Python 3.7.0 issue [#34555](https://bugs.python.org/issue34555). A workaround is to install the [linux system headers package](https://pkgs.alpinelinux.org/packages?name=linux-headers&branch=edge): @@ -116,7 +134,7 @@ environment. * **Void Linux:** ```sh - xbps-install base-devel libffi-devel bzip2-devel openssl openssl-devel readline readline-devel sqlite-devel xz liblzma-devel zlib zlib-devel + xbps-install base-devel libffi-devel bzip2-devel openssl openssl-devel readline readline-devel sqlite-devel xz liblzma-devel zlib zlib-devel libzstd-devel ```