Downloads and verifies precompiled forcola_shim binaries.
The release workflow (.github/workflows/release.yml) builds the shim
for each supported target and attaches
forcola_shim-v<version>-<target>.tar.gz to the GitHub Release for
the tag. mix forcola.checksum fetches every tarball for the current
version, computes SHA256 digests locally, and writes
checksum-forcola_shim.exs; that file ships in the hex package (it is
gitignored in the repo).
At compile time the :forcola_shim Mix compiler calls install/2,
which detects the current target, downloads the matching tarball
(cached under the user cache dir), verifies its SHA256 against the
checksum file, and extracts the binary into priv/. Any checksum
mismatch is an error; nothing is installed from an unverified
tarball.
Summary
Functions
Release asset name for a version and target.
Name of the checksum file shipped in the hex package.
Downloads url over HTTPS with peer verification.
GitHub Release download URL for a version and target.
Fetches, verifies, and installs the shim binary into priv_dir.
Reads the checksum file: a map of artifact name to hex SHA256 digest.
Lowercase hex SHA256 digest of a binary.
Maps an Erlang :system_architecture string to a release target.
All targets the release workflow builds.
Verifies body against a lowercase hex SHA256 digest.
Functions
Release asset name for a version and target.
@spec checksum_file() :: String.t()
Name of the checksum file shipped in the hex package.
Downloads url over HTTPS with peer verification.
Follows redirects (GitHub release assets redirect to object storage).
GitHub Release download URL for a version and target.
Fetches, verifies, and installs the shim binary into priv_dir.
Returns the path to the installed binary. The tarball is cached under the user cache dir; a cached copy is used only if its checksum still matches, otherwise it is re-downloaded.
Reads the checksum file: a map of artifact name to hex SHA256 digest.
Lowercase hex SHA256 digest of a binary.
Maps an Erlang :system_architecture string to a release target.
Returns {:error, message} for architectures the release workflow
does not build; callers fall back to a local cargo build via
FORCOLA_BUILD=1.
@spec targets() :: [String.t()]
All targets the release workflow builds.
Verifies body against a lowercase hex SHA256 digest.