-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
RUSTFLAGS + a sysroot with spaces in its path = 😭 #6139
Comments
As a workaround, you could add This issue basically stems from just doing One plausible solution is to define some escaping mechanism for |
Although it won't work in this situation (because it uses the wrong API), I added an experimental feature that allows you to specify lists in environment variables using TOML syntax. I could extend it to cover this situation, I doubt RUSTFLAGS starting with |
There is a shlex crate that implements POSIX shell style splitting which would probably make this work: https://docs.rs/shlex/0.1.1/shlex/ |
For those looking for a temporary workaround, Windows still supports short filenames, so you could do:
Ugly? Yes. But it works. 😛 |
Is there any traction on this? This issue has been open for 3 years now, and it's not obvious how to resolve without doing some searching. |
|
This is the first time I hear about However, at https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts it sounds more like CARGO_ENCODED_RUSTFLAGS is something that cargo sets for build scripts, not something it reads itself. |
Ah, here it is. Yeah that sounds like exactly what we need! |
I can confirm that with japaric/xargo#336, using a directory with a space for XARGO_HOME (which becomes the sysroot) works fine. This issue should probably be closed then? |
It seems to be there since 1.55. Thanks for the reminder! Closing. |
When using
cargo-xbuild
to do things like "build an OS", you need to set the sysroot viaRUSTFLAGS
.Here's an example
rustc
invocation on my machine that builds:The last bit is the important part:
It appears the space in my username causes this to be impossible to set via
RUSTFLAGS
. With an invocation like this:You can see that it's all good. However, this fails when passed to
rustc
:I am not sure what to do here.
The text was updated successfully, but these errors were encountered: