adambratschikaye opened issue #10639:
Full paths in generate error messages are preventing us from producing deterministic build artifacts.
This is similar to https://github.com/bytecodealliance/wasmtime/issues/9553 and https://github.com/bytecodealliance/wasmtime/pull/9580. When generating term constructors here certain cases produce an
unreachable!call which embeds the source code file path in the error message. When this is applied to the rules foremit_ret_gpr,emit_ret_xmmanddefer_side_effectgenerated here, we end up with the full path (includingOUT_DIR) of the generated files embedded in the resulting binary which makes builds non-deterministic.I'm happy to put up a fix, either by trying to remove the
OUT_DIRprefix or only including the path when a certain env variable is present (as suggested in the above PR). Any opinions on which approach is preferred?
alexcrichton commented on issue #10639:
Thanks for the report! I think it'd be reasonable to make binaries deterministic-by-default so removing
$OUT_DIRfrom the paths by default (rather than having it be opt-in). In any case though a PR would be much appreciated, we're happy to review!
alexcrichton closed issue #10639:
Full paths in generate error messages are preventing us from producing deterministic build artifacts.
This is similar to https://github.com/bytecodealliance/wasmtime/issues/9553 and https://github.com/bytecodealliance/wasmtime/pull/9580. When generating term constructors here certain cases produce an
unreachable!call which embeds the source code file path in the error message. When this is applied to the rules foremit_ret_gpr,emit_ret_xmmanddefer_side_effectgenerated here, we end up with the full path (includingOUT_DIR) of the generated files embedded in the resulting binary which makes builds non-deterministic.I'm happy to put up a fix, either by trying to remove the
OUT_DIRprefix or only including the path when a certain env variable is present (as suggested in the above PR). Any opinions on which approach is preferred?
Last updated: Dec 06 2025 at 07:03 UTC