Skip to main content

Module toolchain

Module toolchain 

Source

Re-exportsΒ§

use anyhow::Context; πŸ”’
use anyhow::Result; πŸ”’
use serde::Deserialize; πŸ”’
use serde::Deserialize; πŸ”’
use std::env; πŸ”’
use std::env; πŸ”’
use std::ffi::OsStr; πŸ”’
use std::path::PathBuf; πŸ”’
use std::process::Command; πŸ”’
use std::sync::Mutex; πŸ”’

StructsΒ§

Toolchain
ToolchainFile πŸ”’
This struct is used to deserialize the β€œrust-toolchain” file.

ConstantsΒ§

CHARON_SYSROOT_VAR
The environment variable through which charon tells charon-driver which full-MIR sysroot to use, if any.
HOST_TARGET
The target triple charon was compiled for, i.e. the platform it runs on. This is the default --target when the user doesn’t pass one.

StaticsΒ§

PINNED_TOOLCHAIN πŸ”’

FunctionsΒ§

driver_cmd
driver_path
get_pinned_toolchain πŸ”’
in_toolchain
Build a command that calls the given binary in the correct toolchain environment. This uses rustup to provide the correct toolchain, unless we’re in a nix context where the toolchain is already in PATH.
miri_sysroot_cache_dir πŸ”’
Where we tell cargo miri setup to build the sysroot for the current toolchain. We use a per-toolchain directory because Miri’s default cache directory (~/.cache/miri) is shared across all toolchains and gets overwritten when switching between Charon versions.
setup_miri_sysroot
cargo miri setup sets up a sysroot containing a standard library built with -Zalways-encode-mir.
sysroot_has_target πŸ”’
Whether this sysroot provides libraries for the given target.
toolchain_path
Get the path to the sysroot, where the cargo and rustc binaries can be found. Prefer using in_toolchain instead of this as much as possible.
toolchain_version