mix compile.forcola_shim (forcola v0.1.0)

Copy Markdown View Source

Puts a forcola_shim binary into priv/.

Resolution order:

  1. FORCOLA_BUILD=1 (or true) forces a local cargo build --release from native/forcola_shim. This is the escape hatch for targets the release workflow does not cover; it raises if cargo is not on PATH.
  2. If checksum-forcola_shim.exs exists (it ships in the hex package and never in the git checkout), the precompiled binary for the current target is downloaded from GitHub Releases and its SHA256 verified against that file. A mismatch fails the compile.
  3. If native/forcola_shim exists and cargo is on PATH (git checkout, CI), a debug cargo build runs and the binary is copied into priv/ when stale. This is the development path.
  4. Otherwise the compile fails with instructions.

Forcola.Shim.path/0 reads whatever binary ends up in priv/.