[FEATURE] Python on NuttX: known issues, "TO-DO" list, and general enhancements
@tmedicci is already working on this.
Since Dec 9, 2024.
Assessment
This issue has not been assessed yet.
Description
Is your feature request related to a problem? Please describe.
After https://github.com/apache/nuttx-apps/pull/2879 was merged, it's time to make Python on NuttX fully usable!
This issue intends to discuss the next steps required to make it fully functional, including a "To-Do" list and any discussions on how it would evolve to support other architectures and platforms.
Initial Considerations
- Python for NuttX target initially the
rv-virt(RISC-V QEMU). That being said, itsinterpreters/python/config.siteandinterpreters/python/Setup.localare somehow tied with the features enabled by theboards/risc-v/qemu-rv/rv-virt/configs/cpython/defconfig. Python for NuttX depends onCONFIG_EXPERIMENTAL! - Python modules are stored in
pyc(byte-code format) and are loaded from a ROMFS image at startup. - Environment variables like
PYTHONHOMEandPYTHON_BASIC_REPLneeds to be set accordingly.
Describe the solution you'd like
TO-DO list:
This is the list of the next steps to make Python's port fully functional (sorted by highest priority):
- Provide a CMake-based build: currently we can only build it using
Make. - Generate
interpreters/python/Setup.localandinterpreters/python/config.sitedynamically according to the enabled configs. For instance:export ac_cv_func_pipe="yes"depends onCONFIG_PIPESbeing enabled. - Create a wrapper application to automate the 1) mounting the ROMFS image with the Python's modules, 2) setting the environment variables and 3) running the
Program/python.capp. - Support Python's socket module. This is one of the most important modules to enable Python applications with POSIX-compatible sockets .
Known Issues
- Check why enabling the optimization fails to generate coherent code for
Python/Modules/getpath.c. Reported at https://github.com/apache/incubator-nuttx-apps/blob/efc1bf710c8be1e0f0ae5e1bf2b292f8b57076a6/interpreters/python/Makefile#L86 (valid forriscv-none-elf-gcc (xPack GNU RISC-V Embedded GCC x86_64) 13.2.0)
Describe alternatives you've considered
No response
Verification
- I have verified before submitting the report.
- Dominant language
- C
- Stars
- 465
- Forks
- 782
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 44
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/nuttx-apps
-
Type: Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apache/nuttx-apps#3620 · 5 comments · 1 reaction ·
-
Type: Bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
apache/nuttx-apps#3634 · 1 comment ·
-
apache/nuttx-apps#3436 · 1 assignee ·
-
[FEATURE/SECURITY/BUG] Add hash key validation to check the files downloaded from external projects OpenType: Bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/nuttx-apps#3418 ·
-
Type: Bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
apache/nuttx-apps#3407 · 14 comments ·
All issues in apache/nuttx-apps
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·