Guppy ships a checksummed precompiled NIF for supported targets and falls back to source builds (GUPPY_NATIVE_FORCE_BUILD=1 forces them; the repo itself always source-builds via mise.toml). The native runtime is a single Rustler NIF built from native/guppy_nif; Rustler builds and copies it into priv/native/ during normal Mix compilation.
The current runtime baseline has production-hardening coverage for bounded native requests, stale queued request expiry, Rustler-monitored event-target cleanup, server restart cleanup/reopen behavior, clean-install NIF loading, and generated package smoke loading. Consumers download the published artifact by default; the packaged crate keeps the source-build fallback working.
Hex release runbook
Precompiled artifacts and checksums are required before the first hex cut; do not publish a source-build-only package. The order of operations:
- Make sure
scripts/check,scripts/clean_install_load_test,scripts/package_smoke, andmix hex.build --unpackare green. - Finalize the
CHANGELOG.mdentry and tagvX.Y.Z; pushing the tag runs.github/workflows/precompiled-nif.yml, which builds and attaches theaarch64-apple-darwinNIF artifact to the GitHub release. - Validate the artifact: with
GUPPY_NATIVE_FORCE_BUILDunset and a clean build,mix compilemust download and load it, andmix testmust pass. - Generate and commit the checksum file with
mix rustler_precompiled.download Guppy.Native.Nif --all --print(mix.exsalready packages anychecksum-*.exs). - Flip
Guppy.Native.Niffrom force-source-build to precompiled-by-default (keep an env var to force source builds), and re-run every gate in step 1 plus step 3. mix hex.publish.
Precompiled artifact plan
rustler_precompiled is now part of the NIF module, but Guppy still forces source builds by default because no release artifacts or checksum file are published yet. The remaining work is the artifact/release process:
- Keep the RustlerPrecompiled target list constrained to currently supported and CI-built targets.
- Build the NIF artifact with
.github/workflows/precompiled-nif.ymlfor every target inGuppy.Native.Nif's@precompiled_targetslist. - Add CI jobs that install/load the produced artifact and run at least
mix testbefore claiming precompiled support. - Generate and package the required
checksum-*.exsfile withmix rustler_precompiled.download Guppy.Native.Nif --all --printafter release artifacts exist;mix.exsincludes any generatedchecksum-*.exsfile when present while keeping source-only package smoke builds green before artifacts exist. - Document how release artifacts are produced, signed when needed, and attached.
- Flip the default from source-build to precompiled-download only after the advertised artifact set is built and load-tested.
- Keep Rustler source compilation as the fallback path.
- Keep
scripts/check,mix compile,scripts/clean_install_load_test, andscripts/package_smokegreen for source builds.
Initial target matrix
| Target | Status | Notes |
|---|---|---|
aarch64-apple-darwin | source-build supported; precompiled artifact workflow configured | primary local development target; only current RustlerPrecompiled target |
x86_64-apple-darwin | source-build/precompiled planned | needs CI/build-host confirmation |
aarch64-unknown-linux-gnu | source-build/precompiled planned | GPUI runtime behavior needs validation |
x86_64-unknown-linux-gnu | source-build/precompiled planned | GPUI runtime behavior needs validation |
x86_64-pc-windows-msvc | source-build/precompiled planned | GPUI/runtime bootstrap needs validation |
Do not claim a target as precompiled-supported until CI builds and load-tests the artifact. Do not add planned targets to Guppy.Native.Nif's @precompiled_targets or the precompiled artifact workflow until they are supported. Avoid publishing broader RustlerPrecompiled defaults such as musl, Windows GNU, ARMv7, or RISC-V unless GPUI support and CI load tests prove them viable.