Xargo setup help

I'm trying to compile teensy-3-rust and no matter what I do I get errors when trying to compile anything.

I have nightly & stable x86_64-pc-windows-gnu & msvc installed with nightly gnu as my default.

I also have GNU Tools ARM Embedded 5.4 installed and in the path.

I'm on Windows 10. Here is what I'm getting. Pretty sure I'm doing something dumb. I'm trying for the thumb7em-none-eabi target.

W:\github\teensy-3-rust>xargo --verbose

  • "rustc" "--print" "sysroot"
  • "cargo" "build" "--release" "--manifest-path" "C:\Users\mattb\AppData\Local\Temp\xargo.l6l4l99iUH8i\Cargo.toml" "--target" "x86_64-pc-windows-gnu" "-v" "-p" "core"
    Compiling core v0.0.0 (file:///C:/Users/mattb/.rustup/toolchains/nightly-x86_64-pc-windows-gnu/lib/rustlib/src/rust/src/libcore)
    Running rustc C:\Users\mattb\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\src\rust\src\libcore\lib.rs --crate-name core --crate-type lib -C opt-level=3 -C metadata=45dc0497f6ad7d86 --out-dir C:\Users\mattb\AppData\Local\Temp\xargo.l6l4l99iUH8i\target\x86_64-pc-windows-gnu\release\deps --emit=dep-info,link --target x86_64-pc-windows-gnu -L dependency=C:\Users\mattb\AppData\Local\Temp\xargo.l6l4l99iUH8i\target\x86_64-pc-windows-gnu\release\deps --sysroot C:\Users\mattb\.xargo\HOST
    error: expected :, found ,
    --> C:\Users\mattb.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\src\rust\src\libcore\slice/mod.rs:1021:32
    |
    1021 | ops::RangeInclusive { start, end }
    | ^

error: expected identifier, found keyword type
--> C:\Users\mattb.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\src\rust\src\libcore\num\dec2flt\rawfp.rs:135:7
|
135 | ($type: ident) => {
| ^^^^

error: expected identifier, found keyword type
--> C:\Users\mattb.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\src\rust\src\libcore\num\dec2flt\rawfp.rs:145:41
|
145 | const INFINITY: Self = $crate::$type::INFINITY;
| ^^^^

error: expected identifier, found keyword type
--> C:\Users\mattb.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\src\rust\src\libcore\num\dec2flt\rawfp.rs:146:36
|
146 | const NAN: Self = $crate::$type::NAN;
| ^^^^

error: aborting due to 4 previous errors

error: Could not compile core.

Caused by:
process didn't exit successfully: rustc C:\Users\mattb\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\src\rust\src\libcore\lib.rs --crate-name core --crate-type lib -C opt-level=3 -C metadata=45dc0497f6ad7d86 --out-dir C:\Users\mattb\AppData\Local\Temp\xargo.l6l4l99iUH8i\target\x86_64-pc-windows-gnu\release\deps --emit=dep-info,link --target x86_64-pc-windows-gnu -L dependency=C:\Users\mattb\AppData\Local\Temp\xargo.l6l4l99iUH8i\target\x86_64-pc-windows-gnu\release\deps --sysroot C:\Users\mattb\.xargo\HOST (exit code: 101)
error: "cargo" "build" "--release" "--manifest-path" "C:\\Users\\mattb\\AppData\\Local\\Temp\\xargo.l6l4l99iUH8i\\Cargo.toml" "--target" "x86_64-pc-windows-gnu" "-v" "-p" "core" failed with exit code: Some(101)
note: run with RUST_BACKTRACE=1 for a backtrace

1 Like
  • "cargo" "build" "--release" "--manifest-path" "C:\Users\mattb\AppData\Local\Temp\xargo.l6l4l99iUH8i\Cargo.toml" "--target" "x86_64-pc-windows-gnu" "-v" "-p" "core"

"--target" "x86_64-pc-windows-gnu"

This says that you compiling the teensy3 crate for the host (x86_64 Windows). You actually want to cross compile the crate for the Teensy (ARM architecture). You'll probably have to call xargo build --target thumbv7m-none-eabi or xargo build --teensy3 if there's a teensy3.json file in the root of the Cargo project.

Thanks, I'll give that a try.