gen_rust_utilities
Generate Rust FFI bindings for selected Basilisk C ABI utilities.
The generated bindings intentionally cover only C ABI headers. C++/Eigen APIs need a dedicated C shim and are excluded until that interface is designed.
Install the exact command-line generator version before regenerating the committed bindings:
cargo install bindgen-cli --version '=0.72.1' --locked
The script rejects missing or mismatched versions rather than producing
tool-version-dependent changes to bsk_utilities/src/raw.rs.
The script accepts two include-root layouts:
Basilisk core (default here):
--bsk-includepoints at (or defaults to) this repo’s ownsrc/– headers are included bare, e.g.architecture/utilities/astroConstants.h.Vendored headers: an include root with a
Basilisk/subdirectory. Headers are included asBasilisk/architecture/utilities/astroConstants.h. This layout is detected when<include-root>/Basiliskexists.
- gen_rust_utilities.find_bindgen() str[source]
Return the pinned
bindgenexecutable or stop with installation help.
- gen_rust_utilities.find_default_include_root() Path[source]
Default to this repo’s own
src/(Basilisk core layout).
- gen_rust_utilities.resolve_layout(include_root: Path) tuple[Path, str][source]
Return
(basilisk_include_dir, header_prefix)for this include root.A vendored root has a
Basilisk/subdirectory containing the actual headers, with the root itself on the include path so#include "Basilisk/architecture/..."resolves; Basilisk core’s ownsrc/is that directory already, with nothing to prefix.
- gen_rust_utilities.run_bindgen(wrapper_path: Path, include_root: Path, basilisk_dir: Path) str[source]
Run bindgen over the selected C ABI headers.
include_rootresolves the wrapper header’s own#includelines (written withheader_prefix);basilisk_dirresolves the internal cross-includes Basilisk headers use among themselves, which are always bare (e.g."architecture/utilities/linearAlgebra.h") regardless ofheader_prefix. The two are the same directory in Basilisk core’s own layout (no prefix) and different directories for a vendored root (seeresolve_layout).