V4 musl parity: Linux_x86_musl and Linux_arm64_musl (4.0.0) - #4
Merged
Conversation
jonahbeckford
force-pushed
the
musl-parity-4.0.0
branch
6 times, most recently
from
August 3, 2026 18:38
08a4379 to
688fbb1
Compare
Linux x86 (32-bit) and arm64 hosts with a musl libc need ABIs distinct from their glibc forms, for the same reason Linux_x86_64_musl was introduced: fully static musl builds need their own distribution slot. + replicate the <features.h> / __GLIBC__ musl test in the __i386__ and __aarch64__ branches of the C header, hoisting the include so one test covers all the Linux arms + add Linux_x86_musl and Linux_arm64_musl to module V4 + degrade the new ABIs to Linux_x86 / Linux_arm64 in V1-V3; in V1 an x86 musl host then gets the pre-existing Result.error since V1 never had Linux_x86 + make C_conf.load use V4 so musl hosts read ABI-specific environment variables like CP_GMP_CC_DEFAULT_LINUX_X86_64_MUSL + delete the unused top-level t_abi in discover.ml Signed-off-by: Jonah Beckford <9566106-jonahbeckford@users.noreply.gitlab.com>
The workflow had rotted (macos-12 retired, actions/*-artifact@v3 disabled) and its actions were not on this repository's curated Actions allowlist, so every run failed at startup once Actions was enabled. It also had no musl coverage at all. Rebuild it as one workflow with four jobs: + c-header-probe: compile the C header on musl (Alpine) and glibc (Debian) for x86_64 / x86 / arm64 and assert DKML_ABI and its companion define. Uses only `docker run` (+ actions/checkout); arm64 emulation is registered with `docker run tonistiigi/binfmt` rather than a non-allowlisted setup-qemu action + ocaml-alpine-musl: the full dune-configurator -> c_abi.ml path on a real musl host, asserting Ok Linux_x86_64_musl + Cross-Platform-Action: FreeBSD 14.2 and OpenBSD 7.6 guests via cross-platform-actions v1.3.0 (SHA-pinned). Install ocaml + opam + git + ocamlfind from the BSD packages and use the packaged OCaml via ocaml-system after an opam update, so nothing is compiled from source in the emulated VM. `ocaml` reading a script on stdin exits 0 even on a toplevel error, so grep the output for the expected Ok <abi> rather than trusting the exit code + test-with-setup-ocaml: Windows/macOS/Linux glibc on ocaml/setup-ocaml (SHA-pinned, OCaml 4.14.x), replacing the former DkML MSVC/MSYS2 + manylinux reusable-workflow matrix whose actions are not allowlisted Triggers add pull_request and workflow_dispatch alongside push to main. Signed-off-by: Jonah Beckford <9566106-jonahbeckford@users.noreply.gitlab.com>
The markdown-link-check and shellcheck actions were referenced by floating tags (@v1, @master) that are not on the repository's curated Actions allowlist, so the workflow failed at startup once Actions was enabled. + pin gaurav-nelson/github-action-markdown-link-check to v1.0.17 (SHA) + pin ludeeus/action-shellcheck to v2.0.0 (SHA) + bump actions/checkout from @master to the allowlisted @v6 Signed-off-by: Jonah Beckford <9566106-jonahbeckford@users.noreply.gitlab.com>
`dune build @runtest @runmarkdown --auto-promote` An interface module V<n> ships in opam major version n: V4 belongs to 4.0.0, restoring the correspondence broken when the 3.3.0 tag shipped V4 under a 3.x version. 3.3.0 was never published to opam and is superseded by this release. Signed-off-by: Jonah Beckford <9566106-jonahbeckford@users.noreply.gitlab.com>
jonahbeckford
force-pushed
the
musl-parity-4.0.0
branch
from
August 3, 2026 19:29
688fbb1 to
804a565
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the
V4ABI enumeration with the two missing musl variants —Linux_x86_musl(32-bit x86) andLinux_arm64_musl(aarch64) — so musl hasparity with glibc across all three Linux architectures that already have a
glibc ABI, and releases it as 4.0.0.
Why 4.0.0 (not 3.4.0)
The
V4module first shipped in the3.3.0git tag, breaking this repo'sconvention that interface module
V<n>ships in opam major versionn(
V2↔2.0.0,V3↔3.0.0).3.3.0was never published to opam (opam has2.0.0, 3.0.0, 3.2.0), so
V4can be finalized in place and released as 4.0.0without breaking any opam consumer. The
3.3.0git tag is kept as history andannotated as superseded in
CHANGES.md.Changes
dkml_compiler_probe.h): the<features.h>/__GLIBC__musl test is hoisted to cover all Linux arms; the
__aarch64__and__i386__arms now split glibc vs musl (newDKML_ABI_linux_arm64_musl/DKML_ABI_linux_x86_muslmacros).discover.ml: newget_osinfoarms;adjust_pre_v4_abidegrades thenew ABIs to
Linux_arm64/Linux_x86in V1–V3 (matching the existingLinux_x86_64_musl→Linux_x86_64behavior). In V1 the degradedLinux_x86then hits the pre-existing
Result.error, since V1 never hadLinux_x86.The unused top-level
type t_abiis removed.C_conf.loadnow usesV4(wasV3): musl hosts read ABI-specific envvars like
CP_GMP_CC_DEFAULT_LINUX_X86_64_MUSL. glibc/Windows/macOS hostsare unchanged.
musl.yml(Alpine/Debian × x86_64/x86/arm64 header probe, plusa full OCaml build/test on Alpine musl x86_64).
test.ymlmodernized(retired
macos-12→ ubuntu QEMU BSD VMs, action pins bumped,pull_requesttrigger); the rottedsetup-dkmljobs are removed pendingre-integration with dkml-workflows v1+.
V4.t_abistays alphabetical, so the two insertions shift the ranks of laterconstructors. Anything that marshalled
V4.t_abivalues from a 3.3.0 buildshould be rebuilt. No opam release is affected.
Testing
Locally validated in Docker with the exact images
musl.ymluses — all threemusl ABIs and all three glibc ABIs report correctly (Alpine/Debian ×
amd64/386/arm64), and the full OCaml toolchain on Alpine musl reports
Ok Linux_x86_64_muslend to end. Windows localdune build/runtest/READMEregeneration green. GitHub Actions on this PR provides the authoritative run.
Known gap: Linux arm32 (
arm32v6/arm32v7) still has no musl variant.