Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -45,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"
Expand All @@ -55,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
Expand All @@ -75,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: |
Expand Down Expand Up @@ -117,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:
Expand All @@ -126,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
Expand All @@ -140,8 +142,8 @@ jobs:
usesh: true
prepare: |
# Stock `erlang` pkg lags at OTP 26; use the versioned runtime
# package so we test on a supported OTP (27+).
pkg install -y erlang-runtime28 ${{ matrix.python_pkg }} cmake
# package so we test on a supported OTP (28+).
pkg install -y ${{ matrix.otp_pkg }} ${{ matrix.python_pkg }} cmake
# numpy package follows the py<noDot>-numpy convention.
# Non-fatal: not every FreeBSD pkg snapshot ships numpy for
# every Python flavor; the ML SUITE self-skips when numpy
Expand All @@ -152,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
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
28 changes: 28 additions & 0 deletions docs/decisions/0010-supported-otp-releases.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions docs/decisions/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
8 changes: 6 additions & 2 deletions docs/scalability.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{erl_opts, [debug_info]}.

{minimum_otp_vsn, "27"}.
{minimum_otp_vsn, "28"}.

{xref_checks, [
undefined_function_calls,
Expand Down Expand Up @@ -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">>
Expand Down Expand Up @@ -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">>
]}
]}
]}.
Loading