Repository navigation
Conversation
Every generated method appends its own `err` and deadline (`timeout_ms` on the lp surface, `timeout` on Qt), the async entry points a `callback`, and the bodies declare locals of their own. A contract parameter with one of those names was emitted verbatim: logos-rust-sdk's sdk_test_caller_module declares `timed_call(sleep_ms: int, timeout_ms: int)`, and its client failed with "redefinition of parameter 'timeout_ms'". A clashing parameter now gets `_` appended in C++ (cpp_identifier.h), never onto a name the contract already spells. Arguments are positional, so the wire is unchanged. The cdylib provider's event bodies get the same rule for `args` and `emitEventImpl_`. A contract without such names emits the same bytes. tests/generator now compiles what it generates (generated_code.h). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LIDL admits any identifier as a name, so a contract may call a field `class` or a method `delete`. Every emitter wrote the name verbatim, and the output did not compile: logos-json-rpc-bridge-py's names.lidl, with fields `class` and `int`, failed in the lp client, the Qt wrapper and the cdylib provider. A name that is a C++ keyword (the C++20 list, alternative tokens included, so the output also builds as C++20) now gets `_` appended wherever it is a C++ identifier: records, fields, methods, parameters, event parameters, and the provider's method calls and event bodies. The wire keeps every name, and names derived from one keep it too (`delete` gives `delete_()`, `deleteAsync()`, `onClass()`). A contract-first provider's author writes the same spellings. A contract without keyword names emits the same bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A record may name itself, and the consumer wrappers held every record field by
value: `Node { ? parent: Node }` became std::optional<Node> inside Node (an
incomplete type), `Loop { next: Loop }` a struct containing itself, and a
record naming one declared after it an unknown type, in declaration order.
logos-json-rpc-bridge-py's recursive.lidl failed on every one, on lp and Qt.
Nothing recursed forever: the codec only follows the data it is given.
A field whose record, held by value, would hold the record it belongs to is
now a std::shared_ptr<T>: empty is absent, on the wire as for an optional. By
value means T, and ?T on lp; Qt spells an optional field QVariant, so only a
required cycle gets a pointer there. std::vector / std::map / QList / QMap of
an incomplete type are fine, so `[Node]` is unchanged. Structs follow the
records they hold by value, and are declared first when one names a record
defined after it. Every other contract emits the same bytes.
The cdylib provider still spells such a field T / std::optional<T> in its
codec; documented as a known limitation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…esult/bin CI runs the installed generator_tests after `nix build .#tests`, when the unpacked source dir the probes' include path named is gone, so every probe failed with "logos_json.h: No such file or directory". nix now passes the SDK headers as a store path; other builds keep the source dir. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
📊 cpp-sdk doc-test reportThe real accounts module, run through a logoscore daemon with the whole stack built against this commit of the C++ SDK — rendered alongside the commands actually run and their output (updated each run, commit Pages can take a minute to update after the run finishes. |
This branch has not been deployed
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.
Three pre-existing bugs in the C++ wrappers generated from a LIDL contract. They showed up when I generated a client for every contract in the workspace and compiled it.
timeout_ms,err,callback). It was emitted next to the wrapper's trailingint timeout_ms = 0, so the compiler reported "redefinition of parameter". The workspace case issdk_test_caller_module.timed_call(sleep_ms, timeout_ms).class,delete,default). They were emitted verbatim.? parent: Nodebecamestd::optional<Node>insideNode, an incomplete type.next: Loopbecame a struct that contains itself.Names.
cpp_identifier.happlies one rule: a clashing name gets_appended in C++ only.delete_(),deleteAsync(),onClass().Recursive records.
std::shared_ptr<T>. An empty pointer means absent on the wire.[Node]and{tstr: Node}are unchanged. On the Qt surface only required cycles are boxed, because optional fields there are alreadyQVariant.Output stability, over 100 unique contracts (the workspace's
.lidlsources plus built contracts):--typed-collections. It was 89/92 before.feat/peeringand on feat: Qt-free clients for apps (client mode, typed collections, logos_generate_clients) #173. The commits apply to master unchanged.Tests.
tests/generator/test_{reserved_param_names,keyword_names,recursive_records}.cppgenerate from small contracts, then compile the output as C++17 and C++20 and round-trip it. Each one fails without its fix.checks.testspasses on master plus this branch (393/393). Onfeat/peeringit passes 404/404 on aarch64-darwin and x86_64-linux.Not in this PR:
shared_ptrfield, and the header-first parser can't read that back. It's documented as a known limitation.lidl_gen_client.cpp, used for--lidl Xwithout--api-style) have the same three bug classes.Stacking. The commits cherry-pick cleanly onto
feat/peering. They conflict with #173 where it threadsstdType. That resolution also has to rename records in #173's typedCodecspecializations, which git doesn't flag.🤖 Generated with Claude Code