Skip to content

Commit 8bf5be7

Browse files
authored
Merge pull request #93 from benoitc/chore/otp-28-minimum
Require Erlang/OTP 28 or later
2 parents ccc1ca6 + 797f5b5 commit 8bf5be7

9 files changed

Lines changed: 75 additions & 30 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
include:
18-
# Linux - OTP 27 (minimum supported)
19-
- os: ubuntu-24.04
20-
otp: "27"
21-
python: "3.12"
22-
- os: ubuntu-24.04
23-
otp: "27"
24-
python: "3.13"
25-
- os: ubuntu-24.04
26-
otp: "27"
27-
python: "3.14"
28-
# Linux - OTP 28
18+
# Linux - OTP 28 (minimum supported)
2919
- os: ubuntu-24.04
3020
otp: "28"
3121
python: "3.12"
@@ -45,7 +35,8 @@ jobs:
4535
- os: ubuntu-24.04
4636
otp: "29"
4737
python: "3.14"
48-
# macOS (brew installs the latest OTP)
38+
# macOS (brew: the erlang formula is the latest OTP, erlang@28
39+
# the versioned one)
4940
- os: macos-15
5041
otp: "29"
5142
python: "3.12"
@@ -55,6 +46,10 @@ jobs:
5546
- os: macos-15
5647
otp: "29"
5748
python: "3.14"
49+
- os: macos-15
50+
otp: "28"
51+
python: "3.14"
52+
brew_erlang: erlang@28
5853

5954
steps:
6055
- name: Checkout
@@ -75,7 +70,10 @@ jobs:
7570
- name: Set up Erlang (macOS)
7671
if: startsWith(matrix.os, 'macos')
7772
run: |
78-
brew install erlang rebar3
73+
brew install ${{ matrix.brew_erlang || 'erlang' }} rebar3
74+
if [ "${{ matrix.brew_erlang }}" = "erlang@28" ]; then
75+
echo "$(brew --prefix erlang@28)/bin" >> "$GITHUB_PATH"
76+
fi
7977
8078
- name: Install numpy (for ML thread-affinity tests)
8179
run: |
@@ -117,7 +115,7 @@ jobs:
117115

118116
# FreeBSD test using cross-platform action
119117
test-freebsd:
120-
name: FreeBSD 14 / Python ${{ matrix.python }}
118+
name: FreeBSD 14 / OTP ${{ matrix.otp }} / Python ${{ matrix.python }}
121119
runs-on: ubuntu-24.04
122120

123121
strategy:
@@ -126,8 +124,12 @@ jobs:
126124
include:
127125
- python: "3.12"
128126
python_pkg: "python312"
127+
otp: "28"
128+
otp_pkg: "erlang-runtime28"
129129
- python: "3.13"
130130
python_pkg: "python313"
131+
otp: "29"
132+
otp_pkg: "erlang-runtime29"
131133

132134
steps:
133135
- name: Checkout
@@ -140,8 +142,8 @@ jobs:
140142
usesh: true
141143
prepare: |
142144
# Stock `erlang` pkg lags at OTP 26; use the versioned runtime
143-
# package so we test on a supported OTP (27+).
144-
pkg install -y erlang-runtime28 ${{ matrix.python_pkg }} cmake
145+
# package so we test on a supported OTP (28+).
146+
pkg install -y ${{ matrix.otp_pkg }} ${{ matrix.python_pkg }} cmake
145147
# numpy package follows the py<noDot>-numpy convention.
146148
# Non-fatal: not every FreeBSD pkg snapshot ships numpy for
147149
# every Python flavor; the ML SUITE self-skips when numpy
@@ -152,8 +154,9 @@ jobs:
152154
run: |
153155
# Set up environment
154156
export PYTHON_CONFIG=python${{ matrix.python }}-config
155-
# erlang-runtime28 installs outside the default PATH; add its bin dir.
156-
ERL_BIN="$(dirname "$(pkg info -l erlang-runtime28 | tr -d '[:blank:]' | grep -E '/bin/erl$' | grep -v 'erts-' | head -1)")"
157+
# The OTP runtime package installs outside the default PATH;
158+
# add its bin dir.
159+
ERL_BIN="$(dirname "$(pkg info -l ${{ matrix.otp_pkg }} | tr -d '[:blank:]' | grep -E '/bin/erl$' | grep -v 'erts-' | head -1)")"
157160
export PATH="$ERL_BIN:/usr/local/bin:$PATH"
158161
159162
# Verify versions

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ call Python, and Python calls back into Erlang. Python runs in contexts:
1111
`worker` (a thread per context on the main interpreter), `owngil` (a thread
1212
and a subinterpreter with its own GIL, Python 3.14 and later) and `isolated`
1313
(a child OS process). Isolated sessions give each session a fresh child
14-
started from a prepared template. Requires Erlang/OTP 27 or later, Python
14+
started from a prepared template. Requires Erlang/OTP 28 or later, Python
1515
3.12 or later with headers, CMake and a C compiler.
1616

1717
## First principle: a NIF bug takes down the node

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
only the variables named in `env`, and every child built with the same
3232
seed hashes strings and orders sets the same way.
3333

34+
### Changed
35+
36+
- **Erlang/OTP 28 or later is required** - OTP 27 is no longer supported
37+
and rebar3 refuses to build on it; stay on 5.0.x if you need OTP 27.
38+
From now on the two latest OTP releases are supported, and CI tests
39+
OTP 28 and 29 on Linux, macOS and FreeBSD.
40+
3441
### Fixed
3542

3643
- On an owngil context, the process-local environment of an Erlang process

‎CONTRIBUTING.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ name.
7575

7676
## Build
7777

78-
You need OTP 27 or later, Python 3.12 or later with headers, CMake and a C
78+
You need OTP 28 or later, Python 3.12 or later with headers, CMake and a C
7979
compiler.
8080

8181
```sh
@@ -196,11 +196,11 @@ rules were adopted are listed in that rule's `ignore`; a new module follows
196196
every rule, and a module comes off a list when it is reworked, never onto
197197
one to make a change pass.
198198

199-
CI runs the matrix in `.github/workflows/ci.yml`: OTP 27 to 29 with Python
200-
3.12 to 3.14 on Ubuntu and macOS, FreeBSD 14 through `vmactions/freebsd-vm`,
201-
free-threaded 3.13t, ASan, the lint job (formatting, Elvis, xref, dialyzer,
202-
code map) and the documentation build. A pull request is merged when all of
203-
them are green.
199+
CI runs the matrix in `.github/workflows/ci.yml`: OTP 28 and 29 with Python
200+
3.12 to 3.14 on Ubuntu and macOS, FreeBSD 14 on OTP 28 and 29 through
201+
`vmactions/freebsd-vm`, free-threaded 3.13t, ASan, the lint job (formatting,
202+
Elvis, xref, dialyzer, code map) and the documentation build. A pull request
203+
is merged when all of them are green.
204204

205205
## Recipes
206206

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Key features:
3737

3838
## Requirements
3939

40-
- Erlang/OTP 27+ (tested on OTP 27, 28, and 29)
40+
- Erlang/OTP 28 or later (tested on OTP 28 and 29)
4141
- Python 3.12+ (3.13+ for free-threading)
4242
- C compiler (gcc, clang)
4343

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 0010: The two latest OTP releases are supported
2+
3+
Since 5.1.0. Code: `rebar.config` (`minimum_otp_vsn`),
4+
`.github/workflows/ci.yml`.
5+
6+
## Situation
7+
8+
The floor went up to OTP 28 in 3.1.0 and came back down to 27 in 3.1.1,
9+
because nothing in the code needed 28. Nothing stops it from moving again
10+
the next time someone asks. OTP itself supports its last three releases:
11+
it still patches 27 until OTP 30 ships, so 27 is narrower than OTP's own
12+
window, but CI cannot keep testing three releases for nothing.
13+
14+
## Decision
15+
16+
erlang_python supports the two latest OTP releases, with no upper bound.
17+
When a new release ships, CI adds its rows and the next minor release
18+
raises the floor to the release before it. `minimum_otp_vsn` in
19+
`rebar.config` is the check: rebar3 refuses to build on an older release,
20+
so nobody runs a combination CI no longer tests. There is no source guard;
21+
without the CI row the older release would be untested, not broken.
22+
23+
## Consequences
24+
25+
- A user on the oldest release OTP still patches stays on the previous
26+
minor release (5.0.x for OTP 27).
27+
- Code may use features of the floor release without a fallback, once CI
28+
covers it on every OS in the matrix.

‎docs/decisions/overview.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ what was decided, what it costs, and where the code is.
1717
| [0007](0007-remove-legacy-execution-paths.md) | One execution path per mode; the legacy API is removed | 5.0.0 |
1818
| [0008](0008-pipe-io-rules.md) | Pipe I/O is non-blocking, deadlined and waited with poll | 3.1.0, 5.0.0 |
1919
| [0009](0009-isolated-sessions.md) | Sessions fork from a prepared zygote | 5.1.0 |
20+
| [0010](0010-supported-otp-releases.md) | The two latest OTP releases are supported | 5.1.0 |

‎docs/scalability.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,12 @@ OTP releases still help for free:
620620
- **Consistent map iteration order** is now guaranteed across map operations in
621621
OTP 29. The router and state modules do not depend on iteration order, so this
622622
changes nothing here, but it removes a class of subtle bugs if you build on top.
623-
- **Building the NIF stays the same** across OTP 28/29 (NIF API 2.18); no version
624-
guards are needed in `c_src`.
623+
- **Building the NIF stays the same** on OTP 28 and 29: the NIF uses NIF
624+
API 2.17, which OTP 28 provides; OTP 29's 2.18 only adds calls the code
625+
does not use, so `c_src` needs no version guards.
626+
- **Cheaper FD re-arming** on OTP 28 and later: a descriptor the event loop
627+
re-arms for reading after each event stays in a dedicated pollset, so the
628+
reselect path does not re-insert it each time.
625629

626630
For doc-example testing, OTP 29 ships `ct_doctest`. This project keeps its own
627631
`scripts/lint_doc_snippets.escript` because that linter also validates the Python

‎rebar.config‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{erl_opts, [debug_info]}.
22

3-
{minimum_otp_vsn, "27"}.
3+
{minimum_otp_vsn, "28"}.
44

55
{xref_checks, [
66
undefined_function_calls,
@@ -119,6 +119,7 @@
119119
<<"docs/decisions/0007-remove-legacy-execution-paths.md">>,
120120
<<"docs/decisions/0008-pipe-io-rules.md">>,
121121
<<"docs/decisions/0009-isolated-sessions.md">>,
122+
<<"docs/decisions/0010-supported-otp-releases.md">>,
122123
<<"docs/preload.md">>,
123124
<<"docs/owngil_internals.md">>,
124125
<<"docs/event_loop_architecture.md">>
@@ -175,7 +176,8 @@
175176
<<"docs/decisions/0006-shared-memory-over-iommap.md">>,
176177
<<"docs/decisions/0007-remove-legacy-execution-paths.md">>,
177178
<<"docs/decisions/0008-pipe-io-rules.md">>,
178-
<<"docs/decisions/0009-isolated-sessions.md">>
179+
<<"docs/decisions/0009-isolated-sessions.md">>,
180+
<<"docs/decisions/0010-supported-otp-releases.md">>
179181
]}
180182
]}
181183
]}.

0 commit comments

Comments
 (0)