-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Encoded CFLAGS
for supporting spaces
#847
Comments
While that might be possible to address in cc-rs, it still seems likely to break in other build systems, such as invocations of make, which don't have a solution to this problem. |
@joshtriplett does |
I'm talking about the latter: cc-rs doesn't seem like the right place to unilaterally propagate a new standard for passing CFLAGS that no other build system will understand. |
There admittedly are plenty of people just using |
make does have a "solution" for this problem, if you shell escape with backslashes or quotes, it works: https://asciinema.org/a/oR0RRBOmtEX1W9p4GzVQk7mIt autoconf doesn't work. I think the ideal solution to this would be This is a pretty significant issue in my opinion, given the prevalence of spaces on Windows. |
Wouldn't it be better to let each variable on their own set whether |
The extra control would be nice, but I'm not sure about the complexity. |
According to https://github.com/rust-lang/cc-rs/#external-configuration-via-environment-variables spaces nor escapes for spaces are not supported in e.g.
C(XX)FLAGS
. Inxbuild
we useCFLAGS
to set a--sysroot
path, and this can occasionally contain spaces on Windows machines (because the toolchain is unpacked to a user folder, and users like to haveFirstname Surname
as username and profile directory).A likable solution is new
CARGO_ENCODED_RUSTFLAGS
-like variables, where spaces within individual args are supported by requiring the user to replace space delimiters in between separate arguments with the\x1f
ASCII Unit Separator: https://doc.rust-lang.org/cargo/reference/environment-variables.html, to allow more mechanical piecing-together of these variables without messing around with nested quotes or backslash-escapes.Referencing rust-mobile/xbuild#124, where this is one of the deciding factors to build our Android compiler support differently.
The text was updated successfully, but these errors were encountered: