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

rustpkg endlessly compiles dependencies #7879

Closed
jedestep opened this issue Jul 18, 2013 · 4 comments · Fixed by #9263
Closed

rustpkg endlessly compiles dependencies #7879

jedestep opened this issue Jul 18, 2013 · 4 comments · Fixed by #9263

Comments

@jedestep
Copy link
Contributor

My project contains two subdirectories of src, liba and libb. Both of them contain lib.rs. libb depends on liba. Inside the libb folder is a folder called test which contains test.rs and depends on the contents of libb. When building with rustpkg, libb is compiled ad infinitum as it tries to resolve its dependency.

@huonw
Copy link
Member

huonw commented Jul 18, 2013

cc @catamorphism

@catamorphism
Copy link
Contributor

Reproduced with HEAD. Note that this happens even with just a self-contained libb, as long as the test subdirectory with the test.rs file depending on libb is there.

@catamorphism
Copy link
Contributor

I think the Right Thing is for rustpkg to topologically sort crates in the given package by dependency order. This will be a bit of work, since as it is, we don't have a graph library.

@catamorphism
Copy link
Contributor

Having slept on this, I think the situation isn't really so bad. The problem is that I'm considering a given package to be a single unit. Thus, the containing package here doesn't show up in workcache as "already built". If I cached each crate as a single entity with inputs and outputs, I think this example would work without having to build a dependency graph. (Building a dependency graph would be more declarative, and workcache is supposed to work imperatively, which occurred to me later.)

bors added a commit that referenced this issue Sep 18, 2013
r? @brson Treating a package as the thing that can have other packages depend on it,
and depends on other packages, was wrong if a package has more than one
crate. Now, rustpkg knows about dependencies between crates in the same
package. This solves the problem reported in #7879 where rustpkg wrongly
discovered a circular dependency between thhe package and itself, and
recursed infinitely.

Closes #7879
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 a pull request may close this issue.

3 participants