CRAN requires packages to build with no network access during R CMD INSTALL. miniextendr satisfies this by shipping all Rust dependencies inside inst/vendor.tar.xz, a self-contained offline build artifact bundled into the source tarball.

The full reference โ€” install-mode decision tree, lockfile shape, constraints, CI strategy โ€” lives at CRAN compatibility.

๐Ÿ”—Two install modes

There are exactly two install modes, selected automatically by configure:

ModeTriggered whenCargo behavior
Source installinst/vendor.tar.xz is absentCargo resolves deps normally. In monorepo dev, configure writes a [patch."git+url"] block pointing the workspace crates at sibling paths. Otherwise cargo follows the git URL.
Tarball installinst/vendor.tar.xz is presentConfigure unpacks the tarball, writes .cargo/config.toml with [source] redirected to vendored-sources, and cargo builds offline.

Thatโ€™s the whole decision tree. There is no NOT_CRAN, no PREPARE_CRAN, no FORCE_VENDOR, no auto-detected build-context enum โ€” just the file-existence test.

๐Ÿ”—CRAN release flow

just vendor             # 1. Regenerate Cargo.lock in tarball-shape, vendor
                        #    deps to rpkg/vendor/, compress to inst/vendor.tar.xz.
just r-cmd-build        # 2. R CMD build rpkg โ†’ miniextendr_X.Y.Z.tar.gz.
just r-cmd-check        # 3. R CMD check the built tarball (--as-cran).

Day-to-day commands (just rcmdinstall, just devtools-install, just devtools-test, just devtools-document, just devtools-load) do not depend on just vendor. They install via source mode, which needs no vendor tarball at all. Run just vendor only when producing a build artifact for CRAN.

inst/vendor.tar.xz is gitignored โ€” regenerated deterministically from Cargo.lock plus workspace sources. CI regenerates it before every R CMD check; release tooling regenerates it at version-bump time.

๐Ÿ”—Tooling

  • cargo-revendor is a standalone cargo subcommand that powers just vendor. It expands *.workspace = true inheritance via cargo package, vendors external deps via cargo vendor, and clears .cargo-checksum.json for offline install. Install with just revendor-install.
  • minirextendr scaffolds new miniextendr projects with the same configure / Makevars / vendoring shape as rpkg.

๐Ÿ”—See also

  • CRAN compatibility โ€” full reference (decision tree, lockfile shape, CI strategy, โ€œsymbols cleanupโ€ list).
  • R build system โ€” how R wires configure and Makevars together for compiled packages.
  • Environment variables โ€” all env vars the build honors (and which legacy ones are gone).

๐Ÿ”—Full reference

This page is a curated entry point. The โ€œSee alsoโ€ links above lead directly to the relevant manual pages for the exhaustive treatment, edge cases, and every feature switch.