Files
Dario LipicarandClaude Opus 5 5f75c9418b chore(deps): track master for protocol, cpp-sdk, plugin-qt and qt-sdk (#6)
* feat: take the Qt host runtime from logos-qt-host, not logos-qt-sdk

LogosTest.cmake linked logos-qt-sdk::logos_qt_sdk for the host runtime a
module test needs — LogosAPI, LogosAPIProvider, the provider bases. B1 moved
that code to logos-plugin-qt, which exports it as logos-qt-host::logos_qt_host,
so name that target instead.

The root it comes from is picked from LOGOS_QT_HOST_ROOT, falling back to
LOGOS_QT_SDK_ROOT. The fallback is not decoration: every caller today reaches
this file through logos-module-builder, which passes only LOGOS_QT_SDK_ROOT,
and requiring the new variable would take every module's unit-tests check down
until that repo moves. Whichever root is chosen is reported by name in the
configure log, and the imported target is checked before it is linked — a
find_package that hands back no target now stops the configure instead of
deferring to a wall of undefined LogosAPI symbols.

logos-qt-sdk stays an input and stays on the include path when a caller
supplies both roots, because it still owns the Qt-typed headers that are NOT
the host runtime: logos_qt_lp_bridge.h and logos_qt_wire.h (generated consumer
wrappers include them by name) and logos_ui_plugin_context.h. It is ordered
after the host runtime's include dir so the five shared header names resolve
to qt-host.

Two things this repo never had are added so the repoint is verifiable here at
all: `checks.<sys>.example-tests` builds and runs examples/basic-module-test
through LogosTest.cmake on the qt-host path, and `example-tests-qt-sdk` does
the same on the fallback path so a change to one cannot quietly break the
other. Both were needed to find two latent breaks in nix/mkLogosModuleTests.nix
— it never passed CMAKE_MODULE_PATH, so `include(LogosTest)` could not resolve,
and its checkPhase drove ctest, which reports "No tests were found!!!" and
exits 0. The check phase now locates the test binaries itself and fails when
there are none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(b2b): LOGOS_QT_HOST_ROOT is the only host-runtime root

LogosTest.cmake accepted LOGOS_QT_SDK_ROOT as an alternative source of the Qt
host runtime, for callers that had not migrated. logos-qt-sdk stopped forwarding
those headers, so that branch now configures cleanly -- QT_HOST_INCLUDE is set,
find_package(logos-qt-sdk) resolves, the target imports -- and then dies much
later on "logos_api.h: No such file". It is deleted; a missing LOGOS_QT_HOST_ROOT
is a FATAL_ERROR that names logos-qt-sdk as explicitly NOT a substitute.

LOGOS_QT_SDK_ROOT keeps its other, real job: the Qt-typed consumer headers
logos-qt-sdk owns (logos_qt_lp_bridge.h, logos_qt_wire.h,
logos_ui_plugin_context.h). That block's layout probe moves off logos_api.h --
absent from both of that prefix's layouts now -- onto logos_qt_wire.h.

mkLogosModuleTests.nix makes logosQtHost a required argument instead of one half
of a two-way assert, and the flake drops the example-tests-qt-sdk check, which
existed to cover the pre-split path that no longer exists. logosQtSdk is passed
alongside logosQtHost in the remaining check so the Qt-typed headers stay
covered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(deps): rev-pin the B4 chain at the revs that are actually pushed

The lock this branch carried named logos-plugin-qt 8ccb1fc, which is a stale
commit on feat/sdk-codegen-b3-d11 and an ancestor of NEITHER b4 branch, so the
qt-host this repo's LogosTest.cmake links predated the windows-target work
every other consumer in the chain has moved to. The other three inputs were
worse than stale: their urls tracked master, and the revs beside them were only
ever right by accident.

All four are now rev-pinned in the url, because none of them is on a master:

  logos-protocol   c8bab12  feat/per-client-token-store (contains e6d5b57)
  logos-cpp-sdk    a04b278  feat/sdk-codegen-b3-d11     (contains e3744fb8)
  logos-plugin-qt  cc24fa1  feat/b4-qt-host-windows-target (contains 8846fc5)
  logos-qt-sdk     8a06b87  feat/sdk-codegen-b3-d11     (contains c6be61d)

Every one is a fast-forward from its own master, so nothing is dropped, and
each is the rev logos-qt-sdk and logos-view-module-runtime already pin — which
is the point of cc24fa1 in particular. logos-qt-sdk pins plugin-qt in its own
url and this flake does not redirect it, so a different root pin would put two
logos-qt-host prefixes on one link line. They resolve to a single store path
(v780ipqq), verified by evaluating both instances.

checks.aarch64-darwin.example-tests builds and its six tests run and pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(deps): track master for protocol, cpp-sdk, plugin-qt and qt-sdk

All four upstream PRs merged (#59, #138, #19, #33), so the rev pins that bridged
to them are retired and their rationales rewritten.

The logos-plugin-qt `follows` on the logos-qt-sdk input STAYS, and is now the
only thing holding the property the rev pin used to hold with it: qt-sdk's
default package propagates whatever logos-qt-host it resolved, so without the
follows the example tests could see two logos-qt-host store paths. Verified: the
example-tests closure contains exactly ONE logos-qt-host derivation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 18:40:53 -03:00

196 lines
8.8 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
description = "Logos Test Framework — unit testing for Logos modules without Qt boilerplate";
# One of the five inputs below is still rev-pinned; the rest track master.
# Most of the Qt host split (B1B4) has landed: logos-protocol#59,
# logos-cpp-sdk#138 and logos-plugin-qt#19 are all MERGED, so the three revs
# this file used to pin are on their repos' masters and the plain urls below
# both evaluate and compile. logos-qt-sdk is the exception — logos-qt-sdk#33
# is still OPEN, so its master still re-exports the host headers this repo
# stopped taking from it. That one pin stays until #33 merges.
inputs = {
logos-nix.url = "github:logos-co/logos-nix";
# Tracks master again. The a04b2788 pin existed to reach the capability
# split; logos-cpp-sdk#138 ("split the SDK by capability, retire the
# provider-header path, and harden the cdylib decode") MERGED, and master
# (95d7b3a) carries cpp/logos_host_services.h and the rest of it. The PR was
# squash-merged, so a04b2788 is not an ancestor of master — its content is.
logos-cpp-sdk.url = "github:logos-co/logos-cpp-sdk";
# Tracks master again. The c8bab12 pin covered TokenManager::forIdentity /
# isolateIdentity and the host-services C ABI; logos-protocol#59
# ("per-client token store, the host-services C ABI, and a container
# shape-check") MERGED, and master (f4407ff) has both
# (forIdentity/isolateIdentity in cpp/token_manager.h,
# lp_grant_host_services/lp_token_keys in cpp/logos_protocol.h). The PR was
# squash-merged, so c8bab12 is not an ancestor of master — its content is.
# logos-plugin-qt and logos-qt-sdk both `follows` this input, so the closure
# still holds exactly one protocol.
logos-protocol = {
url = "github:logos-co/logos-protocol";
inputs.logos-nix.follows = "logos-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# The Qt HOST RUNTIME a module test links: LogosAPI, LogosAPIProvider and
# the provider bases, shipped as `logos-qt-host`. It used to come from
# logos-qt-sdk; LogosTest.cmake now names logos-qt-host::logos_qt_host.
#
# Tracks master again. The cc24fa1 pin existed because `logos-qt-host` did
# not yet exist on plugin-qt's master; logos-plugin-qt#19 ("the Qt host
# runtime and cdylib-glue generator") MERGED, and master (9b2c64e)
# publishes logos-qt-host keyed by forAllTargets. The PR was squash-merged,
# so cc24fa1 is not an ancestor of master — its content is.
#
# Still load-bearing: this must resolve to the SAME logos-qt-host that
# logos-qt-sdk pulls in, or the example tests would link two copies of the
# host runtime. logos-qt-sdk is still rev-pinned (below) and pins its own
# logos-plugin-qt, so that input is made to `follows` this one.
logos-plugin-qt = {
url = "github:logos-co/logos-plugin-qt";
inputs.logos-nix.follows = "logos-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.logos-protocol.follows = "logos-protocol";
};
# Still an input: logos-qt-sdk ships the Qt-typed consumer headers that are
# NOT part of the host runtime (logos_qt_lp_bridge.h, logos_qt_wire.h,
# logos_ui_plugin_context.h), and LogosTest.cmake keeps accepting
# LOGOS_QT_SDK_ROOT for callers that have not moved yet.
#
# THE ONE PIN THAT STAYS. logos-qt-sdk#33 ("split the SDK by capability, and
# retire the Qt-module backends") is still OPEN, so unlike the three inputs
# above there is nothing on master to retire this rev in favour of: qt-sdk's
# master still carries the forwarding headers this repo's LOGOS_QT_SDK_ROOT
# block no longer expects to find. Drop the rev once #33 merges.
#
# Unpinned: feat/sdk-codegen-b3-d11 merged (logos-qt-sdk#33), so master has
# the B3 shape this repo compiles against.
#
# The `logos-plugin-qt` follows below STAYS, and is now the only thing
# holding the property the rev pin used to hold with it: qt-sdk's default
# package propagates whatever logos-qt-host it resolved, so without the
# follows the example tests could see two logos-qt-host store paths — one via
# this input, one via the direct `logos-plugin-qt` — which is the duplicate-
# host split-brain these pins were keeping shut. (qt-sdk master no longer
# rev-pins plugin-qt itself, so both sides land on plugin-qt master; the
# follows is what guarantees it rather than leaving it to coincidence.)
logos-qt-sdk = {
url = "github:logos-co/logos-qt-sdk";
inputs.logos-nix.follows = "logos-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.logos-protocol.follows = "logos-protocol";
inputs.logos-cpp-sdk.follows = "logos-cpp-sdk";
inputs.logos-plugin-qt.follows = "logos-plugin-qt";
};
nixpkgs.follows = "logos-nix/nixpkgs";
};
outputs = { self, nixpkgs, logos-nix, logos-cpp-sdk, logos-protocol, logos-plugin-qt, logos-qt-sdk, ... }:
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
inherit system;
pkgs = import nixpkgs { inherit system; };
});
in
{
# Library functions for building module tests
lib = {
mkLogosModuleTests = args: import ./nix/mkLogosModuleTests.nix args;
};
# The framework as a package (headers + cmake + sources)
packages = forAllSystems ({ pkgs, system, ... }:
let
logosSdk = logos-cpp-sdk.packages.${system}.default;
frameworkPkg = pkgs.stdenv.mkDerivation {
pname = "logos-test-framework";
version = "0.1.0";
src = ./.;
# No build step — just install headers, cmake, and sources
dontBuild = true;
installPhase = ''
mkdir -p $out/include $out/cmake $out/src
cp include/*.h $out/include/
cp cmake/*.cmake $out/cmake/
cp src/*.cpp $out/src/
'';
meta = with pkgs.lib; {
description = "Logos Module Test Framework";
license = licenses.mit;
};
};
in {
default = frameworkPkg;
}
);
# Build the shipped examples through LogosTest.cmake. This is the only
# place the framework's own CMake gets exercised: every other consumer
# drives it from their repo, so without this a repoint of the host
# runtime would be unverifiable here.
#
# There used to be a second check, `example-tests-qt-sdk`, covering the
# pre-split path where LOGOS_QT_SDK_ROOT alone supplied the host runtime.
# logos-qt-sdk no longer carries those headers, so that path does not
# exist to be covered — LogosTest.cmake now demands LOGOS_QT_HOST_ROOT.
checks = forAllSystems ({ pkgs, system, ... }:
let
mkExampleTests = { name, logosQtHost, logosQtSdk ? null }:
(import ./nix/mkLogosModuleTests.nix {
inherit pkgs logosQtHost logosQtSdk;
src = ./.;
testDir = ./examples/basic-module-test;
logosSdk = logos-cpp-sdk.packages.${system}.default;
logosProtocol = logos-protocol.packages.${system}.default;
testFramework = self.packages.${system}.default;
}).overrideAttrs (_: { pname = name; });
in {
example-tests = mkExampleTests {
name = "logos-test-framework-example-tests";
logosQtHost = logos-plugin-qt.packages.${system}.logos-qt-host;
logosQtSdk = logos-qt-sdk.packages.${system}.default;
};
}
);
# Development shell for working on the framework
devShells = forAllSystems ({ pkgs, system, ... }:
let
logosSdk = logos-cpp-sdk.packages.${system}.default;
logosQtHost = logos-plugin-qt.packages.${system}.logos-qt-host;
logosQtSdk = logos-qt-sdk.packages.${system}.default;
logosProtocol = logos-protocol.packages.${system}.default;
in {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cmake
pkg-config
qt6.wrapQtAppsHook
];
buildInputs = with pkgs; [
qt6.qtbase
qt6.qtremoteobjects
logosSdk
logosQtHost
logosQtSdk
logosProtocol
];
shellHook = ''
export LOGOS_CPP_SDK_ROOT="${logosSdk}"
export LOGOS_QT_HOST_ROOT="${logosQtHost}"
export LOGOS_QT_SDK_ROOT="${logosQtSdk}"
export LOGOS_PROTOCOL_ROOT="${logosProtocol}"
export LOGOS_TEST_FRAMEWORK_ROOT="${./.}"
echo "Logos Test Framework development environment"
'';
};
}
);
};
}