-
Notifications
You must be signed in to change notification settings - Fork 24
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
Hardware Build Fails with Playdate SDK 1.13.1 #30
Comments
For whatever reason, I'm stuck at rustc 1.68.0-nightly (b70baa4f9 2022-12-14) on the Mac. Does this occur with that version of the Rust toolchain? |
Short answer, yes.
The above list of commands results in the same error. Note that my exact version of 1.68.0-nightly is slightly different from the one you are stuck at. |
What version of MacOS? |
$ ex -s +'%s/<[^>].\{-}>//ge' +'%s/\s\+//e' +'%norm J' +'g/^$/d' +%p +q! /System/Library/CoreServices/SystemVersion.plist | grep -E 'ProductName|ProductVersion' | sed 's/^[^ ]* //g' | sed 'N; s/\n/ /g'
macOS 11.7.4
$ uname -vm
Darwin Kernel Version 20.6.0: Fri Dec 16 00:35:00 PST 2022; root:xnu-7195.141.49~1/RELEASE_X86_64 x86_64
$ sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz |
Ah, I'm on macOS 12 on my desktop. Perhaps that's why I don't see it. |
Does |
Yes. |
It works on my newer MacBook, but fails on the older iMac. MacBook details below. Not sure what the problem is, but it is not SDK 1.13.1. $ ex -s +'%s/<[^>].\{-}>//ge' +'%s/\s\+//e' +'%norm J' +'g/^$/d' +%p +q! /System/Library/CoreServices/SystemVersion.plist | grep -E 'ProductName|ProductVersion' | sed 's/^[^ ]* //g' | sed 'N; s/\n/ /g'
macOS 12.6
$ uname -vm
Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64
$ sysctl -n machdep.cpu.brand_string
Apple M1 Max
$ cat $PLAYDATE_SDK_PATH/VERSION.txt
1.13.1
$ rustc -V
rustc 1.67.0-nightly (c97b539e4 2022-11-30) |
I am starting to think it is a Rust bug in that most recent nightly. |
No contest. Without doing any deep digging, <T as core::convert::TryInto>::try_into appears to be implicitly called, but the function is not making it into the binary. Reverting to older versions of Rust on the desktop does not seem to solve the problem though, so I do not know what is going on. |
A couple of questions.
|
Crankstart uses a custom allocator, which is nightly-only. https://doc.rust-lang.org/std/alloc/trait.Allocator.html Running on device worked last week, when I updated to SDK 1.13. I've not plugged it in again since. |
There's stabled custom allocator error handler. I'm not sure that is it but I'll look in in couple of days on latest macOS M1. |
Getting the same error here if I can be of any help testing things. M1 Max, Playdate SDK 1.13.1, MacOS 13.2.1, rustc 1.70.0-nightly (8a73f50d8 2023-03-11) First go with crankstart, so I can't say when it stopped working. |
FWIW, someone I asked thought that it might have to do with the |
It was necessary when I first wrote crank and crankstart, but perhaps it no longer is. It's worth trying to remove it and see what happens. |
Removing |
This seems to be a semi-recent regression in nightly (I use stable 1.67.1 with crank/crankstart and do not experience this issue). See rust-lang/rust#108392 and rust-lang/rust#108853 Judging by the latter, it looks like turning off LTO on the build would get it to work correctly until it is fixed |
Opened up a PR (pd-rs/crank#37) to remove |
If stable works, using stable instead of nightly strikes me as the best solution. (On the macOS 11.7.4 x86_64, stable 1.68.0 (2c8cc3432 2023-03-06) is not working for me. Same error.)
Since this may go back and forth, maybe it makes sense to add a flag to crank, and then add a note about the flag? |
Stable should not work, for the reason I mention about about the need for a custom allocator. When building for device, Crank specifies nightly on the cargo command line.. I'd rather not have a switch here. If -z build-std is no longer needed, lets just remove it. |
Ah, I actually forgot that I, uh, may have been setting
I'll try to make a PR to let people specify extra Cargo flags in general instead, which would allow adding |
New version of crank confirmed to be working on my machine. When using stable, compiling for hardware worked, but compiling for the simulator failed. Using an earlier version of rust failed when using the prior version of crank, so I suspect that the hardware build strategy is doing something with a false assumption baked in. I have not looked at the code to diagnose anything. |
What do you mean by using stable? |
$ rustup default stable
$ cargo clean
$ crank build --release --device
*snip*
Finished release [optimized] target(s) in 19.82s
$ crank build --release
*snip*
error[E0554]: `#![feature]` may not be used on the stable release channel
--> ~/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cstr_core-0.1.2/src/lib.rs:12:40
|
12 | #![cfg_attr(feature = "alloc", feature(alloc))]
| ^^^^^
For more information about this error, try `rustc --explain E0554`.
error: could not compile `cstr_core` due to previous error
warning: build failed, waiting for other jobs to finish...
Error: cargo failed with error ExitStatus(unix_wait_status(25856))
$ rustup default nightly
$ cargo clean
$ crank build --release --device
*snip*
Finished release [optimized] target(s) in 19.82s
$ crank build --release
*snip*
Finished release [optimized] target(s) in 12.80s |
@sgeos, crank internally requests nightly for the rustup cargo bin (via So when it succeeds to actually build for the device, it's still using nightly instead of the default toolchain (try uninstalling the nightly toolchain instead of just changing the default to confirm this) |
Build fails on hardware with Playdate SDK 1.13.1. The build worked last time I checked with 1.12.X. My device did not get the 1.13.0 update.
All examples and the Klondike solitaire application fail with the above error. They all run fine in the simulator.
The text was updated successfully, but these errors were encountered: