Skip to content

Build: every variant writes src/eigenscript, which is why the test runner needs a binary fingerprint guard — a per-variant objdir retires both #740

Description

@InauguralPhysicist

Found in a modularity review of main @ 8e8970a. Tracking issue — this one is unusual in that the project has already paid for the defect twice, in a test-runner mechanism and a standing CLAUDE.md prohibition.

What

Makefile:23 sets BINARY := $(SRC_DIR)/eigenscript, and every variant emits to it from a single whole-program gcc invocation: build (:54), full (:63), http (:72), zlib (:87), gfx (:97), asan (:185), tsan (:197), valgrind (:211), poison (:228), pgo (:246, :254). Only lib (:163) and coverage (:271) ever produce .o files. There are no pattern rules and no header dependency tracking; build is .PHONY (:42).

Consequences, all currently being absorbed

  1. Two variants cannot coexist, so an ASan run and a release run must serialize. This is a live constraint on any review or CI parallelism — I hit it directly this session and had to sequence builds around in-flight suite runs.
  2. The test runner carries a workaround for it. tests/run_all_tests.sh:29-60 computes a SHA fingerprint of the binary and re-checks it at ~10 section seams (lines 159, 192, 211, 491, 706, 958, 991, 1008, 1025) purely to detect a mid-run clobber (Test runner should fail loud when the binary is rebuilt mid-run, not silently grade against it #681). There is even a self-test section [99d] proving the guard fires.
  3. CLAUDE.md carries a prohibition for it"never rebuild one while a suite run against another is in flight."
  4. Any edit costs a full 22-TU rebuild, since nothing is incremental.

Suggested fix

A build/$(VARIANT)/ objdir with -o $(BINARY)-$(VARIANT), plus -MMD -MP dependency tracking and a pattern rule. That makes variants coexist, makes rebuilds incremental, and lets both the fingerprint guard and the CLAUDE.md rule be retired rather than maintained — the guard becomes unnecessary rather than merely redundant.

Worth keeping a src/eigenscript symlink or copy to the last-built variant so existing scripts and docs keep working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions