Files
Dario Gabriel LipicarandClaude Opus 5 9259fe86a1 fix: a protocol version that will not parse must not silently vanish
A Rust module's EXPORT SET is decided by the --protocol-version string:
lidl-gen gates logos_module_grant_host_services on >= 0.3 and the teardown
pair on >= 0.5. It was passed as

    ${lib.optionalString (protocolVersion != null) "--protocol-version ..."}

and that does not make a bad version WRONG — it makes the flag VANISH.
lidl-gen then falls back to "0.1.0", emits the seven founding exports, and
exits 0. Every Rust module in the workspace would quietly regenerate
incomplete, link cleanly, and fail at dlopen() on Linux with an undefined
symbol — invisible on macOS, three repos away from the cause, and reported
by the runtime as a module that LOADED.

protocolVersion goes null in two different situations and they are two
different bugs, so they now throw with two different messages: no
logos-protocol input at all (a caller error), versus a header that did not
parse (a bug in the regex right above it). Neither is a thing to fall back
from.

checks.module-impl-abi-nm (#207) already DETECTS this by reading the built
plugin's symbol table. This is the other half — refuse at the point of the
mistake, so it never reaches a build. Metadata stamping is untouched: null
there legitimately means "pre-protocol, load as legacy".

Proven: renaming the macro in the split pattern used to yield a
silently-broken plugin. It now yields

    error: logos-module-builder: could not read LOGOS_PROTOCOL_VERSION_STRING
    from /nix/store/...-source/cpp/logos_protocol.h, needed to generate the
    Rust cdylib scaffold for 'rust_native_dep_module'. The header moved or
    changed shape — fix the parse above; do NOT let it fall back, because
    the fallback silently emits an incomplete module-impl C ABI.

Also deletes a dead duplicate of the same parse. It sat in the devShells
block with no consumer anywhere in it — an exhaustive grep finds exactly
four mentions of protocolVersion: this definition, the two uses in
`packages`, and that orphan. A duplicated, half-dead parse of the value
this whole failure mode hinges on is not something to leave lying around.

All eight checks green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 16:27:11 -03:00
..