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

Add cmd option to pass Rustc arguments containing spaces #6184

Closed
humenda opened this issue Oct 18, 2018 · 5 comments
Closed

Add cmd option to pass Rustc arguments containing spaces #6184

humenda opened this issue Oct 18, 2018 · 5 comments
Labels
A-cli Area: Command-line interface, option parsing, etc. A-rustflags Area: rustflags C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@humenda
Copy link

humenda commented Oct 18, 2018

I am trying to pass pre-link-args and link-args to Rustc using Cargo. These dynamic an hence cannot be in the Cargo.toml. Since they contain spaces, I cannot use CARGO_RUSTC_FLAGS. If cargo had an option as --rustc-arg=, it would be possible to pass (multiple) arguments through to Rust, even if some would contain spaces. This could be useful for passing library paths, too.

@ehuss
Copy link
Contributor

ehuss commented Oct 18, 2018

cc #6139, another issue about spaces in flags.

@alexcrichton alexcrichton added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Oct 20, 2018
@ehuss ehuss added A-cli Area: Command-line interface, option parsing, etc. A-rustflags Area: rustflags labels Apr 6, 2020
@atopia
Copy link

atopia commented Jan 14, 2022

The problem of arguments with spaces in CARGO_RUSTC_FLAGS has been addressed with the introduction of CARGO_ENCODED_RUSTFLAGS in #9601 and the viability of the solution confirmed as part of working on rust-lang/rust/pull/85967. Although this issue proposes a command line option, unless @humenda objects I would argue that this issue can be closed.

@rustbot ready

@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2022

Error: The feature shortcut is not enabled in this repository.
To enable it add its section in the triagebot.toml in the root of the repository.

Please let @rust-lang/release know if you're having trouble with this bot.

@humenda
Copy link
Author

humenda commented Jan 15, 2022 via email

@weihanglo
Copy link
Member

Thanks everyone for participating in this issue. Glad the inconvenience has been resolved!

As a result, this is going to be closed. For a more general --rustflags CLI option, you can find recent discussions here rust-lang/rfcs#3310.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. A-rustflags Area: rustflags C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

6 participants