Commit 3172d4e
fix(EXT-7): bundle musl NIF for Linux Burrito releases and container (#163)
## Summary
- Pre-compile `mdex_native` with `TARGET_ABI=musl` before `mix release`
on Linux targets so the musl precompiled NIF is bundled instead of the
glibc one detected from Ubuntu runners
- Same pre-compile step added to the `container` job (which also builds
on Ubuntu but runs on Alpine)
- Add an Alpine/musl container smoke test (`podman run ... lc version`)
after building the image to verify the musl NIF loads before publishing
## Background
`rustler_precompiled` resolves which precompiled NIF to bundle at
**compile time** from `:erlang.system_info(:system_architecture)`.
Ubuntu runners report a glibc triplet, so the glibc `mdex_native` NIF
was being baked into Linux Burrito releases and the container image. The
container runs Alpine 3.22 (musl), so the glibc NIF fails to load at
runtime.
`mdex_native` v0.2.7 ships both `x86_64-unknown-linux-gnu` and
`x86_64-unknown-linux-musl` (and aarch64 equivalents). Setting
`TARGET_ABI=musl` before compiling `mdex_native` selects the musl
variant. `mix release` then sees `mdex_native` already compiled in
`_build/prod/` and skips recompilation, bundling the musl `.so`.
`TARGET_ABI` is scoped to the `mix deps.compile mdex_native` step rather
than set globally on `mix release` because `cc_precompiler` (used by
`exqlite`) also reads that env var and produces a malformed triplet
(`--musl`) when `TARGET_ARCH`/`TARGET_OS` are absent.
CRY-40 (v1.5.1) fixed the cross-OS NIF mismatch (Linux NIF going into
macOS/Windows releases). This PR fixes the musl/glibc mismatch within
Linux.
## Test plan
- [x] YAML validates syntactically (`python3 yaml.safe_load`)
- [x] `mix format --check-formatted` clean
- [x] `mix credo --strict` clean
- [x] Tests: same 7 pre-existing `GitTest` failures (require a specific
git remote state), 300/307 pass — unchanged from main
- [ ] CI: `burrito-build` Linux legs pre-compile mdex_native with musl
NIF then build
- [ ] CI: container smoke test runs `podman run ... lc version` on
Alpine and exits 0
Closes EXT-7
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 31359ef commit 3172d4e
1 file changed
Lines changed: 52 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
107 | 131 | | |
108 | 132 | | |
109 | 133 | | |
| |||
316 | 340 | | |
317 | 341 | | |
318 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
319 | 354 | | |
320 | 355 | | |
321 | 356 | | |
| |||
325 | 360 | | |
326 | 361 | | |
327 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
328 | 379 | | |
329 | 380 | | |
330 | 381 | | |
| |||
0 commit comments