Skip to content

Declare rustler explicitly so mdex_native force-builds - #42

Merged
ddon merged 1 commit into
BeamLabEU:mainfrom
timujinne:upstream-fixes/rustler-declare
Aug 22, 2026
Merged

Declare rustler explicitly so mdex_native force-builds#42
ddon merged 1 commit into
BeamLabEU:mainfrom
timujinne:upstream-fixes/rustler-declare

Conversation

@timujinne

@timujinne timujinne commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

MDEX_NATIVE_BUILD=1 forces mdex_native to build its NIF from source when no precompiled build exists for the running OTP (28 in our case), which requires rustler itself, not just rustler_precompiled. mdex arrives here transitively through phoenix_kit; a clean checkout fails to compile without this declaration. Same declaration phoenix_kit's own mix.exs already carries.


One fix, six repositories. Every module that pulls mdex transitively through phoenix_kit needs the same one-line declaration, and each repository needs its own PR. Already merged: BeamLabEU/phoenix_kit_catalogue#77, BeamLabEU/phoenix_kit_billing#27. Still open: BeamLabEU/phoenix_kit_crm#25, BeamLabEU/phoenix_kit_warehouse#20, BeamLabEU/phoenix_kit_entities#35.

Scope. This makes this repository build from a clean checkout under MDEX_NATIVE_BUILD=1. It does not remove the need for a host application to declare rustler itself: optional dependencies of dependencies are never resolved, so whichever project is the root has to declare it.

MDEX_NATIVE_BUILD=1 in this environment forces mdex_native to build
its NIF from source (OTP 28 ships no precompiled build), which
requires rustler itself, not just rustler_precompiled. mdex arrives
here transitively through phoenix_kit; a clean checkout failed to
compile without this. Same declaration phoenix_kit's own mix.exs
already carries.
@timujinne

Copy link
Copy Markdown
Contributor Author

Ran the full suite on this branch tip: mix deps.get, mix compile under MIX_ENV=test, then mix test with the :integration half enabled against a real Postgres, with MDEX_NATIVE_BUILD=1 set under OTP 28 — the scenario this PR's rustler declaration targets. The declaration compiles and builds the native NIF cleanly. This module's config/test.exs already supports pointing at an existing database via PGDATABASE, so the integration half ran without any local workaround.

866 tests, 0 failures (1 skipped).

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.

2 participants