!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

848 Members
For people hacking on the Nix package manager itself183 Servers

Load older messages


SenderMessageTime
6 Sep 2025
@timschumi:matrix.orgtimschumi joined the room.18:47:26
@timschumi:matrix.orgtimschumiI'm currently on a very fun trip into ca-derivations, currently fighting with a package that appears to try to build/install into the nix store even if it already exists. Are there any tips as to figure out why Nix decides to rebuild that package?18:48:00
@timschumi:matrix.orgtimschumi
error: builder for '/nix/store/jvhilihvvhpp06fwld4hcbd0mh23lvvq-file-5.45.drv' failed with exit code 2;
       last 25 log lines:
       > make[1]: Entering directory '/build/file-5.45/python'
       > make[1]: Nothing to be done for 'check'.
       > make[1]: Leaving directory '/build/file-5.45/python'
       > make[1]: Entering directory '/build/file-5.45'
       > make[1]: Leaving directory '/build/file-5.45'
       > Running phase: installPhase
       > install flags: -j4 SHELL=/nix/store/x2851i2wapwmbr4gaq2g7ybnz1sms0kr-bash-5.3p3/bin/bash pkgconfigdir=/nix/store/xblakyv8z3hvdzvd2ng1dyiab92l474d-file-5.45-dev/lib/pkgconfig m4datadir=/nix/store/xblakyv8z3hvdzvd2ng1dyiab92l474d-file-5.45-dev/share/aclocal aclocaldir=/nix/store/xblakyv8z3hvdzvd2ng1dyiab92l474d-file-5.45-dev/share/aclocal install
       > Making install in src
       > make[1]: Entering directory '/build/file-5.45/src'
       > make  install-am
       > make[2]: Entering directory '/build/file-5.45/src'
       > make[3]: Entering directory '/build/file-5.45/src'
       >  /nix/store/05wpyv2imar5xwyjmigc4c060d359zpc-coreutils-9.7/bin/mkdir -p '/nix/store/dr62dbw08z1ff3y423zw6xh8pff12n3p-file-5.45/lib'
       >  /nix/store/05wpyv2imar5xwyjmigc4c060d359zpc-coreutils-9.7/bin/mkdir -p '/nix/store/xblakyv8z3hvdzvd2ng1dyiab92l474d-file-5.45-dev/include'
       >  /nix/store/x2851i2wapwmbr4gaq2g7ybnz1sms0kr-bash-5.3p3/bin/bash ../libtool   --mode=install /nix/store/05wpyv2imar5xwyjmigc4c060d359zpc-coreutils-9.7/bin/install -c   libmagic.la '/nix/store/dr62dbw08z1ff3y423zw6xh8pff12n3p-file-5.45/lib'
       >  /nix/store/05wpyv2imar5xwyjmigc4c060d359zpc-coreutils-9.7/bin/install -c -m 644 magic.h '/nix/store/xblakyv8z3hvdzvd2ng1dyiab92l474d-file-5.45-dev/include'
       > libtool: install: /nix/store/05wpyv2imar5xwyjmigc4c060d359zpc-coreutils-9.7/bin/install -c .libs/libmagic.so.1.0.0 /nix/store/dr62dbw08z1ff3y423zw6xh8pff12n3p-file-5.45/lib/libmagic.so.1.0.0
       > install: cannot remove '/nix/store/dr62dbw08z1ff3y423zw6xh8pff12n3p-file-5.45/lib/libmagic.so.1.0.0': Permission denied
       > make[3]: *** [Makefile:467: install-libLTLIBRARIES] Error 1
       > make[3]: Leaving directory '/build/file-5.45/src'
       > make[2]: *** [Makefile:709: install-am] Error 2
       > make[2]: Leaving directory '/build/file-5.45/src'
       > make[1]: *** [Makefile:702: install] Error 2
       > make[1]: Leaving directory '/build/file-5.45/src'
       > make: *** [Makefile:464: install-recursive] Error 1
       For full logs, run:
         nix log /nix/store/jvhilihvvhpp06fwld4hcbd0mh23lvvq-file-5.45.drv
18:48:10
@timschumi:matrix.orgtimschumi

The directory where file is trying to install itself into is ovbiously already existing and well-referred:

$ nix-store --query --referrers /nix/store/dr62dbw08z1ff3y423zw6xh8pff12n3p-file-5.45
/nix/store/dr62dbw08z1ff3y423zw6xh8pff12n3p-file-5.45
/nix/store/0w79a0jh56j5dwm15k5a72caizqqasli-stdenv-linux.drv
/nix/store/80jx7q4ngfgbnljbvx2g3hsx82ad4yfx-stdenv-linux
/nix/store/117p1nn1fm3ylwhfmbzjh3fly8a7vgg8-Private.SourceBuilt.Artifacts.8.0.118-servicing.25323.1.centos.9-x64
/nix/store/15mvhsvv80ikl6d5n2gsxawbf1lmggl4-stdenv-linux
/nix/store/1wcj6nwanpphksfah0z8d4f74giznpjl-stdenv-linux.drv
[...]
18:48:18
@timschumi:matrix.orgtimschumi * I'm currently on a very fun trip into ca-derivations, currently fighting with a package that appears to try to build/install into the nix store even if it already exists. Are there any tips as to figure out why Nix decides to rebuild that package? 18:49:11
7 Sep 2025
@bookshorse:matrix.org@bookshorse:matrix.org removed their profile picture.06:14:31
@bookshorse:matrix.org@bookshorse:matrix.org removed their display name bookshorse.06:14:40
@bookshorse:matrix.org@bookshorse:matrix.org left the room.06:15:16
@aspentropy:matrix.orgAspen Smith joined the room.09:43:20
@aspentropy:matrix.orgAspen Smith Sergei Zimmerman (xokdvium): hi! I am at the nixcon hack day, trying to get rid of null-terminated strings; John Ericson told me to reach out to you 09:45:55
@aspentropy:matrix.orgAspen Smithwhen I did pascal-strings for tvix-eval it was like a 15% improvement on evaluating pkgs.hello.outPath09:48:22
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) FWIW Lix is also moving in this direction. https://git.lix.systems/lix-project/lix/issues/963 emily 09:50:17
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) Aspen Smith: https://github.com/NixOS/nix/pull/13407 09:57:36
@slime90:matrix.org@slime90:matrix.org left the room.15:39:56
@desttinghim:matrix.org@desttinghim:matrix.org left the room.21:34:45
8 Sep 2025
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)

Some insights into 128 bit atomics in gcc:

https://gcc.gnu.org/legacy-ml/gcc/2018-02/msg00224.html

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84563

00:11:35
@inayet:matrix.orginayet set a profile picture.02:15:58
@oddlama:matrix.orgoddlama joined the room.13:36:49
@oddlama:matrix.orgoddlama

I'm having trouble overriding stdenv for the nix package:

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";

  outputs =
    inputs:
    let
      pkgs = import inputs.nixpkgs {
        system = "x86_64-linux";
      };
    in
    {
      packages.x86_64-linux = {
        nix_2_30_clang = pkgs.nixVersions.nix_2_30.override {
          stdenv = pkgs.clangStdenv;
        };
      };
    };
}

Building this package does not actually trigger a build but reuses the gcc artifacts while rebuilding some kind of wrapper (?)

$ nix build .#packages.x86_64-linux.nix_2_30_clang
$ readelf -p .comment ./result/bin/nix
String dump of section '.comment':
  [     1]  GCC: (GNU) 14.3.0

This should probably say something like:

  [     0]  GCC: (GNU) 14.3.0
  [    12]  clang version 18.1.8

Overriding still works for the autoconf based build (nix_2_24) but not for any of the newer package builds. It seems like the override is silently ignored and not passed down to the sub-derivations anymore.

13:50:11
@sandro:supersandro.deSandro 🐧

Did you try?

nixVersions = prev.nixVersions.extend (final: prev: 
  nixComponents_2_31 = prev.nixComponents_2_31.overrideScope (finalScope: prevScope: { stdenv = pkgs_25_05.clangStdenv; };
};
14:37:21
@oddlama:matrix.orgoddlamaYes that is looking good, thanks. Is this the preferred way to do overrides for those types of packages now?15:35:33
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)
In reply to @oddlama:matrix.org
Yes that is looking good, thanks. Is this the preferred way to do overrides for those types of packages now?
For the modular packaging - yes. Since now this is not a monolithic package that you can override
16:04:22
@sandro:supersandro.deSandro 🐧

Also an example on how to add patches

    nixComponents_2_31 = (prev.nixComponents_2_31.overrideScope (finalScope: prevScope: {
      aws-sdk-cpp = null;
      boost = boost231;
      withAWS = false;
    })).appendPatches (commonPatches ++ [
      ./nix-derivation-better-copy-2.30.diff
    ]);
16:05:49
9 Sep 2025
@winter:catgirl.cloudWinter this is seemingly missing where commonPatches comes from fyi 02:21:31
@sandro:supersandro.deSandro 🐧 *

Also an example on how to add patches

    nixComponents_2_31 = (prev.nixComponents_2_31.overrideScope (finalScope: prevScope: {
      aws-sdk-cpp = null;
      boost = boost231;
      withAWS = false;
    })).appendPatches [
      ./nix-derivation-better-copy-2.30.diff
    ];
08:50:38
@sandro:supersandro.deSandro 🐧That's just a list I have somewhere above in a let in08:50:56
@aciceri:nixos.devaciceri changed their display name from zrsk to aciceri.15:02:57
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Curiously, Boehm granule size on 64 bit systems is 16 bytes. That means that 16 byte atomics for Value are very workable, since x86_64 needs stuff to be 16 bytes aligned (otherwise memory might straddle the cache line and that won’t be atomic ever)17:31:17
10 Sep 2025
@ss:someonex.netSomeoneSerge (back on matrix) changed their display name from SomeoneSerge (@nixcon & back on matrix) to SomeoneSerge (back on matrix).00:34:03
@nerves:bark.lgbt@nerves:bark.lgbt left the room.12:31:49

Show newer messages


Back to Room ListRoom Version: 6