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
When using cargo-xbuild to do things like "build an OS", you need to set the sysroot via RUSTFLAGS.
cargo-xbuild
RUSTFLAGS
Here's an example rustc invocation on my machine that builds:
rustc
rustc --crate-name ux "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\ux-0.1.2\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=b446262c41a4777f -C extra-filename=-b446262c41a4777f --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\sysroot"
The last bit is the important part:
--sysroot "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\sysroot"
It appears the space in my username causes this to be impossible to set via RUSTFLAGS. With an invocation like this:
~\src\intermezzos\kernel [master ↑1]> $env:RUSTFLAGS="--sysroot ""C:\Users\Steve Klabnik\src\intermezzos\kernel\target\sysroot""" ~\src\intermezzos\kernel [master ↑1]> $env:RUSTFLAGS --sysroot "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\sysroot"
You can see that it's all good. However, this fails when passed to rustc:
> cargo build error: failed to run `rustc` to learn about target-specific information Caused by: process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --sysroot "\"C:\Users\Steve" "Klabnik\src\intermezzos\kernel\target\sysroot\"" --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (exit code: 1) --- stderr error: multiple input filenames provided
I am not sure what to do here.
The text was updated successfully, but these errors were encountered:
This is a cargo issue I think.
Sorry, something went wrong.
Yep, I think this is a Cargo issue. Closing in favor of rust-lang/cargo#6139
No branches or pull requests
When using
cargo-xbuildto do things like "build an OS", you need to set the sysroot viaRUSTFLAGS.Here's an example
rustcinvocation 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: