mirror of
https://github.com/logos-co/logos-liblogos.git
synced 2026-08-27 04:41:12 +00:00
fix(nix): propagate nlohmann_json, and stop pointing at a deleted file
Two small follow-ups to the shared-runtime migration.
PROPAGATE nlohmann_json. This repo re-exports the Qt host runtime headers, and
two of them -- logos_provider_object.h and logos_qt_arg_decode.h -- include
<nlohmann/json.hpp>. Anything compiling against these includes therefore needs
nlohmann on its include path whether or not it has ever heard of nlohmann.
Consumers going through find_package(logos-qt-host) already get it: that package
find_dependency's logos-protocol, which PUBLIC-links nlohmann_json. Consumers
taking the include directory directly do not, and they exist.
Set in TWO places, which is not redundant: symlinkJoin builds a NEW derivation
and does not carry the propagation of the paths it joins. Consumers take the
join, not the headers output, so setting it only on the latter reaches nobody --
measured, a consumer still failed until the join carried it too.
WHAT THIS DOES NOT FIX, measured rather than assumed: a consumer that takes
liblogos as a bare attribute and interpolates ''${logosLiblogos}/include has no
dependency edge for propagation to travel along, so it still needs nlohmann in
its own buildInputs. logos-module-viewer is that shape.
DANGLING POINTER. The comment in src/CMakeLists.txt sent readers to
logos-basecamp/cmake/LogosSharedFromDll.cmake, deleted in logos-basecamp#348 and
logos-logoscore-cli#98. Now says where it went and why.
nix build .#default PASS.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
committed by
Dario Lipicar
co-authored by
Claude Opus 5
parent
b2a9a0ba9d
commit
eeb5cd3270
@@ -192,15 +192,31 @@
|
||||
includePortable = import ./nix/include.nix { inherit pkgs src logosSdk; inherit logosProtocolPkg logosQtSdk logosQtHost; common = commonPortable; };
|
||||
|
||||
# Combined package (dev)
|
||||
#
|
||||
# propagatedBuildInputs is set HERE as well as on the headers output,
|
||||
# and that is not redundant: symlinkJoin builds a NEW derivation and
|
||||
# does not carry the propagation of the paths it joins. Consumers take
|
||||
# this join, not the headers output, so setting it only there reaches
|
||||
# nobody -- measured, logos-module-viewer still failed with
|
||||
# fatal error: nlohmann/json.hpp: No such file or directory
|
||||
# until it was set on the join too.
|
||||
#
|
||||
# nlohmann is needed because this output re-exports the Qt host runtime
|
||||
# headers, two of which (logos_provider_object.h, logos_qt_arg_decode.h)
|
||||
# include <nlohmann/json.hpp>. Consumers going through
|
||||
# find_package(logos-qt-host) get it transitively; consumers taking the
|
||||
# include directory directly do not.
|
||||
liblogos = pkgs.symlinkJoin {
|
||||
name = "logos-liblogos";
|
||||
paths = [ bin lib include ];
|
||||
propagatedBuildInputs = [ pkgs.nlohmann_json ];
|
||||
};
|
||||
|
||||
# Combined package (portable)
|
||||
liblogosPortable = pkgs.symlinkJoin {
|
||||
name = "logos-liblogos-portable";
|
||||
paths = [ binPortable libPortable includePortable ];
|
||||
propagatedBuildInputs = [ pkgs.nlohmann_json ];
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
@@ -8,6 +8,24 @@ pkgs.stdenv.mkDerivation {
|
||||
|
||||
inherit src;
|
||||
inherit (common) meta;
|
||||
|
||||
# This output RE-EXPORTS the Qt host runtime headers, and two of them --
|
||||
# logos_provider_object.h and logos_qt_arg_decode.h -- include
|
||||
# <nlohmann/json.hpp>. So anything compiling against these includes needs
|
||||
# nlohmann on its include path, whether or not it has ever heard of nlohmann.
|
||||
#
|
||||
# Consumers that go through find_package(logos-qt-host) already get it: that
|
||||
# package find_dependency's logos-protocol, which PUBLIC-links nlohmann_json.
|
||||
# Consumers that take the include directory DIRECTLY -- logos-module-viewer
|
||||
# uses find_library + raw -I, and it is not alone in that -- bypass CMake's
|
||||
# propagation entirely and fail with
|
||||
#
|
||||
# fatal error: nlohmann/json.hpp: No such file or directory
|
||||
#
|
||||
# in a repo that never mentions nlohmann. Propagating it here fixes both
|
||||
# shapes at the source rather than adding a dependency to each consumer that
|
||||
# trips over it, which is a list that only grows.
|
||||
propagatedBuildInputs = [ pkgs.nlohmann_json ];
|
||||
|
||||
# No build phase needed, just install headers
|
||||
dontBuild = true;
|
||||
|
||||
+3
-1
@@ -239,7 +239,9 @@ target_compile_definitions(logos_core PRIVATE LOGOS_CORE_LIBRARY)
|
||||
# WHAT DID NOT CHANGE is the invariant. The runtime must still exist exactly
|
||||
# once per process; it is now enforced by there being one shared library per
|
||||
# type rather than by one image absorbing everything. Consumers still empty
|
||||
# their static archives (logos-basecamp/cmake/LogosSharedFromDll.cmake) so ld
|
||||
# their static archives (that was logos-basecamp/cmake/LogosSharedFromDll.cmake,
|
||||
# deleted in logos-basecamp#348 and logos-logoscore-cli#98 once they linked the
|
||||
# shared libraries directly and had no second static copy left to suppress) so ld
|
||||
# cannot pull an archive member that would redefine an imported symbol, and
|
||||
# logos-basecamp/nix/symbol-gate.nix still asserts the result.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user