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

Xargo bombs with "no such file or directory" when compiling crates #158

Closed
cr1901 opened this issue Aug 15, 2017 · 4 comments
Closed

Xargo bombs with "no such file or directory" when compiling crates #158

cr1901 opened this issue Aug 15, 2017 · 4 comments

Comments

@cr1901
Copy link

cr1901 commented Aug 15, 2017

I suspect this is xargo because the crates I had to compile to run xargo successfully in the first place compiled without issue. Below is an example invocation. I can also duplicate this with the msp430-quickstart repository.

william@xubuntu-dtrain:~/Projects/AT2XT$ make
xargo build --release --target=msp430-none-elf --verbose
+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ "cargo" "build" "--release" "--manifest-path" "/tmp/xargo.byJFtu8n3Sqm/Cargo.toml" "--target" "msp430-none-elf" "-v" "-p" "core"
   Compiling core v0.0.0 (file:///home/william/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore)
     Running `rustc --crate-name core /home/william/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=64a816d530f10be4 -C extra-filename=-64a816d530f10be4 --out-dir /tmp/xargo.byJFtu8n3Sqm/target/msp430-none-elf/release/deps --target msp430-none-elf -L dependency=/tmp/xargo.byJFtu8n3Sqm/target/msp430-none-elf/release/deps -L dependency=/tmp/xargo.byJFtu8n3Sqm/target/release/deps -C link-arg=-Tlink.x -C link-arg=-mmcu=msp430g2211 -C link-arg=-nostartfiles -C link-arg=-lmul_none -C opt-level=s --sysroot /home/william/.xargo -Z force-unstable-if-unmarked`
error: linking with `msp430-elf-gcc` failed: exit code: 1
  |
  = note: "msp430-elf-gcc" "-mcpu=msp430" "-c" "-o" "/tmp/xargo.byJFtu8n3Sqm/target/msp430-none-elf/release/deps/core-64a816d530f10be4.o" "/tmp/xargo.byJFtu8n3Sqm/target/msp430-none-elf/release/deps/core-64a816d530f10be4.s"
  = note: msp430-elf-gcc: error: /tmp/xargo.byJFtu8n3Sqm/target/msp430-none-elf/release/deps/core-64a816d530f10be4.s: No such file or directory
          msp430-elf-gcc: fatal error: no input files
          compilation terminated.
          

error: aborting due to previous error

error: Could not compile `core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name core /home/william/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=64a816d530f10be4 -C extra-filename=-64a816d530f10be4 --out-dir /tmp/xargo.byJFtu8n3Sqm/target/msp430-none-elf/release/deps --target msp430-none-elf -L dependency=/tmp/xargo.byJFtu8n3Sqm/target/msp430-none-elf/release/deps -L dependency=/tmp/xargo.byJFtu8n3Sqm/target/release/deps -C link-arg=-Tlink.x -C link-arg=-mmcu=msp430g2211 -C link-arg=-nostartfiles -C link-arg=-lmul_none -C opt-level=s --sysroot /home/william/.xargo -Z force-unstable-if-unmarked` (exit code: 101)
error: `"cargo" "build" "--release" "--manifest-path" "/tmp/xargo.byJFtu8n3Sqm/Cargo.toml" "--target" "msp430-none-elf" "-v" "-p" "core"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 1

william@xubuntu-dtrain:~/Projects/AT2XT$ xargo --version
xargo 0.3.8
cargo 0.22.0-nightly (7704f7b1f 2017-08-09)
william@xubuntu-dtrain:~/Projects/AT2XT$ rustc --version
rustc 1.21.0-nightly (df511d554 2017-08-14)
william@xubuntu-dtrain:~/Projects/AT2XT$ uname -a
Linux xubuntu-dtrain 4.10.0-32-generic #36~16.04.1-Ubuntu SMP Wed Aug 9 09:19:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Here are the contents of the xargo directory while core is being compiled (same idea, different invocation):

/tmp/xargo.kkQrYRvEDdi8:
total 16
-rw-rw-r-- 1 william william  122 Aug 14 23:52 Cargo.lock
-rw-rw-r-- 1 william william  270 Aug 14 23:52 Cargo.toml
drwxrwxr-x 2 william william 4096 Aug 14 23:52 src
drwxrwxr-x 4 william william 4096 Aug 14 23:52 target

/tmp/xargo.kkQrYRvEDdi8/src:
total 0
-rw-rw-r-- 1 william william 0 Aug 14 23:52 lib.rs

/tmp/xargo.kkQrYRvEDdi8/target:
total 8
drwxrwxr-x 3 william william 4096 Aug 14 23:52 msp430-none-elf
drwxrwxr-x 8 william william 4096 Aug 14 23:52 release

/tmp/xargo.kkQrYRvEDdi8/target/msp430-none-elf:
total 4
drwxrwxr-x 8 william william 4096 Aug 14 23:52 release

/tmp/xargo.kkQrYRvEDdi8/target/msp430-none-elf/release:
total 20
drwxrwxr-x 2 william william 4096 Aug 14 23:52 build
drwxrwxr-x 2 william william 4096 Aug 14 23:52 deps
drwxrwxr-x 2 william william 4096 Aug 14 23:52 examples
drwxrwxr-x 2 william william 4096 Aug 14 23:52 incremental
drwxrwxr-x 2 william william 4096 Aug 14 23:52 native

/tmp/xargo.kkQrYRvEDdi8/target/msp430-none-elf/release/build:
total 0

/tmp/xargo.kkQrYRvEDdi8/target/msp430-none-elf/release/deps:
total 32
-rw-rw-r-- 1 william william 29644 Aug 14 23:52 core-64a816d530f10be4.d

/tmp/xargo.kkQrYRvEDdi8/target/msp430-none-elf/release/examples:
total 0

/tmp/xargo.kkQrYRvEDdi8/target/msp430-none-elf/release/incremental:
total 0

/tmp/xargo.kkQrYRvEDdi8/target/msp430-none-elf/release/native:
total 0

/tmp/xargo.kkQrYRvEDdi8/target/release:
total 20
drwxrwxr-x 2 william william 4096 Aug 14 23:52 build
drwxrwxr-x 2 william william 4096 Aug 14 23:52 deps
drwxrwxr-x 2 william william 4096 Aug 14 23:52 examples
drwxrwxr-x 2 william william 4096 Aug 14 23:52 incremental
drwxrwxr-x 2 william william 4096 Aug 14 23:52 native

/tmp/xargo.kkQrYRvEDdi8/target/release/build:
total 0

/tmp/xargo.kkQrYRvEDdi8/target/release/deps:
total 0

/tmp/xargo.kkQrYRvEDdi8/target/release/examples:
total 0

/tmp/xargo.kkQrYRvEDdi8/target/release/incremental:
total 0

/tmp/xargo.kkQrYRvEDdi8/target/release/native:
total 0

Only the dependencies (?) .d file ends up in this directory where the object and assembly files should be emitted. So indeed, rustc can't find the objects to pass to the msp430 assembler. What I haven't figured out yet is: "where did the assembler output go?"

@kivikakk
Copy link

Can confirm I see this too. Here's the output from an attempted build of msp430-quickstart; looks basically the same, but just in case it's helpful. (build host is macOS)

$ xargo build --verbose
+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ "cargo" "build" "--release" "--manifest-path" "/var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/Cargo.toml" "--target" "msp430-none-elf" "-v" "-p" "core"
   Compiling core v0.0.0 (file:///Users/kivikakk/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore)
     Running `rustc --crate-name core /Users/kivikakk/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=b0cb4fa932d9e93e -C extra-filename=-b0cb4fa932d9e93e --out-dir /var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/target/msp430-none-elf/release/deps --target msp430-none-elf -L dependency=/var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/target/msp430-none-elf/release/deps -L dependency=/var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/target/release/deps -C link-arg=-nostartfiles -C link-arg=-Tlink.x --sysroot /Users/kivikakk/.xargo -Z force-unstable-if-unmarked`
error: linking with `msp430-elf-gcc` failed: exit code: 1
  |
  = note: "msp430-elf-gcc" "-mcpu=msp430" "-c" "-o" "/var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/target/msp430-none-elf/release/deps/core-b0cb4fa932d9e93e.o" "/var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/target/msp430-none-elf/release/deps/core-b0cb4fa932d9e93e.s"
  = note: msp430-elf-gcc: error: /var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/target/msp430-none-elf/release/deps/core-b0cb4fa932d9e93e.s: No such file or directory
          msp430-elf-gcc: fatal error: no input files
          compilation terminated.


error: aborting due to previous error

error: Could not compile `core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name core /Users/kivikakk/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=b0cb4fa932d9e93e -C extra-filename=-b0cb4fa932d9e93e --out-dir /var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/target/msp430-none-elf/release/deps --target msp430-none-elf -L dependency=/var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/target/msp430-none-elf/release/deps -L dependency=/var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/target/release/deps -C link-arg=-nostartfiles -C link-arg=-Tlink.x --sysroot /Users/kivikakk/.xargo -Z force-unstable-if-unmarked` (exit code: 101)
error: `"cargo" "build" "--release" "--manifest-path" "/var/folders/57/6bcdkjmj7zz1zm5t_7fyn0y40000gn/T/xargo.ANZYoQs0mwbP/Cargo.toml" "--target" "msp430-none-elf" "-v" "-p" "core"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace

And the backtrace:

stack backtrace:
   0:        0x103830bce - backtrace::backtrace::trace::h0f497b1bcba29b5f
   1:        0x103830c0c - backtrace::capture::Backtrace::new::h7c68c9466c6ae5c9
   2:        0x1038302a6 - error_chain::make_backtrace::h20f55bd347aa1bfe
   3:        0x103830368 - _$LT$error_chain..State$u20$as$u20$core..default..Default$GT$::default::hc4a17d73ac756ba0
   4:        0x103819975 - xargo::sysroot::update::hbe5628cfed21c0fa
   5:        0x1038235f0 - xargo::run::he83b978444922056
   6:        0x10381f69f - xargo::main::h59bc5ba11103c3e5
   7:        0x10387371e - __rust_maybe_catch_panic
   8:        0x103868b58 - std::rt::lang_start::h04a8930cf31652a8

@japaric
Copy link
Owner

japaric commented Nov 26, 2017

Looks like rust-lang/rust#45836. This is something that has to be fixed in rustc.

@kivikakk
Copy link

msp430 build looks fine on lastest nightly now that rust-lang/rust#45836 is in! 👍

(The compile for the msp430-rtfm-macros crate fails because of nightly changes, but I think this issue is resolved.)

@japaric
Copy link
Owner

japaric commented Jan 27, 2018

@kivikakk thanks for reporting! Let's close this then.

@japaric japaric closed this as completed Jan 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants