Skip to content
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

[WIP] mtime+content tracking #8623

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
68c94e8
mtime+content tracking
gilescope Aug 16, 2020
df16720
v2: Take advantage of rustc's precalulated src hashes.
gilescope Aug 21, 2020
642cf9c
Put hash back in cache.
gilescope Aug 21, 2020
fecc6da
Fix existing tests.
gilescope Aug 22, 2020
0675c0e
Optimisation: No need to figure out if bin files are up to date if th…
gilescope Sep 5, 2020
7ca4fbd
WIP object reading
gilescope Oct 29, 2020
8073aac
Read SVH in bin object files and rlibs
gilescope Oct 30, 2020
5e94d25
SvhInBin => svh. No need for svh in filename.
gilescope Oct 30, 2020
29cef89
Use hex encoding for src hashes
gilescope Oct 31, 2020
e3c98e4
cargo fmt
gilescope Oct 31, 2020
1f369a2
use from le bytes
gilescope Oct 31, 2020
3a47d6b
rlib rather than rmeta
gilescope Oct 31, 2020
edc38a9
bugfix
gilescope Nov 1, 2020
d2875fb
Read svh from .rmeta
gilescope Nov 1, 2020
88869b9
First cut
gilescope Nov 3, 2020
36fd73d
Use existing cache. Introduce dep_info_cache to stop parsing the same…
gilescope Nov 3, 2020
c25d820
Signs that the caching of build.rs might be working but now output of…
gilescope Nov 7, 2020
4e917b7
Tentitve output hashing
gilescope Nov 8, 2020
a9cd845
Less clones
gilescope Nov 9, 2020
15a8f24
Simpler eq
gilescope Nov 9, 2020
46bb454
no need for to_string_lossy
gilescope Nov 9, 2020
73352cd
No point hashing a hash
gilescope Nov 9, 2020
b4000e9
use to_le_bytes
gilescope Nov 9, 2020
0f84c40
Merge branch 'master' into endmtime
gilescope Nov 9, 2020
b6425c1
Just use derived hash impl
gilescope Nov 9, 2020
05b9edf
Everything using dep_info_cache now.
gilescope Nov 9, 2020
46c6953
People only care if there's a miss
gilescope Nov 9, 2020
d498f08
Merge branch 'master' into endmtime
gilescope Nov 10, 2020
f289f82
loop to find
gilescope Nov 10, 2020
eb5c061
match to if let
gilescope Nov 10, 2020
5d63d44
Less prints
gilescope Nov 10, 2020
03dc307
Better log messages
gilescope Nov 10, 2020
e73de2a
less print stmts
gilescope Nov 10, 2020
4b63f8a
size and hash optional
gilescope Nov 12, 2020
1411aa5
size and hash optional
gilescope Nov 12, 2020
87600cc
Only activate when switched on
gilescope Nov 12, 2020
1379263
Updates to serialiseation format in tests.
gilescope Nov 12, 2020
58478ec
reduced duplication
gilescope Nov 13, 2020
615dd81
Working following format change of hashes
gilescope Nov 16, 2020
a750137
cargo fmt + fix tests
gilescope Nov 16, 2020
533a597
Break out to separate file as fingerprint.rs is big
gilescope Nov 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ lazycell = "1.2.0"
libc = "0.2"
log = "0.4.6"
libgit2-sys = "0.12.14"
md-5 = "0.8"
memchr = "2.1.3"
num_cpus = "1.0"
opener = "0.4"
Expand All @@ -55,6 +56,7 @@ semver = { version = "0.10", features = ["serde"] }
serde = { version = "1.0.82", features = ["derive"] }
serde_ignored = "0.1.0"
serde_json = { version = "1.0.30", features = ["raw_value"] }
sha-1 = "0.8"
shell-escape = "0.1.4"
strip-ansi-escapes = "0.1.0"
tar = { version = "0.4.26", default-features = false }
Expand All @@ -68,12 +70,18 @@ clap = "2.31.2"
unicode-width = "0.1.5"
openssl = { version = '0.10.11', optional = true }
im-rc = "15.0.0"
ar="0.8"

# A noop dependency that changes in the Rust repository, it's a bit of a hack.
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
# for more information.
rustc-workspace-hack = "1.0.0"

[dependencies.object]
version = "0.20.0"
default-features = false
features = ['read_core', 'elf', 'macho', 'pe', 'unaligned']

[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = { version = "0.9.0", features = ["mac_os_10_7_support"] }

Expand Down
7 changes: 5 additions & 2 deletions src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use std::collections::{BTreeSet, HashMap, HashSet};
use std::path::PathBuf;
use std::sync::{Arc, Mutex};

use filetime::FileTime;
use jobserver::Client;

use crate::core::compiler::fingerprint::{CurrentFileprint, RustcDepInfo};
use crate::core::compiler::{self, compilation, Unit};
use crate::core::PackageId;
use crate::util::errors::{CargoResult, CargoResultExt};
Expand Down Expand Up @@ -38,7 +38,9 @@ pub struct Context<'a, 'cfg> {
/// Fingerprints used to detect if a unit is out-of-date.
pub fingerprints: HashMap<Unit, Arc<Fingerprint>>,
/// Cache of file mtimes to reduce filesystem hits.
pub mtime_cache: HashMap<PathBuf, FileTime>,
pub mtime_cache: HashMap<PathBuf, CurrentFileprint>,
/// Cache of dep_info to reduce filesystem hits.
pub dep_info_cache: HashMap<PathBuf, RustcDepInfo>,
/// A set used to track which units have been compiled.
/// A unit may appear in the job graph multiple times as a dependency of
/// multiple packages, but it only needs to run once.
Expand Down Expand Up @@ -107,6 +109,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
build_script_outputs: Arc::new(Mutex::new(BuildScriptOutputs::default())),
fingerprints: HashMap::new(),
mtime_cache: HashMap::new(),
dep_info_cache: HashMap::new(),
compiled: HashSet::new(),
build_scripts: HashMap::new(),
build_explicit_deps: HashMap::new(),
Expand Down
Loading