Skip to content

ci: add Linux build-only job for libtotapi_mono.so (#204)#205

Merged
k-yoshimi merged 1 commit into
developfrom
chore/linux-ci-mono-build
May 18, 2026
Merged

ci: add Linux build-only job for libtotapi_mono.so (#204)#205
k-yoshimi merged 1 commit into
developfrom
chore/linux-ci-mono-build

Conversation

@k-yoshimi
Copy link
Copy Markdown
Owner

@k-yoshimi k-yoshimi commented May 18, 2026

Summary

Adds a new mono-build CI job exercising the Linux ld branch of the L-7b-ii monolithic Makefile target (libtotapi_mono.so). Until now PR #202's mono target had only been macOS-verified; this PR catches Linux linker incompatibilities before #201 (Phase 2a) starts depending on them.

Closes #204.

Scope: BUILD ONLY

The 1e-10 equivalence and Layer-C BPSD smoke tests against the mono build are deferred to #201 (blocked on the unified tot/tot_graphics_stubs_mono.f90 source that #201 Phase 2a introduces). This PR validates:

Invariant How
Linux mono link succeeds make -C tot libtotapi_mono.so exits 0
8-bpsd-storage-symbol dedup invariant make -C tot libtotapi_mono_inspect (HARD GATE inside that target — exit 1 if count != 8)
No lib*api.so runtime deps Observational (printed ldd/otool output, NOT a hard exit gate — to be tightened once Linux/macOS regex is standardized)

Setup duplication acknowledged

The new mono-build job duplicates ~80 lines of setup (BPSD clone, make.header, mtxp config, PIC support libs, per-module .so loop) from the existing pytest job. Both reviewers flagged this as a real drift risk (a flag change in one and not the other = silent CI-green on divergent binaries).

Mitigation in this PR: explicit "KEEP IN SYNC" cross-reference comments on the duplicated steps (notably the make.header heredocs).

Long-term: extract to a composite action under .github/actions/ — separate refactor opportunity, not coupled to this small PR.

Reviewer trail

  • In-house: SHA ef15ecb2 → 1 MED (make.header drift risk) + 5 LOW. All addressed in amend a9f67431.
  • Codex: SHA ef15ecb2 → "approve, ship" + 2 doc notes (5-vs-6 count, observational vs gate). Both addressed in amend a9f67431.
  • Delta re-review on a9f67431: both LGTM.

Test plan

🤖 Generated with Claude Code


Note

Medium Risk
Medium risk due to CI pipeline expansion that performs a full Fortran build/link on Linux and depends on an external bpsd clone, which can introduce new CI failures or longer runtimes.

Overview
Adds a new GitHub Actions mono-build job that builds on Linux only the monolithic tot shared library target libtotapi_mono.so, including its PIC support libraries and required per-module .so prerequisites.

The job then runs make -C tot libtotapi_mono_inspect to hard-gate the BPSD symbol dedup invariant (expects 8 storage symbols) and prints additional inspection output, and the existing pytest job now includes explicit comments to keep the duplicated make.header heredoc in sync with the new job.

Reviewed by Cursor Bugbot for commit a9f6743. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds a new `mono-build` job to python-tests.yml that exercises the
Linux ld branch of the libtotapi_mono.so target on every PR. Until
now the mono target (landed in PR #202) had only been built on
macOS arm64; the Linux SO_SONAME / SO_GROUP_BEGIN/END /
SO_UNDEFINED branches were unverified.

Job structure:
1. Same setup chain as the existing pytest job (BPSD clone,
   make.header, mtxp/make.mtxp, PIC support libs). The make.header
   heredoc is duplicated verbatim from the pytest job; both
   heredocs carry a "KEEP IN SYNC" cross-reference comment so a
   future flag drift (e.g. OFLAGS change) doesn't silently produce
   divergent binaries from the two CI paths.
2. Build the 5 per-module .so files that libtotapi_mono.so's
   $(LIBS_PIC_SO) prereq triggers (eq tr fp ti wrx), plus wr for
   symmetry with the pytest job's loop. NOT tot/libtotapi.so —
   this job is scoped to mono-only validation.
3. `make -C tot libtotapi_mono.so` — first Linux exercise.
4. `make -C tot libtotapi_mono_inspect` — hard-fails if the
   8-bpsd-storage-symbol invariant drifts. The "no lib*api.so deps"
   check inside the inspect target prints `ldd`/`otool` output for
   visual inspection but is NOT a hard exit-code gate yet (can be
   tightened in a follow-up once the regex is standardized across
   Linux/macOS output formats).

Scope: BUILD ONLY. The 1e-10 equivalence and Layer-C BPSD smoke
tests against the mono build are blocked on the unified
tot_graphics_stubs_mono.f90 source that #201 Phase 2a will
introduce. This PR keeps the validation surface aligned with what
is currently buildable.

Setup duplication between the `pytest` and `mono-build` jobs (BPSD
clone, make.header, mtxp config, PIC libs, per-module .so loop) is
intentional — pulling these into a composite action is a separate
refactor opportunity not coupled to this small PR. The MED-level
drift risk it creates is mitigated by the cross-reference comments
on the duplicated steps.

Closes #204.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@k-yoshimi
Copy link
Copy Markdown
Owner Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a9f6743. Configure here.

@k-yoshimi k-yoshimi merged commit 82d6918 into develop May 18, 2026
4 checks passed
@k-yoshimi k-yoshimi deleted the chore/linux-ci-mono-build branch May 27, 2026 22:04
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