-
Notifications
You must be signed in to change notification settings - Fork 13k
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
track incr. comp. dependencies across crates #33476
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
47af3f1
add MetaData DepNode variant
nikomatsakis 2237e89
remove the `Any` bound from `CrateStore`
nikomatsakis b711734
thread the DepGraph to session/crate-store
nikomatsakis 7734308
ignore dep-graph in resolve and lower_crate
nikomatsakis 5bcdf4c
add a MetaData node and trigger reads from it
nikomatsakis ef902a2
when encoding, push MetaData(foo) task on stack
nikomatsakis bc02a54
rename the dep-graph file to include crate ident
nikomatsakis f89041b
identify inputs of `MetaData(X)` nodes
nikomatsakis c7840cf
make the filename computation take a cratenum
nikomatsakis 8f3a8c2
always encode variant fields
nikomatsakis 08837d2
pass revision and incr_comp directory to auxbuild
nikomatsakis 0082fc0
change svh to store a u64
nikomatsakis 303fdc1
cleanup dep-graph debugging code
nikomatsakis b01919a
allow retracing paths across crates
nikomatsakis 3a2edd7
load/save hashes of metadata
nikomatsakis bed7ea8
basic tests for cross-crate hashing
nikomatsakis c981001
nit: use format! instead of iterator
nikomatsakis e4c31de
nit: cache crate-hash for next time
nikomatsakis eaafe45
add debug info to dep_graph
nikomatsakis 4d3ef6b
fix indentation of session/mod.rs
nikomatsakis f860f8b
add task for linking
nikomatsakis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
//! Code for debugging the dep-graph. | ||
|
||
use super::dep_node::DepNode; | ||
use std::error::Error; | ||
use std::fmt::Debug; | ||
|
||
/// A dep-node filter goes from a user-defined string to a query over | ||
/// nodes. Right now the format is like this: | ||
/// | ||
/// x & y & z | ||
/// | ||
/// where the format-string of the dep-node must contain `x`, `y`, and | ||
/// `z`. | ||
#[derive(Debug)] | ||
pub struct DepNodeFilter { | ||
text: String | ||
} | ||
|
||
impl DepNodeFilter { | ||
pub fn new(text: &str) -> Self { | ||
DepNodeFilter { | ||
text: text.trim().to_string() | ||
} | ||
} | ||
|
||
/// True if all nodes always pass the filter. | ||
pub fn accepts_all(&self) -> bool { | ||
self.text.is_empty() | ||
} | ||
|
||
/// Tests whether `node` meets the filter, returning true if so. | ||
pub fn test<D: Clone + Debug>(&self, node: &DepNode<D>) -> bool { | ||
let debug_str = format!("{:?}", node); | ||
self.text.split("&") | ||
.map(|s| s.trim()) | ||
.all(|f| debug_str.contains(f)) | ||
} | ||
} | ||
|
||
/// A filter like `F -> G` where `F` and `G` are valid dep-node | ||
/// filters. This can be used to test the source/target independently. | ||
pub struct EdgeFilter { | ||
pub source: DepNodeFilter, | ||
pub target: DepNodeFilter, | ||
} | ||
|
||
impl EdgeFilter { | ||
pub fn new(test: &str) -> Result<EdgeFilter, Box<Error>> { | ||
let parts: Vec<_> = test.split("->").collect(); | ||
if parts.len() != 2 { | ||
Err(format!("expected a filter like `a&b -> c&d`, not `{}`", test).into()) | ||
} else { | ||
Ok(EdgeFilter { | ||
source: DepNodeFilter::new(parts[0]), | ||
target: DepNodeFilter::new(parts[1]), | ||
}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit looks good.