Closed Gregoor closed 4 years ago
rustc --version
? I know that nightly-2020-07-27 works on Linux at least, and you need at least nightly-2020-07-24 (or maybe -23?) for it to build. I'm not running any nightly later than nightly-2020-07-27 yet, as rustfmt isn't available for it.
Huh! I was running on 2020-07-25, a rustup update nightly
gave me 2020-07-26 which didn't fix it yet. I guess I'll try another update tomorrow or will install it without rustup
!
And you've pulled this repository since this commit 5 days ago, right?
Yup, I'm on c8bde5f4b33835fe85160828a334088532876184
Huh, never seen that one before ... Looks strange to say the least. On first glance I'd say you are compiling for the wrong target but that doesn't seem to be the case ... Things to come to mind:
cargo build --verbose --examples
, maybe there's a hint hidden somewhere ....cargo/config.toml
in boards/arduino-uno
exists and has the contents shown here on GitHub.avr-gcc
, avr-binutils
, and avr-libc
installed? Can you also show what versions?cargo update
in case you are pulling in an old dependency in some weird way.
Cargo.lock
+ target/
directory + possibly sccache
directory (if you're using that).I'm not sure if I have avr-binutils
installed but the rest I've got from WINAVR which is.. adjusts glasses ... from 2010:
$ avr-gcc --version
avr-gcc.exe (WinAVR 20100110) 4.3.3
$ avr-cpp.exe --version
avr-cpp.exe (WinAVR 20100110) 4.3.3
Oh also I realized I might've not run it from the right dir? From the uno dir I get:
grego@Dellste MSYS ~/code/avr-hal/boards/arduino-uno (master)
$ cargo +nightly build --example uno-blink
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --target '\\?\C:\Users\grego\code\avr-hal\boards\arduino-uno\avr-atmega328p.json' --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
--- stderr
error: Error loading target specification: SyntaxError(InvalidSyntax, 1, 1). Use `--print target-list` for a list of built-in targets
Can't say that I learned anything from that error yet. My .cargo/config.toml is the same as in master indeed.
Ok, it looks like Rust isn't picking up on the target. I wonder if that's because NTFS doesn't like the fact that avr-atmega328p.json
in boards/arduino-uno is a symlink? Try replacing the file boards/arduino-uno/avr-atmega328p.json with chips/atmega328p-hal/avr-atmega328p.json (just copy it).
Oh I don't know how you got that from that but it seemed to have done the trick. Thank you for looking into it with me. Anything I can do to prevent other NTFS-people from running into it?
I figured that out because the 6th line in you last code block indicated that it had trouble reading the file, and seeing the path \\?\C:\Users\grego\code\avr-hal\boards\arduino-uno\avr-atmega328p.json
made me think that maybe some weird Windows FS thing was going on.
It turns out that Windows still doesn't support symlinks by non-admin users by default, wtf! To fix this (stolen from StackOverflow):
git config --global core.symlinks true
git checkout -b temp && git checkout master
)@Rahix, we should either document this or remove symlinks.
It turns out that Windows still doesn't support symlinks by non-admin users by default, wtf!
What a mess ...
@Rahix, we should either document this or remove symlinks.
Right, I'll think about it. Now that we can use .cargo/config.toml
for naming the target json files, I think it would be okay to do without the symlinks. Previously this would mean additional work because you'd have to export RUSTC_TARGET_PATH
and I wanted it easy with export RUSTC_TARGET_PATH=$(pwd)
instead of export RUSTC_TARGET_PATH=/path/to/wherevever/the/actual/target/file/is/
.
It turns out that Windows still doesn't support symlinks by non-admin users by default, wtf! To fix this (stolen from StackOverflow):
- Enable "Developer mode" in Windows 10
git config --global core.symlinks true
- re-clone this repo, or switch to another branch and back (
git checkout -b temp && git checkout master
)
Yup that worked too! Though a branch switch wasn't enough for me, had to re-clone. Thanks again :)
No more symlinks in this repository so hopefully no more build-issues on windows!
Heya,
just checked this out on Windows 10 with rust 1.47.0-nightly and tried to run the uno-blink example but got:
Same problem in WSL 2 Ubuntu with the same rust version. Any pointers would be appreciated, maybe it's something I could look at myself.