All environment variables that affect miniextendrโ€™s build, configure, test, and lint processes.

๐Ÿ”—Build Context

VariablePurposeValuesDefault
NOT_CRANDev vs release modetrue/TRUE/1 = dev modeAuto-detected from monorepo presence
PREPARE_CRANCRAN release prep (highest precedence)true/TRUE/1 = release modeNot set

These control which build context configure resolves:

ContextTriggerBehavior
dev-monorepoMonorepo detected (or NOT_CRAN=true)[patch] paths, no vendoring
dev-detachedNo monorepo, no vendor artifactsGit/network deps directly
vendored-installVendor artifacts presentOffline build from vendored sources
prepare-cranPREPARE_CRAN=trueExplicit CRAN release prep

๐Ÿ”—Cargo & Rust

VariablePurposeDefault
MINIEXTENDR_FEATURESComma-separated cargo features to enableAll features except nonapi
CARGO_PROFILEBuild profile: dev or releaserelease
CARGO_TARGET_DIRArtifact directory (must be outside src/)${abs_top_srcdir}/rust-target
CARGO_BUILD_TARGETRust target triple for cross-compilationEmpty (native); auto-detected from autoconf host
RUST_TOOLCHAINToolchain selector (e.g., +stable, +nightly)Empty (system default)
ENV_RUSTFLAGSRust compiler flags, passed as RUSTFLAGS to cargoValue of RUSTFLAGS

All of the above are declared as AC_ARG_VAR in configure.ac and can be set when invoking ./configure:

cd rpkg && MINIEXTENDR_FEATURES="rayon,serde" CARGO_PROFILE=dev bash ./configure

๐Ÿ”—R Installation

VariablePurposeDefault
R_HOMEPath to R installationAuto-detected via R RHOME
R_LIBSR library path for package installationSystem default

๐Ÿ”—Lint

VariablePurposeDefault
MINIEXTENDR_LINTDisable lint: 0, false, no, or offEnabled

The lint runs automatically during cargo build/cargo check via build.rs. Disable with:

MINIEXTENDR_LINT=0 cargo check --manifest-path=rpkg/src/rust/Cargo.toml

๐Ÿ”—Runtime

VariablePurposeDefault
MINIEXTENDR_BACKTRACEShow full Rust backtraces on panic: 1 or true (case-insensitive)Suppressed
MINIEXTENDR_ENCODING_DEBUGPrint encoding snapshot at init (any value enables)Not set

MINIEXTENDR_BACKTRACE is read at panic time, not at package load, so it can be toggled during a session without restarting R. See Error Handling: Panic Hook and Backtraces.

MINIEXTENDR_ENCODING_DEBUG is only useful when embedding R via miniextendr-engine or on platforms where non-API encoding symbols are exported. See Encoding.

๐Ÿ”—minirextendr (Scaffolding)

VariablePurposeDefault
MINIEXTENDR_LOCAL_PATHPath to local miniextendr monorepo for tests/scaffoldingAuto-detected

๐Ÿ”—Bootstrap (Internal)

These are set automatically by bootstrap.R during R CMD INSTALL and shouldnโ€™t be set manually:

VariablePurpose
CC, CFLAGS, CXX, CXXFLAGS, CPPFLAGS, LDFLAGSC/C++ toolchain from R CMD config
_R_SHLIB_BUILD_OBJECTS_SYMBOL_TABLES_Symbol table generation (set to false)

๐Ÿ”—Cargo-Internal (Set Automatically)

These are set by cargo/build.rs and not meant for manual use:

VariablePurpose
CARGO_MANIFEST_DIRDirectory containing Cargo.toml
CARGO_CFG_TARGET_OSTarget OS (windows, macos, linux)
CARGO_CFG_TARGET_ENVTarget environment (msvc, gnu, musl)
CARGO_FEATURE_*One per enabled feature (uppercase + underscore)