-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 rustc should detect when one of the arguments passed is either --out-dir or -o and not pass its own #2559
Comments
Some of this is related to the compiler's handling of options (e.g. ignoring |
Yea, agreed. Right now I'm hacking the missing out-dir by relying on -o outputting to the top directory. Specifying an out-dir wouldn't be as necessary if there was a subcommand to output the cargo build dir though, at least for my use case |
I think this issue is also responsible for |
@froydnj this probably isn't what you'd want for that anyway as it doesn't include any dependency information. In general the integration of Cargo into third-party build systems will likely be much more first-class than this in the long run. |
@alexcrichton But wouldn't you handle the fix for this bug similarly to how you would handle
the dep-info isn't actually placed at $PATH, but instead at
|
@froydnj yeah I suspect fixing this would lead to a fix to |
This would require us to parse and interpret rustc arguments which is a complicated endeavor that I do not think we should take on. I think we should view setting of rustflags to be a more advanced use case with caveat emptor and that we should instead be finding why people use them and find more official ways of satisfying their workflows (#12739). As such, I'm proposing to the cargo team that we close this. |
It's great to have #12739 for consolidating discussions of RUSTFLAGS user experience in one place. Thanks for the triage. Also thanks the original reporter for reporting this! Closing. |
If you do:
we're told that:
-o
flag is ignored because multiple outputs are given (I assume this is due to--out-dir
)--out-dir
flag is ignored because-o
is givenand the
derp
binary is produced anyway (in thePWD
)... looks to me like the command line logic is a little wonky.I would expect to to not receive warnings.
Similarly, if you provide
--out-dir
, cargo will completely refuse to compile the program:I would expect:
cargo
to use my--out-dir
when I pass it, instead of the default valueI think some of the issues here are some flags passed into
rustc
viacargo
are privileged and others are not. I just don't know which (and probably none should be).Lastly, I've noticed that passing a custom
--emit
is actually duplicated, and again, does not replace the default.Note there are two
--emit
flags. In the case of emitting an object file, it doesn't make sense to (also) produce the final binary/static lib, which is the behavior I'm seeing.The text was updated successfully, but these errors were encountered: