Repository navigation
build: check that build.zig and Makefile.cbm build the same sources - #116
Merged
Merged
Conversation
build.zig builds the PR CI binaries and test runners; Makefile.cbm builds the release binaries and the ASan test runner. Each keeps its own source list and nothing compared them, so a file missed in Makefile.cbm only showed up in a release build or a Makefile test run (a330b01 fixed one such drift). scripts/check-build-sources.sh compares three groups: - prod: native_sources, the vendored files and main.c in build.zig against PROD_SRCS and the vendored sources in Makefile.cbm; - test: all_test_sources against ALL_TEST_SRCS, and checks the focused build.zig runners only use tests from all_test_sources; - zig: the files build.zig reaches by @import from its roots against the .zig files in CBM_ZIG_SRCS. Makefile.cbm gains a print-build-sources target that prints its resolved lists. The only allowed difference is vendored/tre/tre_all.c, the Windows regex library, since build.zig has no Windows target. CI runs the check in the checks job. Signed-off-by: ata-sesli <atasesli@protonmail.com>
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #111. CI now fails when
build.zigandMakefile.cbmbuild different source files.Problem
build.zigbuilds the PR CI binaries and test runners.Makefile.cbmbuilds the release binaries and the ASan test runner. Each keeps its own list of sources, and nothing compared them. A file added tobuild.zigbut not toMakefile.cbmpassed PR CI and only broke a release build or a Makefile test run. a330b01 fixed one such drift after the fact.Change
scripts/check-build-sources.shcompares three groups and prints every file that only one build has:native_sources, the vendored sources andsrc/main.cinbuild.zig, againstPROD_SRCS, the extraction sources and the vendored sources inMakefile.cbm;all_test_sourcesagainstALL_TEST_SRCS. It also checks that the focusedbuild.zigrunners (zova_test_sources,mcp_test_sources,pipeline_test_sources) only list tests thatall_test_sourceshas;.zigfilesbuild.zigreaches by@importfromsrc/cbm_zig.zigandsrc/zova/cbm_zova_bridge.zig, against the.zigfilesMakefile.cbmlists as Zig library inputs (CBM_ZIG_SRCS,CBM_ZOVA_BRIDGE_ZIG_SRC).Makefile.cbmgains aprint-build-sourcestarget, so the script reads the Makefile's resolved lists instead of parsing variables.vendored/tre/tre_all.c, the Windows regex library, which onlyMakefile.cbmbuilds becausebuild.zighas no Windows target. It is listed inALLOWEDin the script, with the reason.checksjob runs the script, andtests/test_github_workflows.shasserts that step exists.The larger option in the issue, building releases with
zig buildand dropping the Makefile lists, is not part of this PR.Verification
Makefile.cbm;build.zig'snative_sources;src/cypher/parser.zigremoved fromCBM_ZIG_SRCS;mcp_test_sourcesonly;ts_runtime.cremoved fromaddNativeSources.tests/test_github_workflows.shandgit diff --checkpass.ubuntu-latestrunner. The new CI step runs there.