mirror of
https://github.com/logos-co/logos-cpp-sdk.git
synced 2026-08-31 01:31:10 +00:00
--module-dir walked a directory of BUILT plugins and generated one consumer
wrapper per dependency by dlopen'ing each and reading its QMetaObject. Every
wrapper now comes from a contract instead -- `--general-only` with one
`--dep <name>=<name>.lidl` per dependency -- which builds no dependency plugin
and, unlike introspection, works under cross-compilation.
It is REFUSED rather than ignored, mirroring --provider-header right below it.
Falling through to the dependency LISTING would have exited 0 having generated
nothing: the exact shape that lets a stale caller look green while shipping a
module with no typed API.
No nix build changes as a result -- the flag had no caller left in any of them,
so a store-path diff would be empty either way and would prove nothing. The
only observable difference is what the binary does when handed the flag, so
that is what the new `generator-cli` check asserts, by EXIT CODE:
OK: control - --metadata alone exits 0 and lists dependencies
OK: --module-dir exits non-zero (status=2)
OK: --module-dir fails with the removal diagnostic
OK: --general-only still emits the umbrella
The control matters: without it a non-zero exit could equally mean the binary
is broken. It runs against an EXISTING modules directory too, because the old
code only errored when that directory was missing.
Also deleted, both genuinely dead:
* cpp/compile.sh -- compiles logos_api.cpp, module_proxy.cpp, token_manager.cpp
and six headers, NONE of which exist in this repo any more (they moved to
logos-protocol / logos-qt-host in the host split). The script cannot run.
* docs/docs.md -- 789 lines with zero inbound references anywhere in the
workspace, documenting --module-dir and a cpp/ layout that is gone.
cpp-generator/compile.sh is KEPT: logos-module-builder's LogosModule.cmake:404
still invokes it (`add_custom_target(cpp_generator_build ...)`) on the
LOGOS_CPP_SDK_IS_SOURCE branch, and it builds into exactly the
LOGOS_DEPS_ROOT/build/cpp-generator path that file then reads.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
114 lines
4.7 KiB
Nix
114 lines
4.7 KiB
Nix
{
|
|
description = "Logos C++ SDK";
|
|
|
|
inputs.logos-nix.url = "github:logos-co/logos-nix";
|
|
inputs.nixpkgs.follows = "logos-nix/nixpkgs";
|
|
# The protocol layer (transports, token exchange, lp_* C ABI). Follows our
|
|
# logos-nix so both repos resolve the identical nixpkgs/Qt pin — the QRO
|
|
# wire is Qt-version-sensitive.
|
|
#
|
|
# Rev-pinned, not master-tracking: logos_host_services.h is a veneer over the
|
|
# trust-root surface (lp_token_keys, lp_inform_module_token_to,
|
|
# lp_grant_host_services) that landed on feat/per-client-token-store and is
|
|
# NOT on logos-protocol master — protocol master is still
|
|
# LOGOS_PROTOCOL_VERSION_MINOR 2, and the `tests` check would fail to compile
|
|
# against it. Re-point this at master once that branch merges.
|
|
inputs.logos-protocol.url = "github:logos-co/logos-protocol/c8bab12834dbf92155b483546875e6078d17c74e";
|
|
inputs.logos-protocol.inputs.logos-nix.follows = "logos-nix";
|
|
# The canonical, language-neutral LIDL frontend (lexer/parser/AST/serializer/
|
|
# validator) the code generator links. Follows our logos-nix so it resolves
|
|
# the identical nixpkgs pin.
|
|
inputs.logos-lidl.url = "github:logos-co/logos-lidl";
|
|
inputs.logos-lidl.inputs.logos-nix.follows = "logos-nix";
|
|
|
|
outputs = { self, nixpkgs, logos-nix, logos-protocol, logos-lidl }:
|
|
let
|
|
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
|
|
# Adds the "x86_64-windows" pseudo-system; a cross derivation's `system`
|
|
# is its BUILD platform, so it evaluates anywhere and realises on Linux.
|
|
forAllTargets = logos-nix.lib.forAllTargets;
|
|
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
|
|
pkgs = import nixpkgs { inherit system; };
|
|
});
|
|
in
|
|
{
|
|
packages = forAllTargets ({ pkgs, ... }:
|
|
let
|
|
# Common configuration
|
|
common = import ./nix/default.nix { inherit pkgs; };
|
|
src = ./.;
|
|
|
|
# Individual package components
|
|
bin = import ./nix/bin.nix { inherit pkgs common src logos-protocol; logos-lidl = logos-lidl.packages.${pkgs.system}.logos-lidl; };
|
|
lib = import ./nix/lib.nix { inherit pkgs common src logos-protocol; };
|
|
include = import ./nix/include.nix { inherit pkgs common src logos-protocol; };
|
|
tests = import ./nix/tests.nix { inherit pkgs common src logos-protocol; logos-lidl = logos-lidl.packages.${pkgs.system}.logos-lidl; };
|
|
|
|
# Combined SDK package. We re-declare propagatedBuildInputs on
|
|
# the join so downstream Nix derivations that depend on the
|
|
# combined `sdk` (rather than the nested `lib`) still inherit
|
|
# OpenSSL / Boost / nlohmann_json — symlinkJoin doesn't
|
|
# forward propagation from its `paths` attribute. Qt is
|
|
# excluded for the same setup-hook ordering reason as in
|
|
# `nix/lib.nix`; consumers must list qt6.qtbase +
|
|
# qt6.wrapQtAppsNoGuiHook themselves.
|
|
sdk = pkgs.symlinkJoin {
|
|
name = "logos-cpp-sdk";
|
|
paths = [ bin lib include ];
|
|
propagatedBuildInputs = common.propagatedBuildInputs;
|
|
};
|
|
in
|
|
{
|
|
# Individual outputs
|
|
logos-cpp-bin = bin;
|
|
logos-cpp-lib = lib;
|
|
logos-cpp-include = include;
|
|
inherit tests;
|
|
|
|
# Combined outputs (for backward compatibility)
|
|
logos-cpp-sdk = sdk;
|
|
cpp-generator = bin; # Alias for backward compatibility
|
|
|
|
# Default package
|
|
default = sdk;
|
|
}
|
|
);
|
|
|
|
checks = forAllSystems ({ pkgs }:
|
|
let
|
|
common = import ./nix/default.nix { inherit pkgs; };
|
|
src = ./.;
|
|
tests = import ./nix/tests.nix { inherit pkgs common src logos-protocol; logos-lidl = logos-lidl.packages.${pkgs.system}.logos-lidl; };
|
|
generator = import ./nix/bin.nix { inherit pkgs common src logos-protocol; logos-lidl = logos-lidl.packages.${pkgs.system}.logos-lidl; };
|
|
in
|
|
{
|
|
inherit tests;
|
|
# Runs the BINARY. The gtest suite links the generator's internals and
|
|
# never executes it, so a retired CLI flag can only be asserted here.
|
|
generator-cli = import ./nix/tests-generator-cli.nix {
|
|
inherit pkgs common generator;
|
|
};
|
|
}
|
|
);
|
|
|
|
devShells = forAllSystems ({ pkgs }: {
|
|
default = pkgs.mkShell {
|
|
nativeBuildInputs = [
|
|
pkgs.cmake
|
|
pkgs.ninja
|
|
pkgs.pkg-config
|
|
];
|
|
buildInputs = [
|
|
pkgs.qt6.qtbase
|
|
pkgs.qt6.qtremoteobjects
|
|
pkgs.gtest
|
|
pkgs.boost
|
|
pkgs.openssl
|
|
pkgs.nlohmann_json
|
|
];
|
|
};
|
|
});
|
|
};
|
|
}
|