SH3009: The built program holds a path of the build machine
Class: operation, exit code 1.
A --release build (export --release, or web --release) remaps the
paths it was built from to short fixed names: the workspace to the
game's package name, each crate read by a path outside it to the
crate's name, Cargo's home to /cargo, rustup's to /rustup,
and the target folder to /target. Then it searches the built program,
or the .wasm, for the home folder, Cargo's home and the game's
folders, with either slash. One was still there, so the package would
carry the builder's user name and folders: it was refused. The message
names the file and the path found.
How to fix it. The remapping renames the paths of the source files
the compiler reads, not a path the code writes into the program as a
value: env!("CARGO_MANIFEST_DIR"), a build script's OUT_DIR, a path
include_str! shows in a message. Find the crate whose code does that
(search its sources for the path's start) and keep the path out of what
ships: a path from the game's own folder, or a name. Keep Cargo's home
and the target folder where Cargo puts them, or set CARGO_HOME and
CARGO_TARGET_DIR for the export too. Then export again.
For example:
export: error[SH3009]: the build holds a path of the build machine: dist/export/linux/game-0.1.0-linux/game holds /home/me; the package is refused