nixd fails to build with lix #45

Open
opened 2024-11-19 13:00:01 +00:00 by gepbird · 2 comments

Description

Trying to use nixd with lix fails to build.

Build log

nixt: meson.build:1:0: ERROR: Compiler g++ cannot compile programs.
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/hyb5v51wszfq9915fd63w96vmdr9rp93-source
source root is source/libnixt
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
mesonConfigurePhase flags: --prefix=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0 --libdir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/lib --libexecdir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/libexec --bindir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/bin --sbindir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/sbin --includedir=/nix/store/3vcw2ms3yfv1g1y5p1iq3va4vw1l0v4b-nixt-2.5.0-dev/include --mandir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/share/man --infodir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/share/info --localedir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=release
The Meson build system
Version: 1.6.0
Source dir: /build/source/libnixt
Build dir: /build/source/libnixt/build
Build type: native build
Project name: nixt
Project version: 2.5.0
C compiler for the host machine: gcc (gcc 13.3.0 "gcc (GCC) 13.3.0")
C linker for the host machine: gcc ld.bfd 2.43.1

meson.build:1:0: ERROR: Compiler g++ cannot compile programs.

A full log can be found at /build/source/libnixt/build/meson-logs/meson-log.txt

Reproduction

Save the following file then run nixos-rebuild build --flake .#default

flake.nix
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=5e4fbfb6b3de1aa2872b76d49fafc942626e2add"; # nixos-unstable branch
    lix-nixos-module.url = "https://git.lix.systems/lix-project/nixos-module/archive/2bbdcd73b9a464f8acf45a7100feb979883ba485.tar.gz"; # stable branch
  };

  outputs =
    inputs: with inputs; {
      nixosConfigurations.default = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          lix-nixos-module.nixosModules.lixFromNixpkgs
          (
            { pkgs, ... }:
            {
              # not relevant, this is just to get the flake to build
              fileSystems."/".device = "/dev/null";
              boot.loader.grub.devices = [ "/dev/null" ];

              environment.systemPackages = with pkgs; [
                nixd
              ];
            }
          )
        ];
      };
    };
}
## Description Trying to use nixd with lix fails to build. ## Build log <details><summary>nixt: meson.build:1:0: ERROR: Compiler g++ cannot compile programs.</summary> ``` Running phase: unpackPhase @nix { "action": "setPhase", "phase": "unpackPhase" } unpacking source archive /nix/store/hyb5v51wszfq9915fd63w96vmdr9rp93-source source root is source/libnixt Running phase: patchPhase @nix { "action": "setPhase", "phase": "patchPhase" } Running phase: updateAutotoolsGnuConfigScriptsPhase @nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" } Running phase: configurePhase @nix { "action": "setPhase", "phase": "configurePhase" } mesonConfigurePhase flags: --prefix=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0 --libdir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/lib --libexecdir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/libexec --bindir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/bin --sbindir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/sbin --includedir=/nix/store/3vcw2ms3yfv1g1y5p1iq3va4vw1l0v4b-nixt-2.5.0-dev/include --mandir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/share/man --infodir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/share/info --localedir=/nix/store/w0sdpj48syi888fhzyjrsz145gkg6vw8-nixt-2.5.0/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=release The Meson build system Version: 1.6.0 Source dir: /build/source/libnixt Build dir: /build/source/libnixt/build Build type: native build Project name: nixt Project version: 2.5.0 C compiler for the host machine: gcc (gcc 13.3.0 "gcc (GCC) 13.3.0") C linker for the host machine: gcc ld.bfd 2.43.1 meson.build:1:0: ERROR: Compiler g++ cannot compile programs. A full log can be found at /build/source/libnixt/build/meson-logs/meson-log.txt ``` </details> ## Reproduction Save the following file then run `nixos-rebuild build --flake .#default` <details><summary>flake.nix</summary> ```nix { inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=5e4fbfb6b3de1aa2872b76d49fafc942626e2add"; # nixos-unstable branch lix-nixos-module.url = "https://git.lix.systems/lix-project/nixos-module/archive/2bbdcd73b9a464f8acf45a7100feb979883ba485.tar.gz"; # stable branch }; outputs = inputs: with inputs; { nixosConfigurations.default = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ lix-nixos-module.nixosModules.lixFromNixpkgs ( { pkgs, ... }: { # not relevant, this is just to get the flake to build fileSystems."/".device = "/dev/null"; boot.loader.grub.devices = [ "/dev/null" ]; environment.systemPackages = with pkgs; [ nixd ]; } ) ]; }; }; } ``` </details>
Owner

oh i have a strong suspicion why that is and exactly how to fix it (just add it to overridelist_upstream; you could even pr it if you want), but i really am starting to think nixpkgs should have a cppnix alias for nix for anything linking to cppnix... it's really silly that we have to find out about every single one of these.

however, may i suggest nil :p (i know it doesn't do evaluation, but I've never really had the evaluation work anyway)

oh i have a strong suspicion why that is and exactly how to fix it (just add it to overridelist_upstream; you could even pr it if you want), but i really am starting to think nixpkgs should have a cppnix alias for nix for anything linking to cppnix... it's really silly that we have to find out about every single one of these. however, may i suggest nil :p (i know it doesn't do evaluation, but I've never really had the evaluation work anyway)
Author

@jade Thanks, that fixed this issue.

A similar issue is nixos-option getting upgraded to a newer nix and it doesnt build with lix, but using the CLI rather than the C "API" will fix that. But I'm curious why it doesn't work out of the box as it is in overridelist_upstream.
This was recently reported in lix-project/lix#580.

however, may i suggest nil :p

I was using rnix and nil for a long time and recently switched to nixd as I heard it had some big improvements and I also had some minor issues with nil, but may switch back to it in the future :)

@jade Thanks, that fixed this issue. ~~A similar issue is [nixos-option getting upgraded to a newer nix](https://github.com/NixOS/nixpkgs/pull/355745) and it doesnt build with lix, but [using the CLI rather than the C "API"](https://github.com/NixOS/nixpkgs/pull/313497#issuecomment-2484409256) will fix that. But I'm curious why it doesn't work out of the box as it is in [overridelist_upstream](https://git.lix.systems/lix-project/nixos-module/src/commit/2bbdcd73b9a464f8acf45a7100feb979883ba485/overlay.nix#L16).~~ This was recently reported in https://git.lix.systems/lix-project/lix/issues/580. > however, may i suggest nil :p I was using rnix and nil for a long time and recently switched to nixd as I heard it had some big improvements and I also had some minor issues with nil, but may switch back to it in the future :)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/nixos-module#45
No description provided.