!lTqhfnNvIkcEackxxk:matrix.org

Nix Bindings

73 Members
Nix C API https://github.com/NixOS/nix/blob/master/doc/manual/src/c-api.md, language-specific bindings, and their use cases (currently broken link: https://nixos.org/manual/nix/unstable/c-api)20 Servers

Load older messages


SenderMessageTime
15 Apr 2025
@o-santi:matrix.orgLeonardo Santiago

I'm using pkg-config to find and link against the C libraries, and it seems to have a .statik(true) option to static link each of them, but the moment I try to set it, it complains that it can't find them:

  The file `nix-expr-c.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  PKG_CONFIG_PATH_FOR_TARGET contains the following:
      - /nix/store/f2q12pxzicc2739nsxg35yfzqqja1jbg-python3-3.12.8-env/lib/pkgconfig
      - /nix/store/7qxaap76irik1jqmqzgjwkrw3qs7mpcw-nix-store-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/wizqfb99xs3f4fh856bgp5qzvs76scbr-nix-util-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/9c9h0zbqa9xfk6pk4387l1h9pj28r692-nix-util-2.27.0-dev/lib/pkgconfig
      - /nix/store/b5fg5mqb5y1r1yvzf9paql1cr1iqy4ma-boost-1.81.0-dev/lib/pkgconfig
      - /nix/store/47zbszclyyy55nb5z7dvpcki4x5g99v4-libarchive-3.7.7-dev/lib/pkgconfig
      - /nix/store/rwrb0afm7z79720kb2kb84vyzcbslc5i-attr-2.5.2-dev/lib/pkgconfig
      - /nix/store/gsddsc9hs8l3j26r5958xcc5hhdf6hlf-acl-2.3.2-dev/lib/pkgconfig
      - /nix/store/c303g1m646jv9rir4zv49q1ggphsh9b5-nlohmann_json-3.11.3/share/pkgconfig
      - /nix/store/n29xgyyb4ig1sc275j8d9h7blx3g3jam-nix-store-2.27.0-dev/lib/pkgconfig
      - /nix/store/v8paqfgzs6gyznsxwmgwa798nr10yk11-nix-util-2.27.0-dev/lib/pkgconfig
      - /nix/store/xlw57h1x6r9l1kj8f25ij0n4j22i094n-nix-expr-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/x980i1fsgak6392wj9jxnr7d1yzcmpsd-nix-store-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/1fxkf2bvj1mcvrydx053bw7kyqnnplkg-nix-store-2.27.0-dev/lib/pkgconfig
      - /nix/store/0iv0kkf8hyzjv7rnxhbkvg8s0gqnk3h7-nix-expr-2.27.0-dev/lib/pkgconfig
      - /nix/store/sdx89ykxak1rdzxlg6qpb70n5bar354m-nix-fetchers-2.27.0-dev/lib/pkgconfig
      - /nix/store/6mn1mdcvv6rgyj8q2wh5q3v0riv3z3z1-boehm-gc-8.2.8-dev/lib/pkgconfig
      - /nix/store/ah7ylnwnsaibh71dnkxranzqahypy714-nix-util-c-2.27.0-dev/lib/pkgconfig
16:06:07
@o-santi:matrix.orgLeonardo Santiago *

I'm using pkg-config to find and link against the C libraries inside the build.rs, and it seems to have a .statik(true) option to static link each of them, but the moment I try to set it, it complains that it can't find them:

  The file `nix-expr-c.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  PKG_CONFIG_PATH_FOR_TARGET contains the following:
      - /nix/store/f2q12pxzicc2739nsxg35yfzqqja1jbg-python3-3.12.8-env/lib/pkgconfig
      - /nix/store/7qxaap76irik1jqmqzgjwkrw3qs7mpcw-nix-store-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/wizqfb99xs3f4fh856bgp5qzvs76scbr-nix-util-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/9c9h0zbqa9xfk6pk4387l1h9pj28r692-nix-util-2.27.0-dev/lib/pkgconfig
      - /nix/store/b5fg5mqb5y1r1yvzf9paql1cr1iqy4ma-boost-1.81.0-dev/lib/pkgconfig
      - /nix/store/47zbszclyyy55nb5z7dvpcki4x5g99v4-libarchive-3.7.7-dev/lib/pkgconfig
      - /nix/store/rwrb0afm7z79720kb2kb84vyzcbslc5i-attr-2.5.2-dev/lib/pkgconfig
      - /nix/store/gsddsc9hs8l3j26r5958xcc5hhdf6hlf-acl-2.3.2-dev/lib/pkgconfig
      - /nix/store/c303g1m646jv9rir4zv49q1ggphsh9b5-nlohmann_json-3.11.3/share/pkgconfig
      - /nix/store/n29xgyyb4ig1sc275j8d9h7blx3g3jam-nix-store-2.27.0-dev/lib/pkgconfig
      - /nix/store/v8paqfgzs6gyznsxwmgwa798nr10yk11-nix-util-2.27.0-dev/lib/pkgconfig
      - /nix/store/xlw57h1x6r9l1kj8f25ij0n4j22i094n-nix-expr-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/x980i1fsgak6392wj9jxnr7d1yzcmpsd-nix-store-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/1fxkf2bvj1mcvrydx053bw7kyqnnplkg-nix-store-2.27.0-dev/lib/pkgconfig
      - /nix/store/0iv0kkf8hyzjv7rnxhbkvg8s0gqnk3h7-nix-expr-2.27.0-dev/lib/pkgconfig
      - /nix/store/sdx89ykxak1rdzxlg6qpb70n5bar354m-nix-fetchers-2.27.0-dev/lib/pkgconfig
      - /nix/store/6mn1mdcvv6rgyj8q2wh5q3v0riv3z3z1-boehm-gc-8.2.8-dev/lib/pkgconfig
      - /nix/store/ah7ylnwnsaibh71dnkxranzqahypy714-nix-util-c-2.27.0-dev/lib/pkgconfig
16:06:18
@o-santi:matrix.orgLeonardo Santiago *

I'm using pkg-config to find and link against the C libraries inside the build.rs, and it seems to have a .statik(true) option to static link each of them, but the moment I try to set it, it complains that it can't find them even though the lib/pkgconfig path seems to be correctly configured:

  The file `nix-expr-c.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  PKG_CONFIG_PATH_FOR_TARGET contains the following:
      - /nix/store/f2q12pxzicc2739nsxg35yfzqqja1jbg-python3-3.12.8-env/lib/pkgconfig
      - /nix/store/7qxaap76irik1jqmqzgjwkrw3qs7mpcw-nix-store-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/wizqfb99xs3f4fh856bgp5qzvs76scbr-nix-util-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/9c9h0zbqa9xfk6pk4387l1h9pj28r692-nix-util-2.27.0-dev/lib/pkgconfig
      - /nix/store/b5fg5mqb5y1r1yvzf9paql1cr1iqy4ma-boost-1.81.0-dev/lib/pkgconfig
      - /nix/store/47zbszclyyy55nb5z7dvpcki4x5g99v4-libarchive-3.7.7-dev/lib/pkgconfig
      - /nix/store/rwrb0afm7z79720kb2kb84vyzcbslc5i-attr-2.5.2-dev/lib/pkgconfig
      - /nix/store/gsddsc9hs8l3j26r5958xcc5hhdf6hlf-acl-2.3.2-dev/lib/pkgconfig
      - /nix/store/c303g1m646jv9rir4zv49q1ggphsh9b5-nlohmann_json-3.11.3/share/pkgconfig
      - /nix/store/n29xgyyb4ig1sc275j8d9h7blx3g3jam-nix-store-2.27.0-dev/lib/pkgconfig
      - /nix/store/v8paqfgzs6gyznsxwmgwa798nr10yk11-nix-util-2.27.0-dev/lib/pkgconfig
      - /nix/store/xlw57h1x6r9l1kj8f25ij0n4j22i094n-nix-expr-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/x980i1fsgak6392wj9jxnr7d1yzcmpsd-nix-store-c-2.27.0-dev/lib/pkgconfig
      - /nix/store/1fxkf2bvj1mcvrydx053bw7kyqnnplkg-nix-store-2.27.0-dev/lib/pkgconfig
      - /nix/store/0iv0kkf8hyzjv7rnxhbkvg8s0gqnk3h7-nix-expr-2.27.0-dev/lib/pkgconfig
      - /nix/store/sdx89ykxak1rdzxlg6qpb70n5bar354m-nix-fetchers-2.27.0-dev/lib/pkgconfig
      - /nix/store/6mn1mdcvv6rgyj8q2wh5q3v0riv3z3z1-boehm-gc-8.2.8-dev/lib/pkgconfig
      - /nix/store/ah7ylnwnsaibh71dnkxranzqahypy714-nix-util-c-2.27.0-dev/lib/pkgconfig
16:06:52
16 Apr 2025
@alexandrutocar:matrix.orgAlexandru Tocar joined the room.11:47:53
1 May 2025
@rosariopulella:matrix.orgRosario Pulella changed their display name from Rosario Pulella to Rosuavio.20:08:52
2 May 2025
@zmitchell:matrix.orgzmitchell joined the room.20:13:39
17 May 2025
@terrorjack:matrix.orgterrorjack set a profile picture.08:53:49
29 May 2025
@o-santi:matrix.orgLeonardo Santiago

I'm getting this very weird error when trying to update nix to the latest version:

 error: linking with `cc` failed: exit status: 1
(...)
/nix/store/yrrg35ii81mlcfkymv45amlxshd2a9sa-nix-util-2.29.0pre/lib/libnixutil.so: undefined reference to `__cxa_call_terminate@CXXABI_1.3.15'
13:25:32
@o-santi:matrix.orgLeonardo Santiago I didn't remove nor add any new things, just nix flake update nix && nix build 13:26:20
@o-santi:matrix.orgLeonardo Santiago Robert Hensing (roberth): did anything change in the libs side? I tried looking this error up and all I could find was a gcc version mismatch on different libraries, not sure that's the case here 13:27:17
@o-santi:matrix.orgLeonardo Santiago * I didn't remove nor add any new packages, just nix flake update nix && nix build 13:28:34
@o-santi:matrix.orgLeonardo Santiagois this a problem with libstd++? maybe a version mismatch?13:36:39
@o-santi:matrix.orgLeonardo Santiago nix/2.28.0 seems to be fine, nix/2.29.0 does reproduce the issue 13:42:58
@o-santi:matrix.orgLeonardo Santiago sadly I'm looking for libflake-c upgrades, 2.28.0 doesn't seem to contain, time to do some git bisect 13:44:31
@o-santi:matrix.orgLeonardo Santiago
c212035d94ee4407cd19927ba33e3246a07a54d0 is the first bad commit
commit c212035d94ee4407cd19927ba33e3246a07a54d0
Author: Robert Hensing <robert@roberthensing.nl>
Date:   Tue Apr 1 15:19:41 2025 +0200

    flake: nixpkgs: 24.11 -> nixos-unstable
    
    Flake lock file updates:
    
    • Updated input 'nixpkgs':
        'github:NixOS/nixpkgs/48d12d5e70ee91fe8481378e540433a7303dbf6a?narHash=sha256-1Noao/H%2BN8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E%3D' (2024-12-16)
      → 'github:NixOS/nixpkgs/52faf482a3889b7619003c0daec593a1912fddc1?narHash=sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om%2BD4UnDhlDW9BE%3D' (2025-03-30)

 flake.lock | 8 ++++----
 flake.nix  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
bisect found first bad commit

14:14:20
@o-santi:matrix.orgLeonardo Santiago *
c212035d94ee4407cd19927ba33e3246a07a54d0 is the first bad commit
commit c212035d94ee4407cd19927ba33e3246a07a54d0
Author: Robert Hensing <robert@roberthensing.nl>
Date:   Tue Apr 1 15:19:41 2025 +0200

    flake: nixpkgs: 24.11 -> nixos-unstable
    
    Flake lock file updates:
    
    • Updated input 'nixpkgs':
        'github:NixOS/nixpkgs/48d12d5e70ee91fe8481378e540433a7303dbf6a?narHash=sha256-1Noao/H%2BN8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E%3D' (2024-12-16)
      → 'github:NixOS/nixpkgs/52faf482a3889b7619003c0daec593a1912fddc1?narHash=sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om%2BD4UnDhlDW9BE%3D' (2025-03-30)

 flake.lock | 8 ++++----
 flake.nix  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
bisect found first bad commit
14:14:36
@roberthensing:matrix.orgRobert Hensing (roberth)Hmm yeah. Was going to say no major changes on our side14:14:43
@o-santi:matrix.orgLeonardo Santiago it seems that it might be related to the nixpkgs upgrade in nix 14:15:12
@o-santi:matrix.orgLeonardo Santiago though I'm not sure how, maybe it changed the major version of cc (is it using clang?) and the one I'm using is incompatible with it? 14:15:44
@o-santi:matrix.orgLeonardo SantiagoI looked up your nixops4 setup and it seemed pretty similar (almost exactly the same) as mine so I don't know what I'm doing wrongly14:16:13
@roberthensing:matrix.orgRobert Hensing (roberth)

clang?

Not on linux

14:16:18
@o-santi:matrix.orgLeonardo Santiago oh, so it's on gcc? that may be it, you have some gcc measures that I'm not using 14:16:45
@roberthensing:matrix.orgRobert Hensing (roberth)I do use clang on linux in my dev shell when hacking on the thing14:17:38
@o-santi:matrix.orgLeonardo SantiagoI'm not a super c++ guy but the only instance I found someone commenting this was because of a gcc13 -> 14 version mismatch and so I think that'd be the issue here too14:18:03
@roberthensing:matrix.orgRobert Hensing (roberth) May be possible to build it that way with pkgsLLVM 14:18:07
@o-santi:matrix.orgLeonardo Santiagoespecially given that it is a nixpkgs upgrade14:18:08
@o-santi:matrix.orgLeonardo Santiagowdym?14:18:20
@roberthensing:matrix.orgRobert Hensing (roberth) Something like nix build nixpkgs#pkgsLLVM.nixVersions.git 14:19:03
@roberthensing:matrix.orgRobert Hensing (roberth)It's not the most reliably buildable package set, but if it works...14:19:30
@o-santi:matrix.orgLeonardo Santiago oh, it was building fine with gcc before, I'll try to add your gcc countermeasures and see if that fixes it 14:19:45

Show newer messages


Back to Room ListRoom Version: 10