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

Expand pre-req instructions in hello_world readme. #351

Merged
merged 4 commits into from
May 10, 2024

Conversation

notpeter
Copy link
Contributor

@notpeter notpeter commented May 8, 2024

I took a stab at expanding the docs for getting started (hello world) to be explicit about some of the pre-reqs (gcc-arm, cmake, rust nightly, etc).

Related to: #90

@github-actions github-actions bot added docs Improvements or additions to documentation cargo About cargo or cargo-playdate labels May 8, 2024
cargo/README.md Outdated Show resolved Hide resolved
@boozook
Copy link
Owner

boozook commented May 9, 2024

@notpeter Thank you, that's really necessary!

Just FYI, the var PLAYDATE_SDK_PATH is highly desirable but not required. There are many different other ways to automatically find the SDK. Yes, the PLAYDATE_SDK_PATH is the best and most reliable way, but it is still optional.

@boozook
Copy link
Owner

boozook commented May 9, 2024

I suppose it would be good to note that rustup is not required for cargo-playdate as well as for other crates, but which way the nightly toolchain will be installed by the user is a personal matter for the user, I'm sure.
My point is that to recommending rustup is the right thing to do, but it would be nice to notice that this is just the easiest way to install nightly toolchain.
Of course I admit I could be wrong, please correct me if I am.

Co-authored-by: Alexander Koz. <888526+boozook@users.noreply.github.com>
@notpeter
Copy link
Contributor Author

notpeter commented May 9, 2024

Yeah, the auto-detection code didn't work for me on MacOS, I was going to do a separate PR to fix it. MacOS is $HOME/Developer/PlaydateSDK and windows is $USERPROFILE/Documents/PlaydateSDK.

As for rustup nightly for cargo-playdate, if I understand you right, only the playdate-* crates which bind to C require nightly but some of cargo playdate works under stable. Gotcha. I don't think it's worth having that distinction because even in the hello world example, cargo playdate run requires nightly:

PS C:\Users\peter\code\pd-hello> cargo playdate run
error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
error: process exited unsuccessfully: exit code: 101

I was mostly focused on trying to have instructions where someone could go from 0 to an app running on the simulator. I honestly have barely used these crates (previously made some demos crankstart) and so am still figuring things out and have almost zero experience with using nightly.

@boozook
Copy link
Owner

boozook commented May 9, 2024

As for rustup nightly for cargo-playdate, if I understand you right, only the playdate-* crates which bind to C require nightly but some of cargo playdate works under stable. Gotcha.

You're right, but I mean that there are some amount of users that don't have rustup. cargo-playdate handle it and can work without rustup, just nightly toolchain needed. So rustup is recommended but not required.

@boozook
Copy link
Owner

boozook commented May 9, 2024

...have almost zero experience with using nightly.

TL;DR: Nightly is the same as stable, but also contains

  • Scary experimental features
  • Features that waiting stabilization (feedback period of near)
  • Features that forever will be in nightly

That's all, kind of. So don't be afraid.

@boozook
Copy link
Owner

boozook commented May 9, 2024

I was mostly focused on trying to have instructions where someone could go from 0 to an app running on the simulator.

Somewhere here in readme is row about command cargo playdate new and init. It's mostly the same as cargo new (and init).
So minimal command list could be like this:

  • cargo +nightly playdate new name ...
  • cd name
  • cargo +nightly check needed because cargo-playdate is configured so to minimize touching your cargo cache (we have issue about this Hello world example seems to be broken #349)
  • cargo +nightly playdate run

Also there are options to create project with bin (executable binary) instead of (or with) library. You can build it without arm-gcc and hopefully get more optimized product with --no-gcc argument.

I hope it helps.

boozook
boozook previously approved these changes May 9, 2024
@boozook boozook merged commit a95f5e4 into boozook:main May 10, 2024
36 checks passed
@notpeter notpeter deleted the hello_world_docs branch June 5, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cargo About cargo or cargo-playdate docs Improvements or additions to documentation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants