You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like meta fingerprints are not particularly stable when it comes to depending on local crates (i.e. with a dependency specifying a "path", a "[patch.crates-io]" section or a "__CARGO_TESTS_ONLY_SRC_ROOT" environment variable); different absolute pathnames seem to produce different build fingerprints. This makes it difficult to reproduce builds when running as a different user or on a different operating system or distribution.
--remap-path-prefix doesn't seem to help at all here.
To reproduce this problem:
for i in a b
do
mkdir $i
(
cd $i
TOPDIR=`pwd`
cargo new --lib repro
cat > repro/src/lib.rs <<EOF
pub fn foo() -> usize {
ext_crate::add(1, 2)
}
EOF
cp -r ../ext_crate ext_crate
cat > repro/Cargo.toml <<EOF
[package]
name = "repro"
version = "0.1.0"
edition = "2021"
[dependencies]
ext_crate = { version = "0.1.0", path="../ext_crate" }
EOF
(
cd repro
RUSTFLAGS="--remap-path-prefix=${TOPDIR}=/stablepath" cargo build -vv --release --target-dir=build
)
)
done
diff -ur [ab]/repro/build
My expected behavior here would be that those two builds would be identical and reproducible.
It looks like meta fingerprints are not particularly stable when it comes to depending on local crates (i.e. with a dependency specifying a "path", a "[patch.crates-io]" section or a "__CARGO_TESTS_ONLY_SRC_ROOT" environment variable); different absolute pathnames seem to produce different build fingerprints. This makes it difficult to reproduce builds when running as a different user or on a different operating system or distribution.
--remap-path-prefix doesn't seem to help at all here.
To reproduce this problem:
My expected behavior here would be that those two builds would be identical and reproducible.
These are the versions I am using:
The text was updated successfully, but these errors were encountered: