Skip to content

Commit

Permalink
Remove Rust build path prefixes from the binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Jan 24, 2023
1 parent b7c89eb commit cdad451
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ export MESON_CROSS="$SOURCE_DIR/build/emscripten-crossfile.meson"
# Run as many parallel jobs as there are available CPU cores
export MAKEFLAGS="-j$(nproc)"

# Ensure Rust build path prefixes are removed from the resulting binaries
# https://reproducible-builds.org/docs/build-path/
# TODO(kleisauke): Switch to -Ctrim-paths=all once supported - https://github.com/rust-lang/rfcs/pull/3127
export RUSTFLAGS+=" --remap-path-prefix=$(rustc --print sysroot)/lib/rustlib/src/rust/library/="
export RUSTFLAGS+=" --remap-path-prefix=$CARGO_HOME/registry/src/="
export RUSTFLAGS+=" --remap-path-prefix=$DEPS/="

# Dependency version numbers
VERSION_ZLIBNG=2.0.6 # https://github.com/zlib-ng/zlib-ng
VERSION_FFI=3.4.4 # https://github.com/libffi/libffi
Expand Down

0 comments on commit cdad451

Please sign in to comment.