Skip to content

tools/ci.sh: Enable a few more natmod tests on rv32imc and xtensa.#17379

Closed
dpgeorge wants to merge 1 commit into
micropython:masterfrom
dpgeorge:tools-ci-enable-more-natmod-build-tests
Closed

tools/ci.sh: Enable a few more natmod tests on rv32imc and xtensa.#17379
dpgeorge wants to merge 1 commit into
micropython:masterfrom
dpgeorge:tools-ci-enable-more-natmod-build-tests

Conversation

@dpgeorge
Copy link
Copy Markdown
Member

Summary

The btree natmod example can now build for rv32imc, and random can build for xtensa if it's linked with the standard C library.

Testing

Tested by CI.

@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label May 28, 2025
@github-actions
Copy link
Copy Markdown

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base (5cfafb7) to head (780621b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17379   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files         169      169           
  Lines       21898    21898           
=======================================
  Hits        21579    21579           
  Misses        319      319           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dpgeorge dpgeorge force-pushed the tools-ci-enable-more-natmod-build-tests branch 3 times, most recently from 5bf9a4d to 0866dda Compare May 28, 2025 08:59
@agatti
Copy link
Copy Markdown
Contributor

agatti commented May 28, 2025

@dpgeorge The errno fix may not be specific to RV32 but rather to Ubuntu's 24.04 packaged picolibc libraries. Chances are it is also needed on Arm using the same distro's picolibc package (and on Xtensa if you want to use the LX106 picolibc package too).

@dpgeorge dpgeorge force-pushed the tools-ci-enable-more-natmod-build-tests branch 3 times, most recently from 8d0d5af to 8f715fc Compare May 28, 2025 15:34
The `btree`, `deflat`, `framebuf` and `random` natmod examples can now
build for xtensa if they are linked with the standard C library.

Signed-off-by: Damien George <[email protected]>
@dpgeorge dpgeorge force-pushed the tools-ci-enable-more-natmod-build-tests branch from 07c9804 to 780621b Compare May 28, 2025 16:24
@dpgeorge
Copy link
Copy Markdown
Member Author

The errno fix may not be specific to RV32 but rather to Ubuntu's 24.04 packaged picolibc libraries.

@agatti thanks for the hint, but I gave up on getting things working with RV32. I don't think it's possible with the picolibc used by the CI (although on my local machine with nano.specs it builds fine).

But I did get everything building for xtensa, just by linking with the libc runtime. Take a look now and see what you think.

@agatti
Copy link
Copy Markdown
Contributor

agatti commented May 28, 2025

The Xtensa changes sort of clash with #17091, as in they bring in symbols from libc/libgcc/libm that with #17091 would be picked up from ROM whenever possible. Maybe for ESP32-series MCUs it's less of an issue (even though pretty much every chip has parts of stdio/libc in ROM, see components/esp-rom/<mcu>/ld/<mcu>.rom.{libgcc,newlib*,syscalls}.ld files in ESP-IDF), but on an 8266 saving memory is almost always worthwhile.

That doesn't fully invalidate said PR, but defaulting to libc/libgcc/libm symbols doesn't exercise the PR changes in an automated fashion (I'll have to remove the makefile changes and symbol list fragments from natmods as they aren't useful anymore).

For RV32, I actually got the Ubuntu version wrong - I meant 22.04, but I see the workflow is running on 24.04 now and still has the same issue. Maybe it'd be easier to patch the berkeleydb submodule to add a picolibc+tls compatible definition of errno instead?

@dpgeorge
Copy link
Copy Markdown
Member Author

The Xtensa changes sort of clash with #17091

Oh, yes, it does indeed. Sorry I kind of forgot about #17091 in this context 😅

I can see the changes in this PR are almost exactly a sub-set of #17091 (the only difference is LINK_RUNTIME=1 is only set here for xtensa, whereas in #17091 it's unconditionally set).

So I'll close this PR then, and we can continue the xtensa discussion over in #17091.

For RV32, I actually got the Ubuntu version wrong - I meant 22.04, but I see the workflow is running on 24.04 now and still has the same issue. Maybe it'd be easier to patch the berkeleydb submodule to add a picolibc+tls compatible definition of errno instead?

Oh, if we could patch berkeleydb to improve the way it uses errno, that would be great! Do you want to have a look at doing that?

@dpgeorge dpgeorge closed this May 29, 2025
@dpgeorge dpgeorge deleted the tools-ci-enable-more-natmod-build-tests branch May 29, 2025 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Relates to tools/ directory in source, or other tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants