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

Leverage Cargo workspaces in rustbuild #37016

Merged
merged 2 commits into from
Oct 8, 2016
Merged

Conversation

alexcrichton
Copy link
Member

This is a continuation of #36032 which implements the change to use cargo metadata to learn about the crate graph.

@alexcrichton
Copy link
Member Author

r? @brson

@rust-highfive rust-highfive assigned brson and unassigned nikomatsakis Oct 7, 2016
@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@bors
Copy link
Contributor

bors commented Oct 7, 2016

☔ The latest upstream changes (presumably #36945) made this pull request unmergeable. Please resolve the merge conflicts.

This involves hacking the code used to run cargo test on various
packages, because it reads Cargo.lock to determine which packages should
be tested. This change implements a blacklist, since that will catch new
crates when they are added in the future.
@alexcrichton
Copy link
Member Author

r? @japaric

@rust-highfive rust-highfive assigned japaric and unassigned brson Oct 7, 2016
Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, LGTM. Left some questions and a nit.

@@ -268,51 +293,64 @@ pub fn krate(build: &Build,
compiler: &Compiler,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function has a doc comment that mentions "Cargo.lock"; that part should be changed to say cargo metadata

// Right now jemalloc is our only target-specific crate in the sense
// that it's not present on all platforms. Custom skip it here for now,
// but if we add more this probably wants to get more generalized.
if crate_name.contains("jemalloc") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take that the cargo metadata approach handles more gracefully because jemalloc is not listed as a dep on targets that don't use it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah oops, definitely needs to be carried over!

let prefix = "name = \"";
if !line.starts_with(prefix) {
let mut visited = HashSet::new();
let root_pkg = output.packages.iter().find(|p| p.name == root).unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure how this function integrates with the rest of the testing infrastructure. But it seems that if you "test" std_shim and then "test" test_shim you'll end up testing twice the dependencies are appear in the DAG of both root crates, like core? Perhaps that scenario doesn't happen or perhaps that's the current behavior. Just want to check that the behavior's not changing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah there are actually no edges between these three crates to test. In a sense they're all disconnected graphs.

(note that we want there to be edges, we're just not quite there yet!

This updates the commit to use workspaces to use `cargo metadata` instead of
hardcoded lists about what to test. This should help us be resilient to updates
in the future on behalf of the crate DAG and minimize the amount of files that
need to be touched.
@alexcrichton
Copy link
Member Author

@bors: r=japaric

@bors
Copy link
Contributor

bors commented Oct 8, 2016

📌 Commit 147e2da has been approved by japaric

Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 8, 2016
Leverage Cargo workspaces in rustbuild

This is a continuation of rust-lang#36032 which implements the change to use `cargo metadata` to learn about the crate graph.
bors added a commit that referenced this pull request Oct 8, 2016
Rollup of 6 pull requests

- Successful merges: #36937, #37016, #37028, #37029, #37031, #37034
- Failed merges: #37027
@bors bors merged commit 147e2da into rust-lang:master Oct 8, 2016
@alexcrichton alexcrichton deleted the workspaces branch October 15, 2016 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants