Dario LipicarandClaude Opus 5 f55bf91b8a feat(windows): make libpq and abseil-cpp build for a mingw host (#4)
Both are declared by Logos modules in metadata nix.packages.runtime and
neither builds for x86_64-w64-mingw32. Fixed here rather than in each
consumer, since metadata has no per-platform gating (parseMetadata.nix
produces one flat list).

Common cause: nixpkgs builds mingw-w64 against mcfgthread, so pthread.h
and libpthread.a are absent from the whole cross closure. This is the
fifth unrelated-looking failure from that one hole -- libpq, Rust's
windows-gnu std, lsquic's clock_gettime64, nim-boringssl, and now abseil
-- and each time the fix is windows.pthreads in buildInputs.

abseil-cpp: thread_identity.cc includes <pthread.h> unconditionally.

libpq: four obstacles -- curlSupport=false (postgres 18 links libcurl for
OAuth, and curl cross drags in ngtcp2 -> nghttp3, whose EXAMPLES include
<arpa/inet.h>); drop make-shell-wrapper-hook (wants a HOST bash, which
mingw does not build, and libpq never calls wrapProgram); windows.pthreads;
separateDebugInfo=false (that hook is the ELF split).

The libpq entry is the CLIENT library only. Full postgresql has no mingw
build and is deliberately not exposed -- a module wanting postgres should
declare libpq, which is all it ever links or dlopens.

Verified: abseil-cpp builds producing libabsl_*.dll.a; libpq.dll builds,
loads on real Windows 10.0.26200, and PQconnectdb/PQexec/PQfinish/
PQlibVersion resolve.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 14:49:32 -03:00

logos-nix

Shared Nix infrastructure for all Logos projects. Provides a single pinned nixpkgs and common build dependencies so downstream repos stay in sync without depending on an actual project as their flake root.

Previously, logos-cpp-sdk served as the follows root. This caused unnecessary cache invalidation on every SDK commit and coupled infrastructure concerns to an active development project.

What it provides

Output Description
nixpkgs input Pinned nixos-unstable revision shared across all projects
devShells.default Common dev environment: cmake, ninja, pkg-config, qt6.qtbase, qt6.qtremoteobjects
lib.forAllSystems Helper to generate outputs for all supported systems
lib.supportedSystems aarch64-darwin, x86_64-darwin, aarch64-linux, x86_64-linux

Usage

As a follows root (most projects)

{
  inputs = {
    logos-nix.url = "github:logos-co/logos-nix";
    nixpkgs.follows = "logos-nix/nixpkgs";
  };
}

Using the dev shell

{
  inputs = {
    logos-nix.url = "github:logos-co/logos-nix";
    nixpkgs.follows = "logos-nix/nixpkgs";
  };

  outputs = { self, nixpkgs, logos-nix }:
    logos-nix.lib.forAllSystems ({ system, pkgs }: {
      devShells.default = pkgs.mkShell {
        inputsFrom = [ logos-nix.devShells.${system}.default ];
        # add project-specific deps here
      };
    });
}

Migration from logos-cpp-sdk

 inputs = {
-  logos-cpp-sdk.url = "github:logos-co/logos-cpp-sdk";
-  nixpkgs.follows = "logos-cpp-sdk/nixpkgs";
+  logos-nix.url = "github:logos-co/logos-nix";
+  nixpkgs.follows = "logos-nix/nixpkgs";
+  logos-cpp-sdk.url = "github:logos-co/logos-cpp-sdk";  # only if you need the SDK
 };

Then run nix flake update to re-lock.

S
Description
No description provided
Readme
240 KiB
Languages
Nix 100%