Skip to content

Support Erlang/OTP up to 29 and modernize the build#12

Open
maennchen wants to merge 8 commits into
potatosalad:mainfrom
maennchen:main
Open

Support Erlang/OTP up to 29 and modernize the build#12
maennchen wants to merge 8 commits into
potatosalad:mainfrom
maennchen:main

Conversation

@maennchen

Copy link
Copy Markdown

Starting the libsodium application failed on OTP 29 with Error loading "libsodium_drv": "undefined symbol: erts_fprintf". Fixing that surfaced further incompatibilities with modern OTP and toolchains; this PR addresses them and extends the CI matrix to OTP 23–29.

Driver

  • Remove erts_fprintf (ERTS-internal, no longer exported by OTP 29); use plain fprintf(3) for stderr diagnostics.
  • Define _DEFAULT_SOURCE: with -std=c17, musl hides strnlen, and GCC 14 turns the implicit declaration into an error.

Test suite

  • Add whitespace between adjacent string literals in the pwhash_scrypt test vectors, rejected by erl_scan since OTP 27. Values unchanged.
  • Replace a bare catch expression (deprecated since OTP 28) with try ... catch ... end.

Build / CI

  • Update erlang.mk to efb0d04 and sync build.config with upstream; the old one predated core/beam-cache, leaving beam-cache-restore-* targets undefined and breaking test-build on fresh checkouts.
  • Test OTP 23–29 using the latest hexpm/erlang Alpine images, re-enabling OTP 24. Bump actions/checkout and actions/upload-artifact to v7.
  • Use ln -sf for the python symlink in the test image; newer Alpine already ships /usr/bin/python.
  • Set DO_NOT_UPDATE_CONFIG_SCRIPTS=1 so libsodium's autogen no longer downloads config.sub/config.guess from GNU Savannah, a failed download saves the error page as the script and breaks configure intermittently.

maennchen and others added 8 commits July 17, 2026 16:28
Also sync build.config with upstream: it predated erlang.mk's
core/beam-cache module, and without it the generated erlang.mk
referenced beam-cache-restore-app/-test without defining them,
breaking test-build on fresh checkouts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
erts_fprintf is an ERTS-internal symbol that is not part of the public
driver API. OTP releases up to 28 happened to export it from the
emulator binary, but OTP 29 no longer does, so loading the driver
failed with an undefined symbol error. Use plain fprintf(3) instead,
which is a drop-in replacement for the stderr diagnostics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Since OTP 27, erl_scan rejects adjacent string literals without
intervening whitespace ({error,{Line,erl_scan,string_concat}}), which
made file:consult/1 fail on these C-style concatenations copied from
the libsodium test vectors. Insert a space between the literals; the
concatenated values are unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The bare catch expression is deprecated since OTP 28 and emits a
compile-time warning. Use the equivalent try ... catch ... end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Update the matrix to the latest hexpm/erlang alpine images for each
OTP major, add 26 through 29, and re-enable 24 (the ssl breakage in
24.3.4.4 is long fixed). Bump checkout and upload-artifact to v7;
upload-artifact@v2-preview has been blocked by GitHub since 2025.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Newer Alpine images already ship /usr/bin/python with python3, so a
plain ln -s fails the docker build with 'File exists'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With -std=c17, musl's string.h hides the POSIX.1-2008 strnlen
declaration, and GCC 14 (Alpine 3.24) turns the resulting implicit
declaration into a hard error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
libsodium's autogen.sh fetches config.guess/config.sub from
git.savannah.gnu.org with curl -sL but no -f, so a server error (e.g.
502) is silently written into build-aux/config.sub and configure later
dies with 'cannot run /bin/sh ./build-aux/config.sub'. The scripts
autoreconf installs are recent enough for every platform we build on,
so opt out of the download via DO_NOT_UPDATE_CONFIG_SCRIPTS to keep
the build hermetic.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
maennchen added a commit to maennchen/erlang-jose that referenced this pull request Jul 17, 2026
libsodium's port driver references erts_fprintf, an ERTS-internal symbol
that OTP 29 no longer exports, so the driver fails to load and every CT
run is flooded with crash reports while the libsodium backend silently
falls back. Skip the test dependency on OTP 29 until
potatosalad/erlang-libsodium#12 is released; the
pure-Erlang and libdecaf backends keep covering those algorithms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
maennchen added a commit to maennchen/erlang-jose that referenced this pull request Jul 17, 2026
libsodium's port driver references erts_fprintf, an ERTS-internal symbol
that OTP 29 no longer exports, so the driver fails to load: mix test
aborts because the application cannot start, and CT floods every run
with crash reports while the libsodium backend silently falls back. Skip
the test dependency on OTP 29 until
potatosalad/erlang-libsodium#12 is released; the
pure-Erlang and libdecaf backends keep covering those algorithms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant