The FFI manifest
Julia never parses Rust source. Signatures, struct layouts and generic parameters come from the FFI manifest produced by the rustcall-extract CLI (deps/rustcall_extract), which shares its syn-based core (deps/rustcall_julia_core) with the rustcall_julia_macros proc-macro.
Items disabled by #[cfg(...)] are dropped from manifests and expanded sources: the extractor evaluates the predicates against rustc --print cfg (passed as --cfg-file). Direct rustc builds query it with the real compilation flags (cfg = :strict); Cargo projects RustCall generates itself (// cargo-deps: blocks) evaluate the same way against Cargo's effective configuration, obtained from a probe crate (cfg = :cargo). Only an external crate (@rust_crate), whose features and build script RustCall does not control, decides target predicates alone (cfg = :lenient, --cfg-lenient). The predicate of every reported item is recorded in its cfg field.
Extractor interface (src/macros/manifest.jl)
RustCall.MANIFEST_SCHEMA_VERSION — Constant
MANIFEST_SCHEMA_VERSIONThe manifest compatibility identifier this RustCall.jl accepts: the MAJOR.MINOR of its own release, read from Project.toml — "0.9" for every v0.9.x. rustcall_julia_core::manifest::SCHEMA_VERSION is the same string, kept as a literal in Rust because the crates' crates.io versions move independently of the release, and test/test_schema_version.jl keeps the two from drifting by comparing the extractor's schema-version output with it (#372).
What that buys, and what it costs:
- A patch release never changes the identifier. An installed extractor and every cached artifact stay valid across it — the identifier is part of
toolchain_fingerprint, so this is what decides whether the cache survives. - A minor release always changes it. Every consumer rebuilds the extractor once (
Pkg.build("RustCall")), every cache key moves, and the manifest may change shape freely inside that release without a per-edit bump. A manifest change that has to ship in a patch release therefore cannot break compatibility; it must be additive and optional. - A pre-v0.4 extractor reports the integer
13, which never equals a release string, so the mismatch below names both and says to rebuild.
Through v0.3.x this was that integer, bumped on every manifest edit; the history is kept here because the fields it introduced are all still present (2: string ABI columns abi, return_abi and the string helper flags, #242; 3: #[julia] is additive, so symbol differs from name for every wrapped function and method, #279; 4: one vocabulary for the type contract — Function.return_abi, Field.abi and Method.returns_boxed_struct, #276; 5: the PyO3 crate scan — a py_* attribute origin, vis, skip_reason and the py_result return kind, #275; 6: Result/Option on struct methods — a method wrapper now returns CResult_<Struct>_<method> / COption_<Struct>_<method> where it used to return the type as written, and ok_abi/err_abi/inner_abi say whether a payload travels as an owned string buffer, #268 — bumped together with the PyO3 wrapper crate, since neither shipped on its own: a py_* entry can now be exported with a return_abi, a lowered PyResult reports the i32 code in err_type, and the skip-reason vocabulary gains the four the generator uses, #275 Phase 2. Additive within 6: Method.attribute, the attribute of the impl block a method came from — serialized only when there is one — so the dual-binding attribute deprecated by #275 Phase 3 was reported even on a #[julia] struct; 7, two changes landing in one breaking release: (a) that attribute is removed, and with it its value of the attribute origin — a schema-6 consumer could still meet that origin and bind the item under its as-written, non-lowered signature, #312; (b) module-qualified symbols, #300 — Function.ffi_name / Struct.ffi_name carry the stem every exported symbol hangs off (a::run -> a__run), symbol and the field accessors are qualified by it, and crate mode records module_path for #[julia] items; a schema-6 consumer would derive <Struct>_free / <owner>_free_rust_string from the bare name). Schema 8 adds Method.string_owner, the stem a method's string buffers hang off: since #342 one inline manifest can hold both shapes — a method sharing its struct's buffers and a cross-module method carrying its own — so a schema-7 consumer, which derives the owner from the flavour, would release a cross-module method's String through a symbol the library does not export, and leak it. The version is what makes such a consumer refuse the manifest rather than get the owner wrong (#342 review). Schema 9 adds the externally callable re-export path used for items defined behind private modules (#303). Schema 10 adds the vec field ABI, its vec_element, and its allocator-matched free_symbol; a schema-9 consumer would call the returned owned buffer as a Rust Vec<T> value and could not release it (#303). Schema 11 widens the PyResult ABI: String / &str success payloads use ok_abi to select an owned buffer, and PyResult<Self> carries an owned class pointer; a schema-10 consumer would decode either aggregate with the wrong slot type (#303). Schema 12 records PyO3 class object shape and callable defaults so the wrapper can select Python-owned dispatch. Schema 13 adds the wrapper's authoritative python_owned_handle decision: a consumer that re-infers it after filtering unsupported methods can unload an image whose drain thread is still running (#371). v0.4.0 replaced the integer with the release identifier (#372).
RustCall.PYO3_ATTRIBUTE_ORIGINS — Constant
PYO3_ATTRIBUTE_ORIGINSManifest attribute values produced by the PyO3 scan of #275.
RustCall.RELEASE_FORMAT_IDENTIFIER — Constant
RELEASE_FORMAT_IDENTIFIERThe MAJOR.MINOR of this release, read from Project.toml when the package is loaded — the one identifier every versioned format RustCall emits is named by: the manifest schema (MANIFEST_SCHEMA_VERSION) and the bindings-file format (BINDINGS_FORMAT_VERSION, #489). Both are this value, so a format cannot move without the release moving with it.
RustCall.RUSTCALL_ATTRIBUTE_ORIGINS — Constant
RUSTCALL_ATTRIBUTE_ORIGINSManifest attribute values that come from a RustCall attribute, i.e. the functions that get a Julia wrapper today. Since schema 5 the column doubles as the origin of the entry and can also name a PyO3 one (py_function, py_class, py_methods, py_module), which @rust_crate reports but does not wrap (#275).
RustCall.SPECIALIZATION_RECORD_SCHEMA — Constant
SPECIALIZATION_RECORD_SCHEMAVersion of the sidecar record save_specialization_record writes next to a cached monomorphization (<artifact key>.spec.toml in get_metadata_dir()).
A record older or newer than this reads as no record at all, so the only consequence of a format change is that the extractor and rustc run once more. Bump it whenever the meaning of a field changes.
RustCall._TOOLCHAIN_COMPILER_UNIDENTIFIED — Constant
_TOOLCHAIN_COMPILER_UNIDENTIFIEDPlaceholder recorded in toolchain_fingerprint when no rustc/cargo can be identified. Deliberately not a version string, and never "unknown": nothing compiled can carry it, because every compile path resolves the compiler through artifact_compiler_identity, which raises instead (#252).
RustCall.ExpandedInline — Type
ExpandedInlineResult of expanding an inline rust""" block: the transformed source that goes to rustc and the manifest describing it.
RustCall.ExtractorError — Type
ExtractorError <: ExceptionRaised when the rustcall-extract CLI is missing, fails, or produces a manifest with an unsupported schema version.
RustCall.SpecializationRecord — Type
SpecializationRecordWhat an earlier session learned about one compiled monomorphization artifact: the cache key of the library that holds it (not necessarily the key the record itself is filed under — a batched build files several records against one library) and, per member, the registered generic name and the SpecializedFunction the extractor produced for it.
SpecializedFunction.source is not persisted: the record exists precisely so that the source never has to be produced again. It reads back as "".
RustCall.SpecializedFunction — Type
SpecializedFunctionResult of instantiating a generic function via rustcall-extract specialize.
RustCall.WrapperCrateSource — Type
WrapperCrateSourceThe src/lib.rs of a generated PyO3 wrapper crate and the manifest describing what it exports (#275 Phase 2).
manifest is not the scan that went in: every emitted item is exported with its return_abi filled in, and every item the generator refused carries a skip_reason from the unsupported_arg / unsupported_return / py_result_payload / cfg_undecided vocabulary. Binding the wrapper from this manifest is what keeps the Julia definitions and the exported symbols from drifting apart.
RustCall._cargo_build_env — Method
_cargo_build_env(snapshot::AbstractString) -> Dict{String, String}The process environment with the Cargo/RUSTFLAGS settings replaced by those recorded in snapshot (a _cargo_cfg_env_key text): variables absent from the snapshot are removed, recorded ones restored. Used to build a // cargo-deps: block under the configuration its wrappers were generated for.
RustCall._cargo_build_env_for — Method
_cargo_build_env_for(cargo_env) -> (env, key)The environment a Cargo-backed block is built under and the snapshot text that identifies it. cargo_env === nothing means no snapshot was recorded (a reload of a block stored by an older RustCall): build under the current environment. A String is the snapshot recorded at macro-expansion time and is authoritative even when empty: "" means no tracked Cargo variable was set then, so any RUSTFLAGS / profile override present now is cleared rather than inherited — the wrappers were generated for the configuration without it.
RustCall._cargo_cfg_text — Function
_cargo_cfg_text() -> Stringrustc --print cfg as Cargo runs rustc for the release builds RustCall performs: a dependency-free probe crate with the same [profile.release] is built once per session (and per Cargo/RUSTFLAGS environment) with cargo rustc --release --lib -- --print cfg, so debug_assertions, panic, overflow_checks and target_* match the real Cargo build. Empty when cargo is unavailable or the probe fails.
RustCall._cargo_config_digest — Function
_cargo_config_digest(env = ENV; dir = nothing) -> StringDigest of the effective Cargo configuration, or "absent" when there is none: the file can set [build] rustflags and friends, which the cfg probe observes and which change what is produced, so its content belongs in the environment snapshot — the same CARGO_HOME with an edited config is a different configuration.
Two sources, in Cargo's own order:
- the project-local chain, when
dirnames the directory a build runs in:<dir>/.cargo/config.toml, then the same file in every ancestor directory, as Cargo searches it (#278, deferred from #272); - the Cargo home file (
$CARGO_HOME/config.toml, falling back toconfig;~/.cargowhenCARGO_HOMEis unset).
Only the depth of a project-local file and its content reach the digest, never its absolute path, so moving a checkout does not invalidate anything. With dir = nothing (the default, used by _cargo_cfg_env_key, which runs before any project directory exists) only the home file is considered.
RustCall._cargo_config_files — Function
_cargo_config_files(env = ENV; dir = nothing) -> Vector{String}The Cargo configuration files that are in effect for a build under dir, in the order _cargo_config_digest reads them: the nearest .cargo/config.toml (or .cargo/config) of dir and each ancestor, then CARGO_HOME's.
The same files, so a caller that must track them cannot drift from the digest that decides the artifact key. A generated crate module declares them as precompile dependencies (#339 review): they can change the compiler flags and therefore the binary, without any file of the crate changing.
RustCall._cargo_probe_profile — Method
_cargo_probe_profile() -> StringThe [profile.release] section RustCall writes into every Cargo project it generates (// cargo-deps: blocks, @rust_crate wrapper crates).
RustCall._cfg_file_args — Method
_cfg_file_args(cfg; cfg_text = _cfg_snapshot(cfg)) -> Vector{String}--cfg-file FILE [--cfg-lenient] for the extractor, so #[cfg]-disabled items are dropped from manifests and expanded sources (see [_cfg_mode]). The file holds cfg_text and is written once per distinct text. Empty for :none, or when rustc is unavailable (empty text).
RustCall._cfg_mode — Method
_cfg_mode(cfg) -> SymbolNormalize the cfg keyword: :strict (direct rustc builds: the full configuration of the actual compiler invocation), :cargo (a full evaluation of Cargo's effective configuration: for the projects RustCall generates for // cargo-deps: blocks the text is _cargo_cfg_text — RustCall writes that project itself, so it has no build script and declares no features and the probe is authoritative — and for an external crate it is the text its caller probed from the crate's own build, _crate_build_cfg_text or _wrapper_probe_cfg_text), :lenient (scan_crate's default for an external crate whose build configuration is not known: only target predicates are decided, against _cargo_cfg_text unless a cfg_text is passed) or :none (report everything, used for the platform-independent golden corpus). true/false map to :strict/:none.
RustCall._cfg_rustc_flags — Function
_cfg_rustc_flags(compiler = get_default_compiler()) -> Vector{String}The rustc flags that decide #[cfg] predicates for direct rustc builds: the same target and codegen options compile_rust_to_shared_lib passes, so debug_assertions, panic = "..." and target_* agree with the library that is actually built.
The panic flag comes from inline_rustc_policy() — the same policy the compile path reads — rather than being written out again here. When the two disagreed, the probe said panic = "abort" while the build unwound, so a #[cfg(panic = "unwind")] item was pruned from the manifest and never reported even though rustc compiled it, and a #[cfg(panic = "abort")] item was reported and then did not exist (#244, #277 Phase B).
RustCall._cfg_snapshot — Method
_cfg_snapshot(cfg) -> StringThe cfg text (rustc --print cfg under the current default compiler's flags) that expansion under cfg uses; empty for :none. The rust string macro captures it at macro-expansion time and hands the same snapshot to the run-time compile step, so the Julia wrappers emitted by the macro and the source compiled later are derived from one configuration even if set_default_compiler ran in between.
RustCall._ffi_name_of — Method
_ffi_name_of(entry) -> StringThe ffi_name of a manifest function or struct entry (schema 7, #300): the stem every exported symbol of the item hangs off. A schema-7 manifest always carries it; the fallback to name is for entries built by hand in tests.
RustCall._is_handle_abi — Method
_is_handle_abi(abi) -> BoolWhether an argument borrows a #[julia] struct (Arg.abi "handle" / "handle_mut", #565); _is_mut_handle_abi for the mutable borrow.
RustCall._manifest_arg_handles — Method
_manifest_arg_handles(args, handles) -> Vector{Union{Nothing, RustHandleArg}}The borrowed struct of each argument (#565): its entry in handles, or nothing — for an argument that borrows none, and for a handle naming no Rust-owned struct of the manifest, which the argument plan then passes as it always did.
RustCall._manifest_handle_table — Method
_manifest_handle_table(manifest) -> Dict{String, RustHandleArg}Every struct of the manifest by ffi_name, as an argument borrowing it is described (#565). Read once per conversion.
RustCall._manifest_py_shape — Method
_manifest_py_shape(entry, key) -> Union{Nothing, PyO3Shape}The PyO3-host shape the extractor recorded under key (py_shape of an argument or field, py_return of a function or method), or nothing when it recorded none: a #[julia] item, or a manifest from an extractor that predates the field (additive within schema 0.7; PR #525 review).
RustCall._reset_extractor_state! — Method
_reset_extractor_state!()Forget the cached extractor path/digest and fingerprint (used by tests after rebuilding or swapping the extractor).
RustCall._rust_sources_digest — Method
_rust_sources_digest(dirs...) -> StringSHA-256 over the src/*.rs and Cargo.toml files of the given crate directories, sorted by path. Used so that editing rustcall_julia_macros or rustcall_julia_core invalidates artifacts built through Cargo.
RustCall._rustc_cfg_text — Function
_rustc_cfg_text(flags = _cfg_rustc_flags()) -> StringOutput of rustc --print cfg under flags (cached per session and flag set). Empty when rustc is unavailable; the extractor then treats every item as active, which is the pre-#264 behaviour.
RustCall._scan_inputs — Method
_scan_inputs(files, crate_root) -> Vector{String}What a crate-mode scan reads: the module tree below crate_root when there is one (--crate-root, which the extractor does not accept FILE arguments with), otherwise every file, each as its own root.
RustCall._schema_mismatch_message — Method
_schema_mismatch_message(what, produced) -> StringThe refusal for a manifest whose schema_version is not this release's. An integer is what a pre-v0.4 extractor writes, and the message says so rather than comparing a number with a release.
RustCall.constraints_from_strings — Method
constraints_from_strings(bounds::Dict{Symbol, String}) -> Dict{Symbol, TypeConstraints}Convert Dict(:T => "Copy + Add<Output = T>") style bounds to TypeConstraints. The strings are parsed by the Rust-side parser: they are placed on a synthetic generic function and read back from its manifest.
RustCall.expand_inline — Method
expand_inline(code::String) -> ExpandedInlineExpand #[julia] items of an inline block ahead of rustc and return the manifest. Results are memoized per source text so macro expansion and the later compile step spawn the extractor only once.
cfg selects how #[cfg(...)] predicates are evaluated (see [_cfg_mode]): :strict (default) drops every item the direct rustc build would not compile, :cargo evaluates against Cargo's configuration (blocks built by Cargo), :lenient decides only target predicates, and :none keeps everything (golden corpus comparison). cfg_text is the cfg snapshot to evaluate against (default: the current compiler's, see [_cfg_snapshot]); the memo key is (code, mode, digest(cfg_text)).
RustCall.extract_manifest — Method
extract_manifest(code::String; mode::String) -> DictRun the extractor over a single source string.
RustCall.extract_manifest — Method
extract_manifest(files::Vector{String}; mode::String, skip_unparsable=false,
crate_root=nothing) -> DictRun the extractor over source files (mode is "inline" or "crate"). With skip_unparsable, files that are not complete Rust modules (for example include!("table.rs") fragments) are skipped with a warning instead of failing.
crate_root (crate mode only) names the crate's root source file, usually src/lib.rs. The extractor then scans the crate by following its module tree from there — recording each item's real module_path, whether every enclosing mod is pub (#275), and marrying a #[julia] impl block to a struct declared in another file (#315) — instead of treating every file as a root. The tree is the file list then: files is not passed on, because a file no mod reaches is not compiled by rustc and exports nothing. The walk follows a literal include!("api.rs") as well, since that file's items are compiled into the including module (#315 review) — and the out-of-line mod declarations inside such a fragment, resolved against the fragment's own directory the way rustc resolves them (#343). An include whose path is not a literal, or that holds a fragment rather than items, is left to the compiler.
RustCall.extractor_digest — Method
extractor_digest() -> StringSHA-256 of the extractor binary's bytes. Not part of a cache key on its own since #372: a patch release rebuilds the binary from unchanged sources and these bytes move with it, against the promise that a patch keeps the cache. extractor_source_digest is what every key folds in; this digest is its fallback identity (binary:<sha256>) for a selected binary without a trusted identity record, and a diagnostic otherwise.
RustCall.extractor_path — Method
extractor_path() -> StringPath to the rustcall-extract binary. Honors the RUSTCALL_EXTRACT environment variable, otherwise uses the binary built by Pkg.build("RustCall"), whose location native_product_candidates(:extractor) decides (#258).
RustCall.extractor_source_digest — Method
extractor_source_digest() -> StringHow a cache key identifies the selected extractor (#372, #409): the source digest deps/build.jl computed from Cargo's own view of the build and stored beside the binary (EXTRACTOR_IDENTITY_FILENAME, write_extractor_identity!), trusted only while the binary still has the SHA-256 the record names and only when that build was one the identity describes (a plain build of this tree's own layout: the closed rule of #413). Any other binary — one RUSTCALL_EXTRACT points at, one built from another layout or under flags, a wrapper or a source replacement, one whose record is missing or stale — is identified by its bytes (binary:<sha256>, extractor_digest): exact for that executable, and a namespace a source digest cannot collide with.
Not by the binary's bytes alone, which a patch release changes (-C metadata folds the crate version in) although nothing it emits did; not by this checkout's sources, which describe the tree and not the executable that runs; and no longer by anything the binary says about itself — a build script can enumerate the manifests but not what Cargo honours beyond them.
RustCall.load_specialization_record — Method
load_specialization_record(cache_key) -> Union{SpecializationRecord, Nothing}The record filed under cache_key, or nothing when there is none, it is unreadable, or it was written by another format version. Never throws: a damaged record is a cache miss, and a cache miss only costs a rebuild.
"Damaged" includes a file that parses as TOML but says something a record cannot mean — arg_types = [1], a string where a list belongs. Every field is checked for its type rather than converted and hoped for, because the callers in src/macros/generics.jl treat this as a lookup: a throw here would abort a monomorphization that the cache exists only to speed up (#254 review).
RustCall.manifest_constraints — Method
manifest_constraints(entry) -> Dict{Symbol, TypeConstraints}Trait bounds recorded for a manifest function or struct entry.
RustCall.manifest_function_signatures — Method
manifest_function_signatures(manifest; only_attributed=true, origins=RUSTCALL_ATTRIBUTE_ORIGINS) -> Vector{RustFunctionSignature}Signatures of the free functions in a manifest. With only_attributed, only functions whose attribute origin is in origins are returned — by default the #[julia] ones that get Julia wrappers. Pass origins = PYO3_ATTRIBUTE_ORIGINS for the PyO3-scanned items instead (#275).
RustCall.manifest_struct_infos — Method
manifest_struct_infos(manifest; origins=nothing) -> Vector{RustStructInfo}Struct descriptions of a manifest, in the shape the Julia emitters consume.
origins filters on the attribute column: the default keeps everything a RustCall attribute produced (julia, derive_julia_struct) and drops the #[pyclass] entries the PyO3 scan adds, because nothing generates Julia types for them yet (#275). Pass PYO3_ATTRIBUTE_ORIGINS to get exactly those, or an empty tuple for no filtering at all.
RustCall.manifest_type_params — Method
manifest_type_params(entry) -> Vector{String}Names of the type parameters recorded for a manifest function or struct entry.
RustCall.save_specialization_record — Method
save_specialization_record(cache_key, record)Write record for cache_key atomically (temp file plus rename), so a reader never sees a half-written record. Called under CACHE_LOCK, like every other cache write.
RustCall.specialize_generic — Method
specialize_generic(source, fn_name, bindings, new_name) -> SpecializedFunctionInstantiate generic function fn_name found in source with the given param => rust_type bindings under the name new_name. The returned source contains the original items plus the exported specialized function.
RustCall.specialize_generic_group — Method
specialize_generic_group(source, specs) -> (source, functions)Instantiate several generic wrappers into one source file. specs is a vector of named tuples (fn, bindings, new_name), where bindings is the same Pair{String,String} vector accepted by specialize_generic. This is used by generic structs so constructor, methods, accessors, and destructor share one cdylib and therefore one allocator.
RustCall.toolchain_fingerprint — Method
toolchain_fingerprint() -> StringFingerprint of everything that influences generated code besides the user's source. The lines hashed are _toolchain_fingerprint_inputs(), so a test can see them:
schema=— the manifest schema identifier;extractor=— the identity of the selected extractor (extractor_source_digest);sources=— the sources ofrustcall_julia_core,rustcall_julia_macrosandrustcall_julia_macros_implin this tree, with each crate's[package] versionleft out (_identity_file_bytes), because a user's#[julia]build compiles them from here;compiler=— the compiler that actually runs (artifact_compiler_identity);target=— the host target (Sys.MACHINE);cfg=— a digest ofrustc --print cfgunder the default compiler's flags.
Included in all cache keys.
What identifies the extractor (#372, #409, #417)
Through v0.3.x the extractor entered as a digest of its executable. A patch release bumps rustcall_extract's package version, and Cargo folds the version into -C metadata, so the same sources produce a byte-different binary — every cache key would have moved on a release that promises to keep them. The extractor therefore enters as the source digest deps/build.jl recorded beside the binary it built (extractor_source_digest), trusted only while that binary is unchanged and was a plain build of this tree's layout; any other binary — including whatever RUSTCALL_EXTRACT names without such a record — enters by its bytes (binary:<sha256>). The binary reports nothing about itself: the source-digest subcommand it answered through v0.4.x was removed in v0.5 (#417).
Missing toolchain (#252)
artifact_compiler_identity throws when rustc/cargo cannot be identified, because an unidentifiable compiler cannot be part of a trustworthy key. This function then records _TOOLCHAIN_COMPILER_UNIDENTIFIED instead and does not memoize the result, so callers that only need a fingerprint (ArtifactId's default, test skipping, _reset_extractor_state! round-trips) keep working without a compiler, and a compiler appearing later is picked up.
It is not total, though: the extractor= line needs the extractor, so without one this raises the ExtractorError of extractor_path.
Paths that are about to compile are the ones that must refuse: they go through ArtifactId, whose compiler field calls artifact_compiler_identity directly and raises RustError.
RustCall.wrap_crate — Method
wrap_crate(files; crate_name, cfg=:strict, cfg_text=nothing,
crate_root=nothing, skip_unparsable=false) -> WrapperCrateSourceGenerate the wrapper crate for the PyO3 items of the crate scanned from files (#275 Phase 2). The arguments mirror extract_manifest in crate mode, because the extractor runs the same scan and then generates from it: what scan_crate reports and what the wrapper exports cannot disagree.
cfg / cfg_text decide more than which items are reported. When the configuration is fully resolved, an item carrying a #[cfg] predicate is known to exist in the build the wrapper links against; when it is not, such an item is refused with cfg_undecided rather than compiled into a call to something that may not be there. An item marked only through #[cfg_attr(feature = "python", pyfunction)] has no predicate of its own and is unaffected — the marker is conditional, the item is not, which is what makes a Python-free wrapper build possible at all.
Toolchain check (src/artifacts/toolchain_check.jl)
RustCall.check_toolchain() reports the rustc / cargo RustToolChain resolves, the minimum supported rustc, and the extractor's status, without building anything (#490).
RustCall.check_toolchain — Method
check_toolchain(; io = stdout) -> NamedTupleReport the toolchain RustCall would build with, without building anything (#490): the rustc and cargo RustToolChain resolves — the very commands every build runs — with their versions, the minimum supported rustc (minimum_supported_rustc), and the rustcall-extract binary Julia would run, with the manifest schema it speaks. Raises nothing: every problem is listed instead, so this is the first thing to run when a build fails deep inside Cargo or rustc.
Prints a summary to io (pass devnull to silence it) and returns (; ok, rustc, cargo, minimum_rustc, rustc_supported, compiler_identity, extractor, problems):
rustc,cargo—(; command, version, release, error): the resolved command, its--versionline, the parsed release (nothingwhen it cannot be read), and why it could not be run (nothingwhen it could);minimum_rustc— the floor, ornothingwhen no crate declares one;rustc_supported—true/falseagainst the floor (a pre-release such as1.85.0-nightlycounts as its release),nothingwhen either side is unknown;compiler_identity—artifact_compiler_identity(), the string every cache key folds in, ornothingwhen it cannot be computed;extractor—(; path, schema, identity, error): the binary, the schema it reports (this release expectsMANIFEST_SCHEMA_VERSION), its identity (extractor_source_digest), and what is wrong with it;problems— one line per problem;okisisempty(problems).
julia> RustCall.check_toolchain();
RustCall toolchain check: ok
rustc: rustc 1.98.1 (48a229cea 2026-09-01) (minimum supported: 1.85.0)
cargo: cargo 1.98.1 (797e8a9bc 2026-08-05)
extractor: .../rustcall-extract (schema 0.9)RustCall.minimum_supported_rustc — Method
minimum_supported_rustc() -> Union{VersionNumber, Nothing}The oldest rustc RustCall supports: the highest package.rust-version declared by the crates Pkg.build("RustCall") compiles (deps/rustcall_extract and deps/rustcall_helpers), or nothing when none declares one.
deps/rustcall_extract declares it, because its committed Cargo.lock — built with --locked — pins dependencies whose own rust-version sets it (test/test_toolchain_check.jl checks the declaration against that graph). Cargo refuses an older compiler with this same number before compiling anything, so the floor has one source.