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

Custom location for output directory (target path) #1156

Closed
dhardy opened this issue Jan 13, 2015 · 5 comments
Closed

Custom location for output directory (target path) #1156

dhardy opened this issue Jan 13, 2015 · 5 comments

Comments

@dhardy
Copy link

dhardy commented Jan 13, 2015

It should be possible to change the location of Cargo's output from the default target subdirectory. I'm not sure whether it's not possible or I just don't know how to read the Cargo doc.

Use case: I have project foo with several sub-directories arnold, bethany, chris, etc. I use CMake to build the main project which builds each sub-project in paths like build/arnold. One of these sub-projects now uses Rust and Cargo (because Cargo has awesome dependency management), so from the point of view of the project Cargo should place its output in build/bethany not bethany/target.

This is not currently a significant issue, but it could be with larger projects.

A related issue is that rustc warning/error messages should now give either absolute paths or paths relative to the root of the project, i.e. bethany/src/lib.rs:36 instead of src/lib.rs:36.

@nrc
Copy link
Member

nrc commented Jan 21, 2015

+1 This pains me.

@marcbowes
Copy link
Contributor

+1. My use case also stems from integrating with another build system. My current workaround is just to symlink target to the place I actually want cargo to scribble in.

I'd also like it if this sort of thing picked up config from the env, to avoid passing flags all over the show.

@gentoo90
Copy link
Contributor

+1

@TimNN
Copy link
Contributor

TimNN commented Apr 24, 2015

+1 I use SublimeLinter to automatically run cargo in the background and display any errors in Sublime Text. This however means that there is still a cargo process running in the background when I switch back to the terminal and run cargo test (or something similar). Running two build processes at the same usually leads to one of them exiting unsuccessfully because some file was already moved and no longer exists. This could easily be solved by having SublimeLinter build in a separate directory, if it were possible to do so.

@alexcrichton
Copy link
Member

Closing as a dupe of #482

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

No branches or pull requests

6 participants