Skip to content

Add BL616 TangCore build smoke test + reference libchdr integration - #175

Merged
rtissera merged 2 commits into
masterfrom
ci/bl616-tangcore-build
Aug 25, 2026
Merged

Add BL616 TangCore build smoke test + reference libchdr integration#175
rtissera merged 2 commits into
masterfrom
ci/bl616-tangcore-build

Conversation

@rtissera

Copy link
Copy Markdown
Owner

Summary

  • Compile+link CI smoke test against the real Xuantie/T-Head toolchain and nand2mario's real bouffalo_sdk fork/firmware-bl616 (the onboard BL616 companion MCU on Sipeed Tang Console 60K / Primer 25K), not the vanilla riscv64-unknown-elf-gcc proxy rv32-ram-budget.yml uses.
  • contrib/tangcore-bl616/chd/chd_fatfs.{h,c} - original core_file_callbacks bridge onto FatFS (BSD-3-Clause, no third-party content).
  • contrib/tangcore-bl616/patches/ - a small unified diff against firmware-bl616's CMakeLists.txt/main.cpp (Apache-2.0, © nand2mario), applied via git apply at CI time against a pinned commit - not a copy of his files, see contrib/tangcore-bl616/README.md for the full licensing rationale.
  • Pinned to fixed commits of toolchain_gcc_t-head_linux/bouffalo_sdk/firmware-bl616 since those are repos we don't control.

No BL616 hardware in CI, so this proves the real toolchain/SDK/firmware combination keeps compiling and fully linking libchdr in - not that chd_open()/chd_read() work at runtime.

Test plan

  • Full pipeline dry-run locally end-to-end (clone → patch → vendor → build), byte-identical to a from-scratch run
  • Patch verified to git apply --check cleanly and reproduce identical files against the pinned firmware-bl616 commit
  • Idempotency verified: ran the vendor+patch step twice in a row (simulating a cache-hit run) with no failure
  • Real link bug caught and fixed during development (missing extern "C" on the bridge header) by forcing a real call site (chd_link_probe()) instead of trusting an unreferenced "clean" link
  • CI run on this PR (watching now)

🤖 Generated with Claude Code

https://claude.ai/code/session_01KMYbZzB8mioFmotWGFnAXG

rtissera and others added 2 commits August 25, 2026 02:58
Compile+link CI job against the real Xuantie/T-Head toolchain and
nand2mario's real bouffalo_sdk fork/firmware-bl616 (Sipeed Tang Console
60K/Primer 25K's onboard BL616 companion MCU), not the vanilla
riscv64-unknown-elf-gcc proxy rv32-ram-budget.yml uses. Pinned to fixed
commits since firmware-bl616/bouffalo_sdk are repos we don't control.

contrib/tangcore-bl616/ has the FatFS core_file_callbacks bridge and a
firmware-overlay proving the vendored libchdr actually links (a real call
site was needed - an unreferenced build links "clean" by getting
dead-stripped, which looked like success but proved nothing on the first
attempt).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMYbZzB8mioFmotWGFnAXG
firmware-bl616/bouffalo_sdk are nand2mario's Apache-2.0 repos, not ours.
The previous commit stored full modified copies of his CMakeLists.txt and
main.cpp under contrib/ - that's redistributing his copyrighted files
wholesale, not the minimal way to express "libchdr adds these lines".

Replace with a 92-line unified diff (contrib/tangcore-bl616/patches/),
applied via git apply against a freshly-cloned pinned commit in CI - the
standard way to distribute a modification without redistributing the
whole file. Verified it applies cleanly and reproduces byte-identical
files. Fixed a caching bug this surfaced: firmware-bl616 must never be
cached post-patch (would either replay the patch onto an already-patched
tree, or freeze a stale libchdr copy into the cache instead of testing
the current checkout) - only the two untouched clones (toolchain, SDK)
are cached now, firmware-bl616 is always cloned fresh. Re-verified the
full corrected pipeline end-to-end, including a second run to confirm
idempotency, and the resulting build is unchanged.

chd_fatfs.{h,c} are unaffected - 100% original code, no third-party
content, now carrying proper BSD-3-Clause headers matching the rest of
libchdr. contrib/tangcore-bl616/README.md documents the licensing
situation explicitly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMYbZzB8mioFmotWGFnAXG
@rtissera
rtissera merged commit 970a0ce into master Aug 25, 2026
62 of 64 checks passed
@rtissera
rtissera deleted the ci/bl616-tangcore-build branch August 25, 2026 14:53
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.

1 participant