fix(EXT-7): bundle musl NIF for Linux Burrito releases and container - #163
Conversation
rustler_precompiled resolves the precompiled NIF target at compile time from the build host's system_architecture. Ubuntu runners report a glibc triplet, so the glibc mdex_native NIF was being bundled into Linux Burrito releases and the container image. The container runs Alpine (musl), and Burrito's own musl runtime is also musl-based, so the glibc NIF would fail to load at runtime on musl systems. Fix: pre-compile mdex_native with TARGET_ABI=musl before running mix release on each Linux target. mix release then sees mdex_native already compiled in _build/prod and skips it, picking up the musl .so. TARGET_ABI is scoped to just the mdex_native compile step because cc_precompiler (used by exqlite) also reads that env var but behaves incorrectly when only TARGET_ABI is set without TARGET_ARCH and TARGET_OS. Also add an Alpine/musl container smoke test after building the image to verify the musl NIF actually loads before publishing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add rustler_precompiled to the pre-compile commands: mix deps.compile only compiles the named deps (not their transitive deps), so mdex_native's compile-time dependency on RustlerPrecompiled must be listed explicitly. - Add -e LINEAR_CLI_DAEMON=false to the container smoke test: the image bakes in LINEAR_CLI_DAEMON=true, which causes the app to start as a daemon (ignoring the version arg and never exiting), timing out the step. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rework: fixed two bugs in the original commitWhat changed: Two correctness issues identified during self-review and fixed in the follow-up commit (
Trade-offs: None. Both are straight correctness fixes. |
The comment claimed cc_precompiler only activates its TARGET_ABI override when all three of TARGET_ARCH, TARGET_OS, TARGET_ABI are set. That is wrong: its current_target_from_env fires when any of the three is set. The step is actually safe because (a) env: blocks are step-scoped so mix release does not inherit TARGET_ABI, and (b) mix deps.compile only compiles the named deps so cc_precompiler/exqlite never run during this step. Flagged by code review. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 I have created a release *beep* *boop* --- ## [1.16.0](v1.15.2...v1.16.0) (2026-08-20) ### Features * **EXT-5:** show workflow status in compact and full issue listings ([#162](#162)) ([acf35e5](acf35e5)) ### Bug Fixes * **EXT-4:** handle GraphQL error and partial-data responses explicitly ([#160](#160)) ([31359ef](31359ef)) * **EXT-7:** bundle musl NIF for Linux Burrito releases and container ([#163](#163)) ([3172d4e](3172d4e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Summary
mdex_nativewithTARGET_ABI=muslbeforemix releaseon Linux targets so the musl precompiled NIF is bundled instead of the glibc one detected from Ubuntu runnerscontainerjob (which also builds on Ubuntu but runs on Alpine)podman run ... lc version) after building the image to verify the musl NIF loads before publishingBackground
rustler_precompiledresolves which precompiled NIF to bundle at compile time from:erlang.system_info(:system_architecture). Ubuntu runners report a glibc triplet, so the glibcmdex_nativeNIF 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_nativev0.2.7 ships bothx86_64-unknown-linux-gnuandx86_64-unknown-linux-musl(and aarch64 equivalents). SettingTARGET_ABI=muslbefore compilingmdex_nativeselects the musl variant.mix releasethen seesmdex_nativealready compiled in_build/prod/and skips recompilation, bundling the musl.so.TARGET_ABIis scoped to themix deps.compile mdex_nativestep rather than set globally onmix releasebecausecc_precompiler(used byexqlite) also reads that env var and produces a malformed triplet (--musl) whenTARGET_ARCH/TARGET_OSare 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
python3 yaml.safe_load)mix format --check-formattedcleanmix credo --strictcleanGitTestfailures (require a specific git remote state), 300/307 pass — unchanged from mainburrito-buildLinux legs pre-compile mdex_native with musl NIF then buildpodman run ... lc versionon Alpine and exits 0Closes EXT-7
🤖 Generated with Claude Code