Skip to main content

Module paths

Module paths 

Source
Expand description

Nothing of the build machine in a package: the build’s paths remapped to short fixed names (remapped_flags), and the built binary searched for what is left of them (search).

Cargo’s trim-paths isn’t stable on the pinned Rust, so the remapping is rustc’s --remap-path-prefix, passed through CARGO_ENCODED_RUSTFLAGS after the flags already in it or in RUSTFLAGS. That variable wins over the rustflags of a game’s .cargo/config.toml, which these builds then don’t get.

Constants§

ENCODED
Cargo’s flags variable, its arguments separated by \x1f.
FOUND
What starts the error search’s finding gives: web::run returns it as text, and the web exporter tells it from a failed build by it.

Functions§

cargo_home
CARGO_HOME, else .cargo in the home folder.
check_file
search on the file at file, as the error the package is refused with.
home
The home folder: HOME, else USERPROFILE.
needles
The paths a package must not hold: the home folder, CARGO_HOME and the roots (the project’s and the workspace’s).
outside
The packages the project at root builds from a path outside its workspace (the engine, when a game names it by path = "…"), each folder with its name, by cargo metadata. None if it doesn’t run.
remapped_flags
The value of ENCODED for a build with remaps: the flags already in encoded (that variable), else those in plain (RUSTFLAGS, split on white space), then a --remap-path-prefix for each remap.
remapped_flags_here
remapped_flags with this process’s variables.
remaps
The folders a release build is remapped from: the workspace’s root (to the package’s name), each package of outside (a folder outside the workspace that the build reads by a path, to its name), CARGO_HOME (/cargo), RUSTUP_HOME (/rustup) and the target folder (/target), in that order. rustc tries the last first, so a folder inside another one still gets its own name.
search
The first of needles that bytes hold, with either slash (or both) and in any case of its ASCII letters, as the needle is written. A path of fewer than two parts (/, C:\) is never looked for.