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

cargo clean doesn't clean components/ crates #423

Closed
fabricedesre opened this issue Apr 25, 2016 · 7 comments
Closed

cargo clean doesn't clean components/ crates #423

fabricedesre opened this issue Apr 25, 2016 · 7 comments
Labels

Comments

@fabricedesre
Copy link
Collaborator

ping @JohanLorenzo @samgiles

@samgiles
Copy link
Contributor

Hmm, maybe a top level Makefile would be useful? 😬

@fabricedesre
Copy link
Collaborator Author

Well, see also #424

@JohanLorenzo
Copy link
Contributor

This is likely due to the fact that cargo deals with one target folder. At some point, this is planned to change: build workspace are being RFC'd rust-lang/rfcs#1525. Servo builds with mach, so I think we could either go with it or with a Makefile.

@ferjm ferjm added the Build label Apr 26, 2016
@julienw
Copy link
Contributor

julienw commented Apr 27, 2016

I guess the issue is again about ./components/dns_challenge ?
Note I filed rust-lang/cargo#2573 some time ago, you can comment there with this new use case if you think this could be useful.

But both this bug and #424 seems to show that this is maybe not the right directory structure for ./components/dns_challenge as it's not a lib but a runnable binary. Cargo is not very good at handling several binaries, and that's the root issue here.

@julienw
Copy link
Contributor

julienw commented Apr 27, 2016

Actually, adding this to foxbox' Cargo.toml:

[[bin]]
name = "foxbox"
path = "src/main.rs"

[[bin]]
name = "dnschallenge"
path = "components/dns_challenge/main.rs"

fixes both this bug and bug #424 for me. (I removed the call to "cargo_build_in_directory" in build.rs).

This will generate both dnschallenge and foxbox binaries in target/debug. And this seems to react appropriately to cargo clean and cargo build when something changes in subdirectories.

Now of course we need to make this work properly since the dnschallenge binary is not located in the same place.

@samgiles
Copy link
Contributor

Nice! It doesn't matter where the binary is located, as long as it's on the PATH.

julienw added a commit to julienw/foxbox that referenced this issue Apr 27, 2016
@julienw
Copy link
Contributor

julienw commented Apr 27, 2016

PATH=target/debug:$PATH cargo run --bin foxbox works pefectly with this PR ^ :)

Yet the command line is not so nice. Maybe a simple "start.sh" script could make this easier.

julienw added a commit to julienw/foxbox that referenced this issue Apr 28, 2016
julienw added a commit to julienw/foxbox that referenced this issue Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants