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::runreturns it as text, and the web exporter tells it from a failed build by it.
Functions§
- cargo_
home CARGO_HOME, else.cargoin the home folder.- check_
file searchon the file atfile, as the error the package is refused with.- home
- The home folder:
HOME, elseUSERPROFILE. - needles
- The paths a package must not hold: the home folder,
CARGO_HOMEand theroots(the project’s and the workspace’s). - outside
- The packages the project at
rootbuilds from a path outside itsworkspace(the engine, when a game names it bypath = "…"), each folder with its name, bycargo metadata. None if it doesn’t run. - remapped_
flags - The value of
ENCODEDfor a build withremaps: the flags already inencoded(that variable), else those inplain(RUSTFLAGS, split on white space), then a--remap-path-prefixfor each remap. - remapped_
flags_ here remapped_flagswith 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
needlesthatbyteshold, 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.