Open
Description
When building a --crate-type=bin
target with rustc, an object file is produced in /tmp/<randomname>
and that absolute path is then passed to the linker.
Windows puts paths to all object files in the PDB file, so this results in non-deterministic Windows builds (see #88982 (comment)). To be deterministic all paths must be relative paths, or fixed paths.
To resolve this, we could:
- Grow a command line to specify the path to the object file that rustc should write, and then pass to the linker.
- Grow a command line to specify the temp root (replacing
/tmp
or similar when specified), allowing it to be specified relative to the CWD. Then ensure-Zremap-cwd-prefix
gets applied to it in order to produce a relative path. - Other??
(FWIW I am cross-compiling Linux to Windows here which is why you see /tmp
in the path :) But same things occur building on Windows.)