-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rebuild triggered after touch
ing a (git submodule) file under the registry/src
directory
#10223
Comments
You can try seeing why Cargo is rebuilding with:
and that should print out why the rebuild is happening |
|
the following in our - name: Zero mtimes of deps
run: |
set -euxo pipefail
CARGO_DIR="${CARGO_HOME:-$HOME/.cargo}"
for source in "$CARGO_DIR"/registry/cache/*/; do
pushd "$source"
source=$(basename -- "$PWD")
mkdir -p "$CARGO_DIR/registry/src/$source"
for crate in *.crate; do
crate=${crate%.crate}
mkdir "$CARGO_DIR/registry/src/$source/$crate" || continue
tar --strip-components=1 -xzf "$crate.crate" -C "$CARGO_DIR/registry/src/$source/$crate"
echo -n ok > "$CARGO_DIR/registry/src/$source/$crate/.cargo-ok"
done
popd
done
find "$CARGO_DIR/registry/src" -exec touch -cfht 197001010000 {}
``` |
Does the rocksdb build script print out a |
#11613 has us no longer checking the mtime for "immutable" sources. It looks like that should resolve this, so I'm closing this. If there is a reason to reconsider, let us know! |
Problem
Initial presentation of bug
In our CI pipeline, one of our dependencies (specifically rocksdb) will run a rebuild, despite being cached.
Steps
I am using
rocksdb
as a representativehello, world!
executablerocksdb = "0.17.0"
as a dependency.clang
orllvm
as per the crate requirementscargo build
5.a.
rm -rf ~/.cargo/registry/src
5.b. (alternate rebuild trigger)
touch /path/to/registry/src/directory/librocksdb-sys-6.20.3/rocksdb
cargo build
and observe the rebuild being triggered.To validate this is unique, I followed the steps with other executables using the
rm
option, without any issues.Possible Solution(s)
touch
, issue [WIP] mtime content tracking #8623 could fix itNotes
The re-build appears to be triggered by this line of code
The CI setup is following the advice outlined here
Version
The text was updated successfully, but these errors were encountered: