While applying the Salt state roles/devserver on ysul for T2315, the deployment failed with the following error:
failed: Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'rust.get_rustc_triplet'
At first, I suspected an issue with Salt module synchronization. So I ran saltutil.sync_modules, but the problem persisted.
I then investigated further:
- The function rust.get_rustc_triplet is indeed defined in _modules/rust.py in the repository.
- However, sys.list_functions rust returned nothing, meaning the module was not loaded.
Looking into the module rust.py implementation, I identified the cause:
def __virtual__():
return (
path_which("rustc") is not None,
"The Rust execution module cannot be loaded: rustc not installed.",
)The module is only loaded if the rustc binary is available on the system.
On ysul, rustc is not installed, so we need to install it with Salt