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

Improve Linux experience for crank run --device #36

Merged
merged 5 commits into from
Feb 26, 2023
Merged

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented Feb 25, 2023

This addresses some of the comments in #12.

  • On Linux, don't wait for modem_path to disappear after initiating data disk mode, since (at least for me) it remains available.
  • On Linux, sleep before issuing pdutil run. Without a wait it was failing. I based this on the Windows case, but on my machine it required 1s instead of 500ms.
  • Print a message about pressing 'A' to exit Data Disk mode, after ejecting the Playdate, because I don't think the message on the Playdate screen is very clear about it, and crank is just waiting for the user.
  • Print a message about mounting the Playdate, in case the OS doesn't do so automatically.

For the last two items, I chose a println rather than a log message because logging isn't enabled in crank by default - I didn't want to change the logging strategy and thought these would be helpful for newer users/developers.

I confirmed that the simulator case still worked as expected, with no changes, and that the changes worked as described with --device.

    Finished release [optimized] target(s) in 1.80s
If your OS does not automatically mount your Playdate, please do so now.
eject: cannot open /dev/sda: Permission denied
Please press 'A' on the Playdate to exit Data Disk mode.

(The eject error is a separate issue mentioned in #12.)

These changes are in the cfg(unix) path, and so also affect Mac, but I don't have a Mac setup to test with - hoping for confirmation there.

For one developer, the device never disappears, even when the data disk
is prepared; it's unclear whether this is always true on Linux.
If called too early the run will fail.  Ideally, we'd know of a specific
marker that the device is ready to run...
@tjkirch
Copy link
Contributor Author

tjkirch commented Feb 25, 2023

I'm curious whether the "press 'A' to exit Data Disk mode" message is relevant on a Mac. The Playdate screen mentions ejecting, but ejecting on Linux doesn't exit Data Disk mode; does it on Mac? Do you have to press 'A' every time? If not, I could make that message Linux-specific.

@rtsuk
Copy link
Collaborator

rtsuk commented Feb 26, 2023

On Mac, neither message is needed, and the "Press 'A'" message never appears. I would like if you made both messages conditionally to only when not running on Mac.

I think it would also be good to bump the crank package version number, as at least in the past one needed to use install --force to reinstall the same version.

The message on the Playdate screen isn't as clear as it could be for
newer developers.  A message from crank makes it clearer that we're
waiting for their action.

On Mac, and presumably Windows, Data Disk mode is exited automatically
when the Playdate is ejected.
@tjkirch
Copy link
Contributor Author

tjkirch commented Feb 26, 2023

Thanks for the clarification! I made the messages Linux-only, and bumped the version. Testing looked the same.

@rtsuk rtsuk merged commit 61e2569 into pd-rs:main Feb 26, 2023
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

Successfully merging this pull request may close these issues.

2 participants