mirror of
https://github.com/logos-co/logos-rust-sdk.git
synced 2026-08-27 09:51:06 +00:00
* fix(lidl-gen): fail closed on a --protocol-version this cannot parse
--protocol-version selects which logos_module_* exports the scaffold
defines. It was failing open in two ways, and both produce the pre-0.3
export set — a module that links cleanly and dies at dlopen() with an
undefined symbol, on Linux only.
* an unparseable value: rustgen_provider.rs reads it with
.parse().ok().unwrap_or(0), which lands below every gate, and the
generator exits 0 with a success line;
* the flag as the LAST argument: .and_then(get(i + 1)) yields None,
indistinguishable from the flag being absent, so it fell through to
the "0.1.0" default.
Omitting the flag entirely is still fine — the doctests do that, and
"0.1.0" is a version this can actually parse. A version that was ASKED
FOR and not understood is a mistake, not a default.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* docs(lidl-gen): the module-impl ABI has ten exports, and dispatch_async is not one
Three corrections, all comment-only:
* logos_module_dispatch_async does not exist anywhere — not in
logos-protocol, not in the Qt glue, and this file's own tests assert
its absence. Two comments described it as an "extra C export".
* grant_host_services was called "the eleventh module-impl export" and
the teardown pair "the twelfth and thirteenth". The header declares
TEN. Counting past the end of the ABI is how you end up believing the
list is longer than what you owe.
* the module header enumerated only the founding seven, which is the
exact mental model that let two later exports go unimplemented.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test(abi): assert the scaffold defines every declared module-impl export
logos-protocol DECLARES the module-impl C ABI; this backend generates the
definitions. Those are independent facts, and the gap has shipped twice —
grant_host_services at protocol 0.3, the teardown pair at 0.5 (#45) — each
time as an "undefined symbol" at dlopen, on Linux only, three repos
downstream, with the runtime still reporting the module as LOADED.
checks.<system>.module-impl-abi generates the provider scaffold in all four
configurations — {default trait, --no-trait} x {single, --concurrency multi}
— and diffs what each DEFINES against the export list logos-protocol
publishes (packages.<sys>.module-impl-abi, logos-protocol#66). Both the list
and the protocol version come from that one output, so there is no version
arithmetic here and nothing hardcoded: at 0.4 the header declares eight
exports and the check asks for eight.
Why all four configurations rather than one: they happen to agree today,
but nothing enforces that, and --no-trait already differs in the BODY it
emits. A first version of this silently generated the default config three
times under four labels — lidl-gen ignores unknown flags and exits 0 — so
the check now also asserts the four scaffolds are pairwise distinct.
Proven to fail, which is the only thing that makes it worth having. Moving
grant_host_services' gate from (0,3) to (0,9) turns it red naming
logos_module_grant_host_services in all four configurations — while
lidl-gen's own unit tests pass clean, since their assertion list never
mentioned that export. It is not a duplicate of them.
Also repairs .github/workflows/ci.yml, which has not parsed since #40: one
step had neither `uses:` nor `run:` and the next had both, so every run
since has failed in 0s and NOTHING in this repo's CI has executed —
including ipc-test. The new check runs against the ROOT flake, not
path:./tests, whose logos-protocol is transitive and 0.2.0 and therefore
structurally blind to a missing 0.3 or 0.5 export.
TODO in flake.nix: the logos-protocol input is rev-pinned to the
logos-protocol#66 branch. Re-point at master once that merges — a rev pin
never moves under `nix flake update`, so leaving it would freeze the
declared side and quietly stop catching anything new.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(tests): link a protocol that actually has lp_grant_host_services
ipc-test has been broken on Linux, and nobody could see it. Two reasons,
both fixed in this PR:
* this repo's CI has not parsed since #40, so the job never ran;
* macOS links plugins with -undefined dynamic_lookup, so a local run
there passes regardless.
The failure, once the workflow parses again:
Failed to load module: … sdk_test_provider_module_plugin.so:
undefined symbol: lp_grant_host_services
Not a codegen problem — the checked-in scaffold never mentions that symbol.
The SDK CRATE does, unconditionally: src/ffi.rs declares lp_grant_host_services
and src/api.rs calls it, with no protocol gate. So logos_rust_sdk requires a
logos-protocol of at least 0.3 AT LINK TIME.
tests/flake.nix rev-pinned logos-module-builder to c849834b, whose
logos-protocol is 6492494a — version **0.1.0**, which does not export that
symbol at all. `nix flake update` could never move it, because a rev pin
does not move. Un-pinning lands protocol 0d2a3c06 (0.5.0).
This is the same shape as the ABI gap this PR adds a check for, one layer
down: a symbol one side declares and the other does not provide, legal at
link time on ELF, fatal at dlopen under -Wl,-z,now, and invisible on Darwin.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(tests): regenerate the checked-in scaffolds — they were three exports stale
With the protocol moved to 0.5.0 by the previous commit, ipc-test's next
failure is the bug this whole PR is about, verbatim:
undefined symbol: logos_module_set_unload_done_callback
The fixtures' src/provider_gen.rs is generated by logos-lidl-gen and CHECKED
IN, regenerated by hand when the .lidl changes (flake.nix:54-58). But the
export set does not depend on the .lidl at all — it depends on the PROTOCOL
— so a protocol that gained exports left these two files behind with the
founding seven, and nothing regenerates or verifies them.
So the fixtures reproduced the 0.5 break exactly: the Qt glue is generated
fresh at 0.5 and emits the teardown calls, while these scaffolds, generated
long ago, define nothing to satisfy them.
Regenerated at the protocol tests/ actually links (0.5.0, read from the
lock rather than typed in). Both now define all ten. The diff is large
because they had also missed the derived identity methods and the async
dependency-client wrappers.
Worth noting for later: "checked in and regenerated by hand" is the
mechanism that made this possible, and this PR's new check does not cover
it — it validates the EMITTER against the header, not these committed
artifacts. Generating them at build time, or asserting they match fresh
generator output, would close it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* chore(deps): track logos-protocol master now that module-impl-abi has landed
logos-protocol#66 merged as 480f40f, so the temporary rev pin can go. A rev
pin never moves under `nix flake update`, so leaving it would freeze the
DECLARED side of this check at 0.5 and quietly stop catching anything a
later protocol adds — the exact silence the check exists to break.
The input stays DIRECT rather than following the transitive
logos-module-builder.inputs.logos-protocol: that one resolves to 0.2.0,
which declares only the seven founding exports, so a check reading it would
be structurally incapable of failing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>