-
Notifications
You must be signed in to change notification settings - Fork 587
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
interpreters/python: create Python's config files dynamically and other tweaks #2982
interpreters/python: create Python's config files dynamically and other tweaks #2982
Conversation
By setting a specific region for the `_PyRuntime` structure, it is possible to move it to the external memory, for instance, freeing the internal memory (this structure occupies around 140KiB).
The `Setup.local` and the `config.site` files are used by Python's build system to, respectively, enable or disable Python's modules and set/unset available functions in the target system. These files are now set according to NuttX's configs, enabling or disabling Python's features according to the configs set on NuttX.
[Experimental Bot, please feedback here] Yes, this PR appears to meet the NuttX requirements. It provides a clear summary of the changes, their purpose, and how they work. The impact section is well-detailed, covering various aspects including user experience, build process, hardware, documentation, security, and compatibility. The testing section demonstrates verification on a relevant target (rv-virt:python) and provides build and run instructions along with example output, confirming the functionality. |
This wrapper application checks if the Python's modules are already mounted (and mounts them, if not), sets the necessary environment variables and, then, runs the Python interpreter.
This allows the data to be placed in the .rodata section, which can be allocated in the flash or other read-only storage, freeing the internal memory.
37fa08a
to
3e5448f
Compare
@lupyuen , |
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.
Thank you @tmedicci amazing work!! :-)
@tmedicci Sorry NuttX Build Farm doesn't support on-demand builds because: If NuttX has extra funding, we could probably: |
After apache/nuttx-apps#2982, there is no need to mount the modules and manually set the required environment variables: they are all set by the new Python wrapper application. Signed-off-by: Tiago Medicci Serrano <[email protected]>
After apache/nuttx-apps#2982, there is no need to mount the modules and manually set the required environment variables: they are all set by the new Python wrapper application. Signed-off-by: Tiago Medicci Serrano <[email protected]>
After apache/nuttx-apps#2982, there is no need to mount the modules and manually set the required environment variables: they are all set by the new Python wrapper application. Signed-off-by: Tiago Medicci Serrano <[email protected]>
After apache/nuttx-apps#2982, there is no need to mount the modules and manually set the required environment variables: they are all set by the new Python wrapper application. Signed-off-by: Tiago Medicci Serrano <[email protected]>
Summary
interpreters/python: add wrapper to initialize Python
interpreters/python: create Python's config files dynamically
Setup.local
and theconfig.site
files are used by Python's build system to, respectively, enable or disable Python's modules and set/unset available functions in the target system. These files are now set according to NuttX's configs, enabling or disabling Python's features according to the configs set on NuttX.interpreters/python: set ROMFS-generated data to const char
internal memory.
interpreters/python: add patch to set
_PyRuntime
section_PyRuntime
structure, it is possible to move it to the external memory, for instance, freeing the internal memory (this structure occupies around 140KiB).Impact
This PR provides a set of improvements that allow running Python on NuttX easily: it provides a wrapper that enables running the Python interpreter directly with
python
and enables it to be built by architectures other than the RISC-V QEMU. Documentation will be updated on NuttX's OS repository as soon as we merge this PR.Testing
Internal CI testing +
rv-virt:python
:Building
Running