Files
Dario Gabriel LipicarandClaude Opus 5 26a886bb7b test(abi): read the module-impl exports off the BUILT plugin, per backend
The source-level checks that just landed (logos-cpp-sdk#144,
logos-rust-sdk#46) validate each GENERATOR against the protocol header.
Three things they structurally cannot see, all of which end as the same
"undefined symbol" at dlopen:

  * THE CARRIER. lib/mkLogosModule.nix:383 derives protocolVersion by
    regexing the protocol header and :483 passes it through
    lib.optionalString (protocolVersion != null). A regex miss does not
    make the flag wrong, it makes it VANISH — logos-lidl-gen then defaults
    to "0.1.0" and every Rust module in the workspace regenerates with only
    the seven founding exports. Each backend's own check still passes,
    because each passes the version correctly.
  * EMITTED BUT NOT COMPILED IN — cfg-gated out, gc-sectioned, lost to link
    order. Present in the generator's output, absent from the artifact.
  * A LANGUAGE BACKEND NOBODY WIRED A CHECK INTO (the Nim path in #202).

So build a module per backend and read its symbol table:

  (1) every export logos-protocol DECLARES is DEFINED in the plugin;
  (2) NO logos_module_* symbol is UNDEFINED — literally "will this dlopen".

Both fire independently on the same real defect, which is why both are here.

The part that makes this worth its build time: nm sees an undefined symbol
on BOTH platforms, while the runtime failure is Linux-only (nixpkgs hardens
with -Wl,-z,now; macOS links plugins -undefined dynamic_lookup and never
binds). So a defect that is fatal in CI and invisible on a developer's Mac
becomes catchable on that Mac.

Proven non-redundant, not merely proven to fail. Driving protocolVersion to
null leaves all seven existing checks GREEN — six of them produce
byte-identical store paths, never reaching the affected code, and the
seventh, rust-native-dep, rebuilds the very same broken plugin and still
passes, because its only assertion is that the output directory exists.
This check goes red naming the three missing exports.

Anti-vacuity is the bulk of the file, since a check that cannot fail is
worse than none: the plugin is located by a glob that must match EXACTLY
one; zero defined logos_module_* symbols is a hard failure printing the raw
table; the undefined side cannot self-check (empty IS the pass) so the raw
table is asserted non-empty first; and grep's "no match" is distinguished
from a real error. Each was demonstrated to fire.

Also lists rust-native-dep in CI. It was excluded over a protocol pin that
has since moved, and this step already compiles the same fixture.

The logos-protocol pin moves 0d2a3c0 -> 480f40f because
packages.<sys>.module-impl-abi did not exist before it. flake.nix throws a
named error if a future pin ever predates that output.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 15:57:30 -03:00
..