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

Allow custom compiled in code.py contents #10073

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

todbot
Copy link

@todbot todbot commented Feb 16, 2025

This PR allows a one-line code.py to be specified in a port's mpconfigboard.mk so a product's full firmware can be built in CI. The intended use is something like the following in mpconfigboard.mk:

FROZEN_MPY_DIRS += $(TOP)/ports/raspberrypi/boards/raspberry_pi_pico_todbot
CIRCUITPY_CODEPY_CONTENTS="import some_awesome_code\n"

and then some_awesome_code.py located in the port's directory contains what would normally be code.py.
(I would rather we have the ability to specify a folder to copy over with code.py, /lib, settings.toml, etc. but this is what I've been using internally for some projects)

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People have been doing this "by hand" before. This is fine with me.

@dhalbert dhalbert requested a review from tannewt February 16, 2025 20:52
@tannewt
Copy link
Member

tannewt commented Feb 18, 2025

This would be ok with me but I'm not sure it is actually what you want. These are really default contents that are stored forever in the firmware. Instead, I suspect you want an easy way to provide a CIRCUITPY image to install alongside a version of CircuitPython. #10074 is a better place to discuss options.

I suspect this will crash the Zephyr ports because they don't use make and won't have the new define. We should test that if we want to actually merge this.

@todbot
Copy link
Author

todbot commented Feb 18, 2025

[...] I suspect you want an easy way to provide a CIRCUITPY image to install alongside a version of CircuitPython. #10074 is a better place to discuss options.

Yep, as mentioned in #10074 having a CIRCUITPY image maker is really what's wanted. This PR was a stop-gap to solve the problem I've seen people ask for (and I've been using) for several years.

@tannewt
Copy link
Member

tannewt commented Feb 19, 2025

Are you ok if I close this PR then?

@todbot
Copy link
Author

todbot commented Feb 19, 2025

Sure I guess. I'll continue to maintain my fork that has this patch for my own work since it seems others don't want this.

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.

3 participants