-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Supervisor: create code.py file with sample code #2299
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
Supervisor: create code.py file with sample code #2299
Conversation
You may be able to save space by creating an empty file for small boards instead of one with basic code. |
@tannewt I'm not sure how to do that, any pointers will be appreciated :) |
Besides my comments directly on the code, a build failed:
|
Thanks @jepler for the review comments and suggestions. I'll push the changes as requested soon. |
@iayanpahwa It would be something like: #if CIRCUITPY_FULL_BUILD == 0
make_empty_file(&vfs_fat->fatfs, "/code.py");
#else
make_sample_code_file(&vfs_fat->fatfs);
#endif |
@tannewt tried what you suggested, It's breaking builds on some boards. Any idea? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the failed builds was arduino_mkr1300
so in ports/atmel-samd
you can make BOARD=arduino_mkr1300
to check that your changes have fixed the errors that were detected during CI. (I didn't look at other builds, but most likely they all have the same underlying cause)
@jepler pushed the fix. Build still failing for pirkey_mo, what do you suggest we do now?
|
Now, the error is
The main option now is to do as @deshipu suggested and do not enable any new feature (including creating a zero-length code.py file) on (CIRCUITPY_FULL_BUILD == 0) boards. So the code would become something like
specifically without the make_empty_file call. As before you can make |
@jepler guess that's our only option now :) |
@jepler should it be:
? The CIRCUITPY_FULL_BUILD == 0 means build for express boards? |
Right, I had it backwards. (edited the original comment so it is correct now, I hope) |
|
wow this build passed on my machine :/ |
Sit tight. I'm freeing up some space in pIRkey with PR #2328. |
@tannewt seems like a plan :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me now. I reviewed the issue discussion: I didn't realize it was consensus to avoid writing the file completely on non-full builds.
@iayanpahwa I think we could now have this on by default, after the pirkey fix, even for small boards, and for @deshipu and others who need every last byte, it could still be turned off. I think it would be better for the standard boards to be consistent about this. |
@dhalbert sounds good to me. Let me know what do to next. |
Addresses Issue #2149
Create a sample code.py file during board flashing with a print hello world program. Tested on CircuitPlayground Express Board.
To-Do's:
1- Add compiler flags to disable this feature on non-express / limited memory boards
2- Error handling when fail to write the file for any reason