nixos-option build failure on lix 2.91.0 #580

Closed
opened 2024-11-20 10:01:28 +00:00 by evysgarden · 7 comments

Describe the bug

Now that 24.11 is in beta, I've tried to upgrade.
Only problem is that nixos-option seems to fail to build.

Steps To Reproduce

  1. Switch to NixOS/nixpkgs/nixos-24.11
  2. Use lix like this
inputs = {
  lix-module = {
      url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
      inputs.nixpkgs.follows = "nixpkgs";
    };
}

and host configuration (not relevant)
nix.package = inputs.lix-module.packages.x86_64-linux.default;

Now nixos-option fails to build and produces the following output:

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/gk2qs90xfhv0h19h8dca9hn9j3wkix6f-nixos-option
source root is nixos-option
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/z3bnffna084is69k0qn2jhimjshav2gm-nixos-option --libdir=/nix/store/z3bnffna084is69k0qn2jhimjshav2gm-nixos-option/>
The Meson build system
Version: 1.6.0
Source dir: /build/nixos-option
Build dir: /build/nixos-option/build
Build type: native build
Project name: nixos-option
Project version: 0.1.6
C++ compiler for the host machine: g++ (gcc 13.3.0 "g++ (GCC) 13.3.0")
C++ linker for the host machine: g++ ld.bfd 2.43.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: YES (/nix/store/f1gamyykr0f8n4afy910ass2jx2g9zkv-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2
Run-time dependency nix-main found: YES 2.18.9
Run-time dependency nix-store found: YES 2.18.9
Run-time dependency nix-expr found: YES 2.18.9
Run-time dependency nix-cmd found: YES 2.18.9
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency nix-flake found: NO (tried pkgconfig)

meson.build:10:16: ERROR: Dependency "nix-flake" not found, tried pkgconfig

A full log can be found at /build/nixos-option/build/meson-logs/meson-log.txt

Expected behavior

all works.

nix --version output

nix (Lix, like Nix) 2.91.0

## Describe the bug Now that 24.11 is in beta, I've tried to upgrade. Only problem is that nixos-option seems to fail to build. ## Steps To Reproduce 1. Switch to NixOS/nixpkgs/nixos-24.11 2. Use lix like this ```nix inputs = { lix-module = { url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; } ``` ~~and host configuration~~ (not relevant) `nix.package = inputs.lix-module.packages.x86_64-linux.default;` Now nixos-option fails to build and produces the following output: ``` Running phase: unpackPhase @nix { "action": "setPhase", "phase": "unpackPhase" } unpacking source archive /nix/store/gk2qs90xfhv0h19h8dca9hn9j3wkix6f-nixos-option source root is nixos-option 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/z3bnffna084is69k0qn2jhimjshav2gm-nixos-option --libdir=/nix/store/z3bnffna084is69k0qn2jhimjshav2gm-nixos-option/> The Meson build system Version: 1.6.0 Source dir: /build/nixos-option Build dir: /build/nixos-option/build Build type: native build Project name: nixos-option Project version: 0.1.6 C++ compiler for the host machine: g++ (gcc 13.3.0 "g++ (GCC) 13.3.0") C++ linker for the host machine: g++ ld.bfd 2.43.1 Host machine cpu family: x86_64 Host machine cpu: x86_64 Found pkg-config: YES (/nix/store/f1gamyykr0f8n4afy910ass2jx2g9zkv-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2 Run-time dependency nix-main found: YES 2.18.9 Run-time dependency nix-store found: YES 2.18.9 Run-time dependency nix-expr found: YES 2.18.9 Run-time dependency nix-cmd found: YES 2.18.9 Did not find CMake 'cmake' Found CMake: NO Run-time dependency nix-flake found: NO (tried pkgconfig) meson.build:10:16: ERROR: Dependency "nix-flake" not found, tried pkgconfig A full log can be found at /build/nixos-option/build/meson-logs/meson-log.txt ``` ## Expected behavior all works. ## `nix --version` output `nix (Lix, like Nix) 2.91.0`
evysgarden added the
bug
label 2024-11-20 10:01:28 +00:00
Author

this doesn't seem to happen with cppnix

this doesn't seem to happen with cppnix
Author

Disabling nixos-option seems to fix it.

system.tools.nixos-option.enable = false;

Credit for finding that option to nobbz@discord

Disabling nixos-option seems to fix it. ``` system.tools.nixos-option.enable = false; ``` Credit for finding that option to nobbz@discord
Owner

Nope this is probably behaviour considered a bug, even if the proximate cause here is a minor case of misuse. Given I've heard this a couple of times, I would like to know the change that actually causes this (and it may still wind up not a bug). It sounds suspiciously like the NixOS option nix.package has possibly grown a very ham fisted overlay recently and I'm going to have a look at it later; we may in fact just find out that this is just old lix-module versions not correctly overriding it anymore though.

Granted, you are misusing the lix NixOS module which may be the cause of your immediate issue and perhaps other sadness. That package output exists entirely for testing and nix.package should not be set to begin with when using the module; the intended mode of operation is that it acts as an overlay to replace pkgs.nix such that nix.package will magically become lix alongside all the other uses of pkgs.nix.

As per the installation guide or the module README, the way the module should be used is either by setting nixpkgs.overlays (or otherwise using the overlay) or by putting the module into imports. The alternative instructions which are being mixed with these ones are the ones which say purely nix.package = pkgs.lix which works as far as we know.

Another problem which you are having is that your module is old and needs to be updated to module 2.91.1-1 which contains a substantial module refactoring affecting nixos-option which may well fix your problem. The latest version is listed in the installation guide on the Lix website.

Nope this is probably behaviour considered a bug, even if the proximate cause here is a minor case of misuse. Given I've heard this a couple of times, I would like to know the change that actually causes this (and it may still wind up not a bug). It sounds suspiciously like the NixOS option nix.package has possibly grown a very ham fisted overlay recently and I'm going to have a look at it later; we may in fact just find out that this is just old lix-module versions not correctly overriding it anymore though. Granted, you *are* misusing the lix NixOS module which may be the cause of your immediate issue and perhaps other sadness. That package output exists entirely for testing and nix.package should not be set to begin with when using the module; the intended mode of operation is that it acts as an overlay to replace pkgs.nix such that nix.package will magically become lix alongside all the other uses of pkgs.nix. As per the installation guide or the module README, the way the module should be used is either by setting nixpkgs.overlays (or otherwise using the overlay) or by putting the module into imports. The alternative instructions which are being mixed with these ones are the ones which say purely `nix.package = pkgs.lix` which works as far as we know. Another problem which you are having is that your module is old and needs to be updated to module 2.91.1-1 which contains a substantial module refactoring affecting nixos-option which may well fix your problem. The latest version is listed in the installation guide on the Lix website.
jade reopened this issue 2024-11-20 15:30:18 +00:00
Author

the manual setting of nix.package was a workaround for an old issue. it may not be present anymore so I will remove that line.
Though please don't be rude here. A nicer phrasing would have been nice. No need to make me feel dumb for a minor misconfiguration.

I will update the module later and check back.

the manual setting of nix.package was a workaround for an old issue. it may not be present anymore so I will remove that line. Though please don't be rude here. A nicer phrasing would have been nice. No need to make me feel dumb for a minor misconfiguration. I will update the module later and check back.

Hi, thank you evysgarden for opening this issue and jade for the explanation - would not have realized my Lix install was out of date, nor that the issue was even Lix-related (spent a lot of time trying to determine if it was a nixpkgs or even a Meson issue).

Can confirm that

  1. This issue still occurs on NixOs (with every config variant I have tried yet) with Lix module version 2.91.0 set up correctly as a module install, per the flake-based NixOs install instructions on the Lix website.
  2. Updating to module version 2.91.1-1 appears to solve the problem with no further wrangling, meaning the nixos-option rewrite is likely what introduces the relevant fix in the above case.
Hi, thank you evysgarden for opening this issue and jade for the explanation - would not have realized my Lix install was out of date, nor that the issue was even Lix-related (spent a lot of time trying to determine if it was a nixpkgs or even a Meson issue). Can confirm that 1. This issue still occurs on NixOs (with every config variant I have tried yet) with Lix module version 2.91.0 set up correctly as a module install, per the flake-based NixOs install instructions on the Lix website. 2. Updating to module version 2.91.1-1 appears to solve the problem with no further wrangling, meaning the nixos-option rewrite is likely what introduces the relevant fix in the above case.
evysgarden changed title from nixos-option build failure to nixos-option build failure on lix 2.91.0 2024-11-25 13:44:52 +00:00
Author

alright, just to confirm @jade the misconfiguration is not the issue. though thx for pointing that out. I have now removed the line.
It seems to have been fixed now on 2.91.1-1 so I'm not sure how relevant it is to keep this issue open.

alright, just to confirm @jade the misconfiguration is not the issue. though thx for pointing that out. I have now removed the line. It seems to have been fixed now on 2.91.1-1 so I'm not sure how relevant it is to keep this issue open.
Member

Hit the same issue, I did not have nix.package set, upgrading my Lix pin from 2.91.0 to 2.91.1-1 also fixed the issue.

Hit the same issue, I did not have `nix.package` set, upgrading my Lix pin from `2.91.0` to `2.91.1-1` also fixed the issue.
jade closed this issue 2024-11-25 18:53:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 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/lix#580
No description provided.