From 3ca52ac12fdb1265b1f6449847b7e6739c8f1811 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 27 Nov 2026 00:04:56 +0100 Subject: [PATCH 1/3] Require Erlang/OTP 28 or later CI no longer tests OTP 27, so rebar3 now refuses to build on it rather than letting anyone run a combination the tests never cover. The OTP 27 rows leave the CI matrix. --- .github/workflows/ci.yml | 14 ++------------ rebar.config | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e36f6bb..6ea3a54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,17 +15,7 @@ jobs: fail-fast: false matrix: include: - # Linux - OTP 27 (minimum supported) - - os: ubuntu-24.04 - otp: "27" - python: "3.12" - - os: ubuntu-24.04 - otp: "27" - python: "3.13" - - os: ubuntu-24.04 - otp: "27" - python: "3.14" - # Linux - OTP 28 + # Linux - OTP 28 (minimum supported) - os: ubuntu-24.04 otp: "28" python: "3.12" @@ -140,7 +130,7 @@ jobs: usesh: true prepare: | # Stock `erlang` pkg lags at OTP 26; use the versioned runtime - # package so we test on a supported OTP (27+). + # package so we test on a supported OTP (28+). pkg install -y erlang-runtime28 ${{ matrix.python_pkg }} cmake # numpy package follows the py-numpy convention. # Non-fatal: not every FreeBSD pkg snapshot ships numpy for diff --git a/rebar.config b/rebar.config index a96cb3a..cae38d1 100644 --- a/rebar.config +++ b/rebar.config @@ -1,6 +1,6 @@ {erl_opts, [debug_info]}. -{minimum_otp_vsn, "27"}. +{minimum_otp_vsn, "28"}. {xref_checks, [ undefined_function_calls, From bfb19a64e03880a4feed6b83eb8c17fb9fbb9eca Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 27 Nov 2026 00:05:43 +0100 Subject: [PATCH 2/3] Test OTP 28 on macOS and OTP 29 on FreeBSD The macOS matrix gains an OTP 28 job built with the versioned erlang@28 formula, whose bin dir goes first in PATH so rebar3 runs on 28. The FreeBSD matrix now names its OTP runtime package per row, so one job tests OTP 28 and the other OTP 29. --- .github/workflows/ci.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ea3a54..82e5196 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,8 @@ jobs: - os: ubuntu-24.04 otp: "29" python: "3.14" - # macOS (brew installs the latest OTP) + # macOS (brew: the erlang formula is the latest OTP, erlang@28 + # the versioned one) - os: macos-15 otp: "29" python: "3.12" @@ -45,6 +46,10 @@ jobs: - os: macos-15 otp: "29" python: "3.14" + - os: macos-15 + otp: "28" + python: "3.14" + brew_erlang: erlang@28 steps: - name: Checkout @@ -65,7 +70,10 @@ jobs: - name: Set up Erlang (macOS) if: startsWith(matrix.os, 'macos') run: | - brew install erlang rebar3 + brew install ${{ matrix.brew_erlang || 'erlang' }} rebar3 + if [ "${{ matrix.brew_erlang }}" = "erlang@28" ]; then + echo "$(brew --prefix erlang@28)/bin" >> "$GITHUB_PATH" + fi - name: Install numpy (for ML thread-affinity tests) run: | @@ -107,7 +115,7 @@ jobs: # FreeBSD test using cross-platform action test-freebsd: - name: FreeBSD 14 / Python ${{ matrix.python }} + name: FreeBSD 14 / OTP ${{ matrix.otp }} / Python ${{ matrix.python }} runs-on: ubuntu-24.04 strategy: @@ -116,8 +124,12 @@ jobs: include: - python: "3.12" python_pkg: "python312" + otp: "28" + otp_pkg: "erlang-runtime28" - python: "3.13" python_pkg: "python313" + otp: "29" + otp_pkg: "erlang-runtime29" steps: - name: Checkout @@ -131,7 +143,7 @@ jobs: prepare: | # Stock `erlang` pkg lags at OTP 26; use the versioned runtime # package so we test on a supported OTP (28+). - pkg install -y erlang-runtime28 ${{ matrix.python_pkg }} cmake + pkg install -y ${{ matrix.otp_pkg }} ${{ matrix.python_pkg }} cmake # numpy package follows the py-numpy convention. # Non-fatal: not every FreeBSD pkg snapshot ships numpy for # every Python flavor; the ML SUITE self-skips when numpy @@ -142,8 +154,9 @@ jobs: run: | # Set up environment export PYTHON_CONFIG=python${{ matrix.python }}-config - # erlang-runtime28 installs outside the default PATH; add its bin dir. - ERL_BIN="$(dirname "$(pkg info -l erlang-runtime28 | tr -d '[:blank:]' | grep -E '/bin/erl$' | grep -v 'erts-' | head -1)")" + # The OTP runtime package installs outside the default PATH; + # add its bin dir. + ERL_BIN="$(dirname "$(pkg info -l ${{ matrix.otp_pkg }} | tr -d '[:blank:]' | grep -E '/bin/erl$' | grep -v 'erts-' | head -1)")" export PATH="$ERL_BIN:/usr/local/bin:$PATH" # Verify versions From 797f5b519b41eedd24b05ca997a62eb3b35dcabe Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 27 Nov 2026 00:15:14 +0100 Subject: [PATCH 3/3] Document the OTP 28 and 29 support policy README, CONTRIBUTING and AGENTS state the new floor, scalability.md corrects the NIF API story (2.17 on both releases) and records the OTP 28 dedicated reselect pollset. A decision record writes down the rule: the two latest OTP releases, raised by the next minor when a new release ships. --- AGENTS.md | 2 +- CHANGELOG.md | 7 +++++ CONTRIBUTING.md | 12 ++++---- README.md | 2 +- docs/decisions/0010-supported-otp-releases.md | 28 +++++++++++++++++++ docs/decisions/overview.md | 1 + docs/scalability.md | 8 ++++-- rebar.config | 4 ++- 8 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 docs/decisions/0010-supported-otp-releases.md diff --git a/AGENTS.md b/AGENTS.md index ad98da4..9bcd6cc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,7 +11,7 @@ call Python, and Python calls back into Erlang. Python runs in contexts: `worker` (a thread per context on the main interpreter), `owngil` (a thread and a subinterpreter with its own GIL, Python 3.14 and later) and `isolated` (a child OS process). Isolated sessions give each session a fresh child -started from a prepared template. Requires Erlang/OTP 27 or later, Python +started from a prepared template. Requires Erlang/OTP 28 or later, Python 3.12 or later with headers, CMake and a C compiler. ## First principle: a NIF bug takes down the node diff --git a/CHANGELOG.md b/CHANGELOG.md index 51c4f94..f73e9c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,13 @@ only the variables named in `env`, and every child built with the same seed hashes strings and orders sets the same way. +### Changed + +- **Erlang/OTP 28 or later is required** - OTP 27 is no longer supported + and rebar3 refuses to build on it; stay on 5.0.x if you need OTP 27. + From now on the two latest OTP releases are supported, and CI tests + OTP 28 and 29 on Linux, macOS and FreeBSD. + ### Fixed - On an owngil context, the process-local environment of an Erlang process diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 742ef1f..e0332e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,7 +75,7 @@ name. ## Build -You need OTP 27 or later, Python 3.12 or later with headers, CMake and a C +You need OTP 28 or later, Python 3.12 or later with headers, CMake and a C compiler. ```sh @@ -196,11 +196,11 @@ rules were adopted are listed in that rule's `ignore`; a new module follows every rule, and a module comes off a list when it is reworked, never onto one to make a change pass. -CI runs the matrix in `.github/workflows/ci.yml`: OTP 27 to 29 with Python -3.12 to 3.14 on Ubuntu and macOS, FreeBSD 14 through `vmactions/freebsd-vm`, -free-threaded 3.13t, ASan, the lint job (formatting, Elvis, xref, dialyzer, -code map) and the documentation build. A pull request is merged when all of -them are green. +CI runs the matrix in `.github/workflows/ci.yml`: OTP 28 and 29 with Python +3.12 to 3.14 on Ubuntu and macOS, FreeBSD 14 on OTP 28 and 29 through +`vmactions/freebsd-vm`, free-threaded 3.13t, ASan, the lint job (formatting, +Elvis, xref, dialyzer, code map) and the documentation build. A pull request +is merged when all of them are green. ## Recipes diff --git a/README.md b/README.md index c5b195f..1289453 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Key features: ## Requirements -- Erlang/OTP 27+ (tested on OTP 27, 28, and 29) +- Erlang/OTP 28 or later (tested on OTP 28 and 29) - Python 3.12+ (3.13+ for free-threading) - C compiler (gcc, clang) diff --git a/docs/decisions/0010-supported-otp-releases.md b/docs/decisions/0010-supported-otp-releases.md new file mode 100644 index 0000000..8c41132 --- /dev/null +++ b/docs/decisions/0010-supported-otp-releases.md @@ -0,0 +1,28 @@ +# 0010: The two latest OTP releases are supported + +Since 5.1.0. Code: `rebar.config` (`minimum_otp_vsn`), +`.github/workflows/ci.yml`. + +## Situation + +The floor went up to OTP 28 in 3.1.0 and came back down to 27 in 3.1.1, +because nothing in the code needed 28. Nothing stops it from moving again +the next time someone asks. OTP itself supports its last three releases: +it still patches 27 until OTP 30 ships, so 27 is narrower than OTP's own +window, but CI cannot keep testing three releases for nothing. + +## Decision + +erlang_python supports the two latest OTP releases, with no upper bound. +When a new release ships, CI adds its rows and the next minor release +raises the floor to the release before it. `minimum_otp_vsn` in +`rebar.config` is the check: rebar3 refuses to build on an older release, +so nobody runs a combination CI no longer tests. There is no source guard; +without the CI row the older release would be untested, not broken. + +## Consequences + +- A user on the oldest release OTP still patches stays on the previous + minor release (5.0.x for OTP 27). +- Code may use features of the floor release without a fallback, once CI + covers it on every OS in the matrix. diff --git a/docs/decisions/overview.md b/docs/decisions/overview.md index a6e2e3a..af55851 100644 --- a/docs/decisions/overview.md +++ b/docs/decisions/overview.md @@ -17,3 +17,4 @@ what was decided, what it costs, and where the code is. | [0007](0007-remove-legacy-execution-paths.md) | One execution path per mode; the legacy API is removed | 5.0.0 | | [0008](0008-pipe-io-rules.md) | Pipe I/O is non-blocking, deadlined and waited with poll | 3.1.0, 5.0.0 | | [0009](0009-isolated-sessions.md) | Sessions fork from a prepared zygote | 5.1.0 | +| [0010](0010-supported-otp-releases.md) | The two latest OTP releases are supported | 5.1.0 | diff --git a/docs/scalability.md b/docs/scalability.md index 4968bc7..a7cd137 100644 --- a/docs/scalability.md +++ b/docs/scalability.md @@ -620,8 +620,12 @@ OTP releases still help for free: - **Consistent map iteration order** is now guaranteed across map operations in OTP 29. The router and state modules do not depend on iteration order, so this changes nothing here, but it removes a class of subtle bugs if you build on top. -- **Building the NIF stays the same** across OTP 28/29 (NIF API 2.18); no version - guards are needed in `c_src`. +- **Building the NIF stays the same** on OTP 28 and 29: the NIF uses NIF + API 2.17, which OTP 28 provides; OTP 29's 2.18 only adds calls the code + does not use, so `c_src` needs no version guards. +- **Cheaper FD re-arming** on OTP 28 and later: a descriptor the event loop + re-arms for reading after each event stays in a dedicated pollset, so the + reselect path does not re-insert it each time. For doc-example testing, OTP 29 ships `ct_doctest`. This project keeps its own `scripts/lint_doc_snippets.escript` because that linter also validates the Python diff --git a/rebar.config b/rebar.config index cae38d1..a6de959 100644 --- a/rebar.config +++ b/rebar.config @@ -119,6 +119,7 @@ <<"docs/decisions/0007-remove-legacy-execution-paths.md">>, <<"docs/decisions/0008-pipe-io-rules.md">>, <<"docs/decisions/0009-isolated-sessions.md">>, + <<"docs/decisions/0010-supported-otp-releases.md">>, <<"docs/preload.md">>, <<"docs/owngil_internals.md">>, <<"docs/event_loop_architecture.md">> @@ -175,7 +176,8 @@ <<"docs/decisions/0006-shared-memory-over-iommap.md">>, <<"docs/decisions/0007-remove-legacy-execution-paths.md">>, <<"docs/decisions/0008-pipe-io-rules.md">>, - <<"docs/decisions/0009-isolated-sessions.md">> + <<"docs/decisions/0009-isolated-sessions.md">>, + <<"docs/decisions/0010-supported-otp-releases.md">> ]} ]} ]}.