Skip to content

Resurrect HelloBaremetal - #9296

Merged
alexreinking merged 2 commits into
alexreinking/apps-androidfrom
alexreinking/apps-baremetal
Aug 8, 2026
Merged

Resurrect HelloBaremetal#9296
alexreinking merged 2 commits into
alexreinking/apps-androidfrom
alexreinking/apps-baremetal

Conversation

@alexreinking

@alexreinking alexreinking commented Aug 6, 2026

Copy link
Copy Markdown
Member

The HelloBaremetal builds had bit-rotted and the code was insufficiently tested.

This fixes the builds, changes the runtime to Ubuntu's ARM toolchain, and adds a dedicated baremetal-apps job to testing-linux.yml. It installs an arm-none-eabi toolchain and QEMU, then actually builds and runs all three methods under semihosting via ctest.

Breaking changes

None

Checklist

  • Tests added or updated (not required for docs, CI config, or typo fixes)
  • Documentation updated (if public API changed)
  • Commits include AI attribution where applicable (see Code of Conduct)

Stack created with GitHub Stacks CLIGive Feedback 💬

@alexreinking alexreinking changed the title alexreinking/apps baremetal Resurrect HelloBaremetal Aug 6, 2026
@alexreinking
alexreinking marked this pull request as ready for review August 6, 2026 20:40
@alexreinking
alexreinking force-pushed the alexreinking/apps-baremetal branch from 4d40a7d to ae35237 Compare August 7, 2026 07:45
@alexreinking
alexreinking force-pushed the alexreinking/apps-baremetal branch 2 times, most recently from 7100ef1 to b835d26 Compare August 7, 2026 12:27
alexreinking and others added 2 commits August 7, 2026 22:05
The referenced README_cmake.md doesn't exist; the cross-compiling section
it pointed to lives in doc/HalideCMakePackage.md.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…om apps/CMakeLists.txt, add CI

Audited all three documented cross-compilation methods
(cmake-twice/cmake-super_build/cmake-external_project) plus each one's
"host target" build mode, and verified every one of them for real:
actual cross-compile with the arm-none-eabi toolchain, actual run under
QEMU with semihosting, not just a host build check. Along the way:

- CMAKE_PREFIX_PATH wasn't forwarded into cmake-super_build's and
  cmake-external_project's ExternalProject_Add sub-builds, breaking the
  documented host-target build for both.
- The NEON-enable trampoline and a getentropy syscall stub (needed
  because Ubuntu 24.04's arm-none-eabi-gcc/newlib pulls in
  std::random_device support transitively through libstdc++'s
  exception/COW-string machinery -- itself pulled in by ordinary
  std::set/std::string use in halide_image_io.h -- which rdimon.specs
  doesn't implement) are now a single cmake/noosrt.s, built once by the
  toolchain file itself and linked into every executable automatically
  via CMAKE_<LANG>_STANDARD_LIBRARIES, the same mechanism the toolchain
  already uses for libgcc/libc. The BAREMETAL variable and the
  per-project if(BAREMETAL) blocks that used to wire this in are gone.
- run_baremetal.sh quoted "${QEMU_MACHINE_ARGS}" as a single string
  instead of expanding it as separate arguments, so QEMU always
  rejected it as one bogus option -- this script never actually worked.
- cmake-twice and cmake-external_project no longer need their
  GEN_PACKAGE/GEN_EXE override plumbing (upstream's own default naming
  is sufficient); cmake-super_build keeps it as the one demo of that
  flexibility.
- Each run.sh was a one-line wrapper around run_baremetal.sh; replaced
  with a real CTest test (add_test + PASS_REGULAR_EXPRESSION
  "Success!"), guarded by CMAKE_CROSSCOMPILING so it only registers for
  the actual cross-compile, not the host-target build.
- Removed the top-level apps/HelloBaremetal/CMakeLists.txt: it only
  existed to be add_subdirectory()'d via the old
  add_app(HelloBaremetal), which is now gone.

Disconnects HelloBaremetal from apps/CMakeLists.txt (matching
HelloAndroid/HelloAndroidCamera2/HelloWasm) and adds a dedicated
baremetal-apps job to testing-linux.yml that installs an arm-none-eabi
toolchain and QEMU, then actually builds and runs all three methods
under semihosting via ctest.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@alexreinking
alexreinking force-pushed the alexreinking/apps-baremetal branch from b835d26 to 13a1ae6 Compare August 8, 2026 02:05
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.01%. Comparing base (12ea58c) to head (13a1ae6).

Additional details and impacted files
@@                      Coverage Diff                      @@
##           alexreinking/apps-android    #9296      +/-   ##
=============================================================
+ Coverage                      69.98%   70.01%   +0.03%     
=============================================================
  Files                            258      258              
  Lines                          77353    77353              
  Branches                       18837    18837              
=============================================================
+ Hits                           54137    54162      +25     
+ Misses                         17648    17630      -18     
+ Partials                        5568     5561       -7     

☔ View full report in Codecov by Harness.
📢 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.

@alexreinking
alexreinking merged commit a75a030 into main Aug 8, 2026
23 of 44 checks passed
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.

2 participants