Error rebuilding NixOS (ncurses)

I’ve been a NixOS user for a while, but to be honest I got distracted by other things and didn’t pay a lot of attention to/update my system for a few months. So just now, I tried to update. Updated my flake and rebuilt (I’m on unstable), and I got an error building ncurses. Like I said, it’s been a while, but I don’t recall running into anything like this before. Apparently it’s a system dependency, so I can’t simply downgrade ncurses to 24.11. Of course, I could move everything from unstable to 24.11, but I’d like to get a better idea of what’s wrong first. Does anyone have an idea? Is unstable actually broken right now? Thanks.

Here’s a snippet from the error message.

> ERROR: noBrokenSymlinks: the symlink /nix/store/h89kbxsqbs80rsj5bz9b2k6v73m7lnjy-ncurses-6.5-dev/lib/pkgconfig/tinfo.pc points to a missing target: /nix/store/h89kbxsqbs80rsj5bz9b2k6v73m7lnjy-ncurses-6.5-dev/lib/pkgconfig/ncurses.pc
      > ERROR: noBrokenSymlinks: the symlink /nix/store/h89kbxsqbs80rsj5bz9b2k6v73m7lnjy-ncurses-6.5-dev/lib/pkgconfig/tic.pc points to a missing target: /nix/store/h89kbxsqbs80rsj5bz9b2k6v73m7lnjy-ncurses-6.5-dev/lib/pkgconfig/ncurses.pc
      > ERROR: noBrokenSymlinks: found 2 dangling symlinks and 0 reflexive symlinks
      For full logs, run 'nix log /nix/store/yc5wmiiidg9976id1r9xa0w3dg2n8298-ncurses-6.5.drv'.
error: 1 dependencies of derivation '/nix/store/nxwhxqhkmbszwhx23wanaxyy9zyayxz1-ld-library-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rhf4q16wzvjwlas9pb8jqmk4xnysxfrc-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/pzay45zlhp4iijqm20040xd2rn572gdq-nixos-system-surus-25.05.20250303.ba487db.drv' failed to build

Could this be related?

Maybe? But that was 17 days ago. I guess I’d be surprised if a fix took that long to make it from master to unstable.

The package mentioned in the link is unrelated. The fix has to be applied per package. Though, ncurses builds fine on unstable, so either your nixpkgs is out of date, or you’re overriding the package in your config.

Thanks for the reply. I’ve been updating my flake daily, so unstable should be up to date. As for ncurses, I don’t install it directly, so it appears that some other package depends on a broken version of nucrses. The problem is, there’s nothing in the error message that tells me what it is. As far as I can tell, it’s just the ld library path that derivative that depends on it.

If you have any suggestions, I’d welcome them. Thanks. Here’s the error message.

error: builder for '/nix/store/yc5wmiiidg9976id1r9xa0w3dg2n8298-ncurses-6.5.drv' failed with exit code 1;
       last 25 log lines:
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/getnstr.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/mvadd_wchnstr.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/tigetnum_sp.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/mvwaddstr.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/SCREEN.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/pair_content_sp.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/vidputs.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/pos_form_cursor.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/mvaddwstr.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/new_item.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/overwrite.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/vline_set.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/mvwadd_wchnstr.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/unfocus_current_field.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/dynamic_field_info.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/instr.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/update_panels.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/attr_get.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/set_term.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/tgetnum.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/border_set.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > rewriting symlink /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man/share/man/man3/slk_attron_sp.3x.gz to be relative to /nix/store/1fpgz5m78zmd6hgdccmgsinx43rrd0k5-ncurses-6.5-man
       > ERROR: noBrokenSymlinks: the symlink /nix/store/h89kbxsqbs80rsj5bz9b2k6v73m7lnjy-ncurses-6.5-dev/lib/pkgconfig/tinfo.pc points to a missing target: /nix/store/h89kbxsqbs80rsj5bz9b2k6v73m7lnjy-ncurses-6.5-dev/lib/pkgconfig/ncurses.pc
       > ERROR: noBrokenSymlinks: the symlink /nix/store/h89kbxsqbs80rsj5bz9b2k6v73m7lnjy-ncurses-6.5-dev/lib/pkgconfig/tic.pc points to a missing target: /nix/store/h89kbxsqbs80rsj5bz9b2k6v73m7lnjy-ncurses-6.5-dev/lib/pkgconfig/ncurses.pc
       > ERROR: noBrokenSymlinks: found 2 dangling symlinks and 0 reflexive symlinks
       For full logs, run 'nix log /nix/store/yc5wmiiidg9976id1r9xa0w3dg2n8298-ncurses-6.5.drv'.
error: 1 dependencies of derivation '/nix/store/nxwhxqhkmbszwhx23wanaxyy9zyayxz1-ld-library-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/r73fiv1mbmy7j05sbls763wscjkjl6xq-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/393cb4fxhdb1yqkchad5i73a8l0g2a8d-nixos-system-surus-25.05.20250306.10069ef.drv' failed to build

Well, kind of, it’s coming from ld-library-path hence I assume you’re using nix-ld. As much as I’d love to dunk on nix-ld here, the nix-ld NixOS module is going to just pull from the package(s) that you provide it (and the default instance for its default set of packages). So unless there’s some funny overrides or you’re providing nix-ld with packages from an older nixpkgs instance, I don’t see how it’d happen. Can you share your flake inputs or channels or how you get nixpkgs, as well as your nix-ld config?

1 Like

Ohh, that’s nix-ld? Thanks, that’s super helpful. Here’s my nix-ld config. Tbh it’s been several months, and I don’t remember which particular dynamic libraries it was supporting. I could probably just disable it for now. But if you have any further insights, I’d be happy to hear them.

{ pkgs, ... }:
{
  programs.nix-ld.enable = true;
  programs.nix-ld.package = pkgs.nix-ld-rs;
  programs.nix-ld.libraries = with pkgs; [
    libgcc
    libtinfo
  ];
}

Here are the only flake inputs that I can imagine might be relevant.

    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
    home-manager-unstable = {
      url = "github:nix-community/home-manager/master";
      inputs.nixpkgs.follows = "nixpkgs-unstable";
    };
    lem = {
      url = "github:lem-project/lem";
      inputs.nixpkgs.follows = "nixpkgs-unstable";
    };
    nixos-hardware.url = "github:nixos/nixos-hardware";
}

I appreciate the help.

EDIT: For the record, removing libtinfo fixed it. And I see the same error message on running nix-shell -p libtinfo. So I guess libtinfo is broken on unstable.