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

Issues with spaces in sysroot path (e.g., Windows user accounts containing spaces) #206

Closed
AaronCoad opened this issue Mar 24, 2018 · 6 comments · Fixed by #336
Closed

Comments

@AaronCoad
Copy link

AaronCoad commented Mar 24, 2018

When using xargo build, the error "Multiple input filenames provided" is returned when the Windows user account contains a space as the folderpath isn't wrapped in double-quotes when passed to rustc --sysroot. In my case C:\Users\Aaron Coad.xargo

On another Windows PC where there is no space within the user account, xargo build works successfully.

bors bot added a commit that referenced this issue Mar 26, 2018
207: Wrap sysroot path in double quotes as it might contain spaces r=japaric a=phil-opp

Fixes #206
@phil-opp
Copy link

I tried to add double-quotes in #207, but it seems like they are automatically escaped. I don't have time to work on this at the moment, but in case someone want to try: One possible approach would be to pass the rustc flags directly by invoking cargo rustc and adding them as individual args (instead of invoking cargo build with a manually joined RUSTFLAGS environment variable as it's done currently).

@AxelMontini
Copy link

With #221 this should be fixed (escaping using %20 or \ )

@RalfJung
Copy link
Collaborator

RUSTFLAGS does not support any kind of escaping, I don't think that would help.

What could help though is to write a .cargo file instead of using an environment variable.

@ZeWaka
Copy link

ZeWaka commented Mar 26, 2021

This is still an issue.

@RalfJung RalfJung changed the title Issues with Windows user accounts containing spaces Issues with spaces in sysroot path (e.g., Windows user accounts containing spaces) Mar 26, 2021
@RalfJung
Copy link
Collaborator

This is a fundamental limitation in cargo: rust-lang/cargo#6139

There's not much we can do about this on the xargo side, I am afraid.

@kupiakos
Copy link

So, it seems the solution is to switch RUSTFLAGS to CARGO_ENCODED_RUSTFLAGS when passing to cargo. Possibly switching based on the cargo version.

If the problem is xargo setting RUSTFLAGS unconditionally then that can be fixed with the recently added feature of CARGO_ENCODED_RUSTFLAGS. This is Cargo's "fix" to the solution for xargo.

rust-lang/cargo#10232 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants