| Key or variable | Meaning |
|---|---|
:source | The precompiled API URL. Default: https://compatibility.nerves-project.org/api/precompiled. https only (http on loopback). Config only. |
:except | Dependencies never installed precompiled, e.g. [:ash]. |
:content | Content origins (mirrors, CDNs) to fetch files and manifests from instead of the ones the signed batch names. https only (http on loopback). Config only. |
:root | A root.json to trust instead of the one this library ships. Config only. |
:home / PRECOMPILED_HOME | Cache and trust state dir. The config key beats the variable. Default: the user cache dir (:filename.basedir(:user_cache, "precompiled")). PRECOMPILED_HOME=~/.nerves/precompiled keeps using the pre-rename cache. |
:deadline_seconds | All network for one run (default 300); what is still waiting then compiles. Root and batch get 15 s together, connects 5 s. |
:root_check_seconds | How often the served root is checked for a rotation (default 3600; a batch that fails to verify checks it at once). |
:cache_max_mb | Cache size bound (default 4096), least recently used evicted, checked once a day. Trust state is never evicted. |
PRECOMPILED=0 | Off: installs nothing and removes earlier installs. |
PRECOMPILED_OFFLINE=1 | No network: the cached batch (while fresh) and cached files only. |
PRECOMPILED_CACERTS_PATH (or HEX_CACERTS_PATH) | A PEM CA bundle that replaces the OS store (TLS-intercepting proxies). Verification stays on; only the bundle's CAs are trusted. |
HTTPS_PROXY/https_proxy, HTTP_PROXY/http_proxy, NO_PROXY/no_proxy | Proxies, as Hex reads them. Credentials in the proxy URL are sent only to the proxy. NO_PROXY takes host names, domains (.corp.example), IP addresses and *; CIDR ranges are ignored. |
PRECOMPILED_DEBUG=1 | Also print each dependency that was not a candidate, and why. |
The keys go in config :precompiled, ...; Precompiled.Host.install/2
also takes :except and :home as options. :source, :root and
:content are project config only: no option or environment variable
sets them, because a source or mirror learns which dependencies you use
and a root decides whose builds run (see Trust). The old names (config :nerves_precompiled,
config :nerves, :precompiled, NERVES_PRECOMPILED*) are still read for
one release, when the new ones are unset.
Turning it off
PRECOMPILED=0(falseandnowork too) turns it off and removes the builds it installed, so Mix compiles them in that same run. Only build dirs this library wrote are removed, never one Mix compiled, and only in the_buildof the run's own env and target: a run onhostremoves host installs, never a device target's.mix precompiled.cleanremoves this_build's installs.--cachealso empties the download cache (files, manifests and source scans), from the same cache dir a run uses.:exceptkeeps listed dependencies compiled from source; an earlier install of one is removed.
Seeing what happened
Every candidate prints one line, then a summary:
precompiled: ash 3.36.0 HIT 4.1 MB
precompiled: nerves_pack 0.7.1 MISS built with nerves_ssh 1.3.3, project has 1.3.2
precompiled: 40 hit, 5 miss, 0 fail of 45 deps, 61.2 MB, 8.3 sA warm run whose installs the batch still vouches for prints nothing.
mix precompiled.statuslists what is installed in this_build, with the batch and manifest each came from._build/<env>/lib/.precompiled/report.json("format": 1) holds the last run that printed lines.- Each installed dependency carries
.mix/precompiled.json.