Skip to content

Allow external libneo_ref trigger in CI#87

Merged
krystophny merged 8 commits into
mainfrom
ci/libneo-dispatch
Jun 17, 2026
Merged

Allow external libneo_ref trigger in CI#87
krystophny merged 8 commits into
mainfrom
ci/libneo-dispatch

Conversation

@krystophny

@krystophny krystophny commented Jun 8, 2026

Copy link
Copy Markdown
Member

Wires NEO-2 into libneo's per-PR reverse-dependency gate (libneo branch feat/release-downstream-gate). NEO-2 is a fast-only downstream in the gate manifest: the gate dispatches this workflow with -f libneo_ref=<sha> and never passes full.

This PR implements that dispatch contract:

  • unit-tests.yml (new): the workflow the gate dispatches. It must live on main to be dispatchable. workflow_dispatch accepts libneo_ref. The build step exports it as LIBNEO_GIT_TAG; the Makefile forwards -DLIBNEO_GIT_TAG= to cmake, and find_or_fetch(libneo) in cmake/Util.cmake uses it as the FetchContent GIT_TAG, so NEO-2 builds against the candidate libneo. On push and PR libneo_ref is empty and the pinned libneo resolves as before.
  • make test runs ctest --test-dir TEST, which covers only the fast unit tier (nrutil, mympilib, er_rotation; 30 s timeouts). The golden-record and PAR/QL reconstruction suites live in NEO-2-PAR/NEO-2-QL and stay in test-on-pr.yml on push/PR only, so a gate dispatch runs the sub-minute set.

Normal push/PR runs are unchanged.

Hermetic dependency fetching

Dependency resolution no longer reads $ENV{CODE}, so the build is hermetic regardless of the ambient environment:

  • cmake/Util.cmake: find_or_fetch dropped the $ENV{CODE}/<dep> bypass. libneo (and any other dep) is now always fetched via FetchContent by default. A local checkout is selected only through the explicit -D<DEP>_SOURCE_DIR=<path> cache option, or its alias -D<DEP>_PATH=<path> (e.g. -DLIBNEO_PATH=). The -DLIBNEO_REF= pin path is unchanged.
  • COMMON/ProjectConfig.cmake.in: FGSL dropped the $ENV{CODE}/external/fgsl-1.6.0/ prebuilt-path branch. FGSL builds via the bundled ExternalProject by default; -DFGSL_PATH=<dir> selects a local prebuilt FGSL. FGSL remains a live dependency on this branch; its removal is owned by the fortnum/drop-gsl migration, not this PR.

Verification: rg -i '\$ENV\{CODE\}' over the cmake sources returns nothing. A fresh cmake -S . -B <dir> -G Ninja with CODE exported and a decoy $CODE/libneo present logs Using libneo branch main from https://github.com/itpplasma/libneo.git and populates _deps/libneo-src from the remote, confirming $CODE is ignored. -DLIBNEO_PATH=<path> switches to the local checkout (Using local libneo in <path>).

Merge order: merge this PR first, then itpplasma/libneo#278. unit-tests.yml must exist on NEO-2 main before libneo's gate can dispatch it. This PR is otherwise standalone (the workflow runs on its own push/PR), so it is safe to merge first.

Add a libneo_ref workflow_dispatch input so an upstream libneo release can
build NEO-2 against a candidate ref. Run the full golden-record job (incl. PAR
and exact-vs-main checks) on dispatch, and scope LIBNEO_REF to the
current-version build so the reference builds keep their own libneo and the
golden-record comparison stays valid.
@krystophny krystophny force-pushed the ci/libneo-dispatch branch from 176345c to 6d2959e Compare June 8, 2026 16:43
A libneo-gate dispatch (workflow_dispatch without full) now builds NEO-2 against
the candidate libneo and runs only the unit tests (make test). The reference
builds, golden-record comparisons, QL performance and slow PAR steps run on
push/PR as before and on a nightly 'full=true' dispatch. Keeps the per-PR gate
under a minute of test time.

@GeorgGrassler GeorgGrassler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@krystophny might I really advice to split the workflows in this case? The whole test-on-pr.yml is basically skip for your main use case. Could we not make an extra workflow just for the unit tests, that is always triggered? Would be in general an improvement and maybe easier to trigger from libneo. Then you can maybe skip the slow workflow completely and dont need to make those complicated combinations of triggers for each "long" job.

Move the libneo gate trigger out of the monolithic golden-record
workflow. unit-tests.yml builds and runs make test on push, PR, and
workflow_dispatch, honoring libneo_ref so the libneo per-PR gate can
build NEO-2 against a candidate libneo. test-on-pr.yml reverts to the
golden-record/performance/PAR suite on push/PR only, dropping the full
flag and the per-step dispatch conditionals.
@krystophny

Copy link
Copy Markdown
Member Author

Done, split as you suggested.

  • unit-tests.yml (new): the always-on fast tier. Builds and runs make test on push, PR, and workflow_dispatch, accepting libneo_ref. This is what the libneo gate triggers.
  • test-on-pr.yml: back to its prior form. Golden-record, performance, and PAR run on push/PR only. The full input and the per-step dispatch conditionals are gone.

libneo side (itpplasma/libneo#278): the gate now dispatches unit-tests.yml, and ci/downstreams got a fourth full column. NEO-2 is full=no, so the gate never sends it -f full=true, and its golden-record/PAR suite stays on NEO-2 PRs instead of the gate.

@krystophny

Copy link
Copy Markdown
Member Author

Merge order: this PR first, then itpplasma/libneo#278. unit-tests.yml must be on NEO-2 main before libneo's gate can dispatch it. This PR is standalone otherwise, so it is safe to merge first.

@GeorgGrassler

Copy link
Copy Markdown
Contributor

@krystophny is the make test still part of the big CI? Should it not be removed as it is redundant with this new workflow?

Rename the override from LIBNEO_GIT_TAG to LIBNEO_REF throughout.
cmake/Util.cmake now checks ${DEPENDENCY_UPPER}_REF (a CMake cache
variable) instead of _GIT_TAG; no $ENV{} read ever existed there, so
removing _GIT_TAG from the -D forwarding path is the complete fix.

Makefile unexports LIBNEO_REF, LIBNEO_PATH, LIBNEO_GIT_TAG, and
LIBNEO_BRANCH so that ambient shell values cannot reach cmake via
make's implicit env import. An explicit make LIBNEO_REF=<ref> still
forwards -DLIBNEO_REF=<ref> to cmake.

unit-tests.yml removes the env: LIBNEO_GIT_TAG block and passes the
ref directly as make LIBNEO_REF=${{ inputs.libneo_ref }} so the gate
contract is explicit, not env-mediated.

test-on-pr.yml: rename make LIBNEO_GIT_TAG= to make LIBNEO_REF=, and
remove the redundant "Run unit tests" step (make test) that duplicated
what unit-tests.yml already covers on every push/PR.

Readme.md: document make LIBNEO_REF=<ref> and -DLIBNEO_REF=<ref>.
@krystophny

Copy link
Copy Markdown
Member Author

Yes, the redundant make test in test-on-pr.yml (the Run unit tests step at lines 104-106) was removed in this PR. The fast tier now lives exclusively in unit-tests.yml; test-on-pr.yml runs only the golden-record and PAR/QL suite.

find_or_fetch no longer reads $ENV{CODE}: libneo and other deps are
always fetched by default. A local checkout is selected only via the
explicit -D<DEP>_SOURCE_DIR= or -D<DEP>_PATH= cache option.

FGSL likewise drops the $ENV{CODE} prebuilt-path branch. It builds via
the bundled ExternalProject by default; -DFGSL_PATH= selects a local
prebuilt FGSL.
The reference build checks out the latest released NEO-2 whose Makefile and
cmake/Util.cmake predate the LIBNEO_GIT_TAG->LIBNEO_REF rename. That release
only honors LIBNEO_GIT_TAG, so passing only LIBNEO_REF left libneo unpinned,
falling back to main where the LIBNEO::MyMPILib target was removed, breaking
the reference build. Pass both names so the pin holds regardless of release
age; the current Makefile unexports LIBNEO_GIT_TAG, so it is harmless there.
@krystophny krystophny requested a review from GeorgGrassler June 15, 2026 22:00
@GeorgGrassler

Copy link
Copy Markdown
Contributor

@krystophny what is the indent behind the last three commits? I though this was all done?

@krystophny

Copy link
Copy Markdown
Member Author

Right, the split was done at 56cfa1c. The three later commits just make the gate reproducible and fix one break:

  • 9225abc: rename LIBNEO_GIT_TAG -> LIBNEO_REF and unexport it in the Makefile so ambient shell env can't leak into cmake. Also removes the redundant make test you flagged.
  • 1a877a4: drop the $ENV{CODE} bypass so a local $CODE/libneo can't shadow the ref the gate hands us. Local checkout now needs explicit -DLIBNEO_PATH=.
  • 8a81cad: the reference build runs the last NEO-2 release, whose old Makefile only knows LIBNEO_GIT_TAG; passing only LIBNEO_REF left libneo on main (where LIBNEO::MyMPILib is gone) and broke it. Pass both names so the pin holds.

Done now.

Comment thread cmake/Util.cmake Outdated
Comment thread cmake/Util.cmake
Comment thread Makefile Outdated
Comment thread .github/workflows/test-on-pr.yml Outdated
cmake find_or_fetch takes a local checkout only via -D<dep>_SOURCE_DIR;
the LIBNEO_PATH alias is gone. The Makefile no longer references the
pre-rename LIBNEO_GIT_TAG/LIBNEO_BRANCH; it just ignores an ambient
LIBNEO_REF. The golden-record reference build still passes
LIBNEO_GIT_TAG, which the old released Makefile needs. Remove the
orphaned TEST/cmake/test_libneo_tag.sh that exercised the dropped name.
@krystophny krystophny requested a review from GeorgGrassler June 16, 2026 11:46
@krystophny krystophny merged commit 1157029 into main Jun 17, 2026
2 checks passed
@krystophny krystophny deleted the ci/libneo-dispatch branch June 17, 2026 12:27
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