-
Notifications
You must be signed in to change notification settings - Fork 53
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
A relative CARGO_TARGET_DIR
is no longer relative to the users current working directory but instead is always relative to the target crate's root directory
#138
Comments
CARGO_TARGET_DIR
is no longer relative to the *users* current working directory but instead is always relative to the *target crate*'s root directoryCARGO_TARGET_DIR
is no longer relative to the users current working directory but instead is always relative to the target crate's root directory
Ugh, it looks like an impossible scenario. That commit fixed problems caused by .cargo/config changing the meaning of target-dir. I think the current state is the better one, because the current directory is the same for the call to cargo metadata and call to cargo build. Previously they were mismatched, so I'm surprised that relative |
Cargo is surprisingly sensitive to the current directory, and not just env vars, but also This is really weird and unexpected to me. Cargo-deb needs to have So I'm going to deviate from cargo's quirk here, and force current dir to be the same as manifest dir. |
Sad that cargo-deb doesn't support workspaces (correct me if I'm wrong) The hack I decided to go with is creating a symlink in
That way you get the |
From the README:
|
Thanks for a quick response. I tried that before actually, and I'm hitting the problem from this issue (I believe):
(same result with |
Don't hack it with symlinks!
If you want Cargo's target dir elsewhere, just configure Cargo properly! In asset paths |
Hi, the workspace's relative target directory is by default [build]
target-dir = "target"
It doesn't find for me, I keep getting the error above. It insists that it expects the target directory in my crate's folder, but it's in the workspace's root (which is the default) |
What's the output of |
Okay so, I took some more time to find out myself, started debugging
and now it should be I'm sorry for wasting your time, and thank you so much for this great tool. |
Use |
I am using
cargo deb
from the root directory of a workspace. I use a relative path inCARGO_TARGET_DIR
to send all output to one directory, and I provide a--manifest-path
to theCargo.toml
of the crate I wish to build. I believe as a result of this commit, this no longer works. Now theCARGO_TARGET_DIR
path is always presumed to be relative to the root directory of the crate becausecargo deb
changes the working directory to the root directory of the crate. Now a new output subdirectory is created for each crate in my workspace.The Rust docs define
CARGO_TARGET_DIR
as:My assumption as a user is that the current working directory is wherever I am currently running my
cargo
command from, but with this new change that assumption no longer holds. Is this the desired behavior? Am I just usingcargo deb
improperly?The text was updated successfully, but these errors were encountered: