Use relative directory for obj files hash by nmattia · Pull Request #1270 · rust-lang/cc-rs (original) (raw)

When producing .o files, the absolute path of each source file is hashed and used as a prefix for the output object files. While this avoids clashes between different source files with the same basenames, this causes determinism issues in the build as the full system path influences the build output.

This change strips the out_dir parent from the source file paths, assuming that the source files are in the out_dir as well.