6.1.2.4. AxivionRustFrontend

Use Axivion Rust compiler for analysis compilation

Compiles Rust code in the given cargo workspace. The output is held in-memory for the following analysis step.

Options

The following places define options that affect this rule: BuildSystemIntegration, Project-GlobalOptions

abort_on_error

abort_on_error : bool = True

If set to true and the build step returns a non-zero exit-code, the build is aborted. Otherwise a non-zero exit-code is logged but the build continues.
 

build_path

build_path : bauhaus.analysis.config.PlainPath = 'target'

The path to the build output directory.
 

cargo_args

cargo_args : list[str] = []

Extra arguments to pass to cargo.
 

cargo_env

cargo_env : dict[str, str | None] = {}

Extra environment variables to use when invoking cargo.
 

enable_all_features

enable_all_features : bool = False

Whether to enable all features in the build (overrides features).
 

enable_proc_macros

enable_proc_macros : bool = True

Whether to enable expansion of proc-macros.

This requires a proc-macro server, see proc_macro_server_path.

 

features

features : list[str] = ['default']

A list of features to enable in the build.

Use the 'default' key to enable default features.

 

manifest_path

manifest_path : bauhaus.analysis.config.ProjectRelativePath = 'None (value must be set)'

The input of this build step (Cargo.toml manifest file).
 

proc_macro_server_path

proc_macro_server_path : bauhaus.analysis.config.PlainPath | None = None

The path to a rust-analyzer compatible proc-macro server.

If not set and proc-macro expansion is enabled, the sysroot path is used to find a proc-macro server corresponding to the current toolchain.

 

run_build_scripts

run_build_scripts : bool = True

Whether to run build.rs scripts in the workspace.
 

sysroot_path

sysroot_path

Type: Sysroot | bauhaus.analysis.config.ProjectRelativePath

Default: 'discover'

The path to the rust toolchain.

If using rustup, this will be one of the toolchains installed in $HOME/.rustup/toolchains, e.g. $HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu.

This path should contain the /bin, /etc, /lib, /libexec, and /share subdirectories.

Note: if a sysroot path is set, cargo will be called with the env var RUSTUP_TOOLCHAIN set to the sysroot path.

 

sysroot_src_path

sysroot_src_path : bauhaus.analysis.config.ProjectRelativePath | None = None

The path to the rustlib source code.

This should contain the source code for the rust standard library crates: alloc, core, proc_macro, std, and test.

If installed with rustup add component rust-src, the sources will be located at $SYSROOT/lib/rustlib/src/rust/library, where $SYSROOT is the sysroot path.

If this option is not set, and the above sysroot relative path exists, it will be used. Otherwise, if sysroot_path is set to 'discover' mode, then the RUST_SRC_PATH environment variable will be checked, and finally, if it is also not set, rustup component add rust-src will be run to attempt to install the sources in the sysroot path.

 

Option Types

These types are used by options listed above:

Sysroot

An enumeration.
 

discover

Use rustc --print sysroot to discover the sysroot path.

This will revert to the 'none' sysroot mode if the rustc command is not found or fails to run.

none

Do not use a sysroot path. Instead, use environment variables to find rustc.

This will first check the RUSTC env var, and then search PATH.