Incompatibility with nix-plugins #671

Closed
opened 2025-02-13 17:50:19 +00:00 by 3ulalia · 1 comment

Describe the bug

This is a particular issue with https://github.com/shlevy/nix-plugins, which adds native plugins (at the cpp level) to Nix. When attempting to install while using lix, CMake will complain while trying to find the following packages:

  • nix-expr>=2.24
  • nix-main>=2.24
  • nix-store>=2.24

Does Lix not provide these libraries? Should it?

Steps To Reproduce

  1. Add pkgs.nix-plugins to your environment
  2. sudo nixos-rebuild to your taste
  3. error

Expected behavior

That nix-plugins is installed and functions correctly.

nix --version output

nix (Lix, like Nix) 2.91.1

Additional context

Full error output:

error: builder for '/nix/store/v440qghq6sn8mxzfz2apck77jjjri7gw-nix-plugins-15.0.0.drv' failed with exit code 1;
       last 25 log lines:
       > -- Detecting C compile features
       > -- Detecting C compile features - done
       > -- Detecting CXX compiler ABI info
       > -- Detecting CXX compiler ABI info - done
       > -- Check for working CXX compiler: /nix/store/591apldfgm1gr238rbfc8ib0y1z8ng2y-gcc-wrapper-14-20241116/bin/g++ - skipped
       > -- Detecting CXX compile features
       > -- Detecting CXX compile features - done
       > -- Found PkgConfig: /nix/store/q5h7fl6q9rza6q300nnpmf5fgg6c73a6-pkg-config-wrapper-0.29.2/bin/pkg-config (found version "0.29.2")
       > -- Checking for modules 'nix-expr>=2.24;nix-main>=2.24;nix-store>=2.24'
       > --   No package 'nix-expr' found
       > --   No package 'nix-main' found
       > --   No package 'nix-store' found
       > CMake Error at /nix/store/mfrfb675a16gqchycqv16aziivn09dxa-cmake-3.31.3/share/cmake-3.31/Modules/FindPkgConfig.cmake:645 (message):
       >   The following required packages were not found:
       >
       >    - nix-expr>=2.24
       >    - nix-main>=2.24
       >    - nix-store>=2.24
       >
       > Call Stack (most recent call first):
       >   /nix/store/mfrfb675a16gqchycqv16aziivn09dxa-cmake-3.31.3/share/cmake-3.31/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal)
       >   CMakeLists.txt:9 (pkg_check_modules)
       >
       >
       > -- Configuring incomplete, errors occurred!
       For full logs, run 'nix log /nix/store/v440qghq6sn8mxzfz2apck77jjjri7gw-nix-plugins-15.0.0.drv'.
      ```
## Describe the bug This is a particular issue with https://github.com/shlevy/nix-plugins, which adds native plugins (at the cpp level) to Nix. When attempting to install while using lix, CMake will complain while trying to find the following packages: - nix-expr>=2.24 - nix-main>=2.24 - nix-store>=2.24 Does Lix not provide these libraries? Should it? ## Steps To Reproduce 1. Add `pkgs.nix-plugins` to your environment 2. sudo nixos-rebuild to your taste 3. error ## Expected behavior That nix-plugins is installed and functions correctly. ## `nix --version` output nix (Lix, like Nix) 2.91.1 ## Additional context Full error output: ``` error: builder for '/nix/store/v440qghq6sn8mxzfz2apck77jjjri7gw-nix-plugins-15.0.0.drv' failed with exit code 1; last 25 log lines: > -- Detecting C compile features > -- Detecting C compile features - done > -- Detecting CXX compiler ABI info > -- Detecting CXX compiler ABI info - done > -- Check for working CXX compiler: /nix/store/591apldfgm1gr238rbfc8ib0y1z8ng2y-gcc-wrapper-14-20241116/bin/g++ - skipped > -- Detecting CXX compile features > -- Detecting CXX compile features - done > -- Found PkgConfig: /nix/store/q5h7fl6q9rza6q300nnpmf5fgg6c73a6-pkg-config-wrapper-0.29.2/bin/pkg-config (found version "0.29.2") > -- Checking for modules 'nix-expr>=2.24;nix-main>=2.24;nix-store>=2.24' > -- No package 'nix-expr' found > -- No package 'nix-main' found > -- No package 'nix-store' found > CMake Error at /nix/store/mfrfb675a16gqchycqv16aziivn09dxa-cmake-3.31.3/share/cmake-3.31/Modules/FindPkgConfig.cmake:645 (message): > The following required packages were not found: > > - nix-expr>=2.24 > - nix-main>=2.24 > - nix-store>=2.24 > > Call Stack (most recent call first): > /nix/store/mfrfb675a16gqchycqv16aziivn09dxa-cmake-3.31.3/share/cmake-3.31/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal) > CMakeLists.txt:9 (pkg_check_modules) > > > -- Configuring incomplete, errors occurred! For full logs, run 'nix log /nix/store/v440qghq6sn8mxzfz2apck77jjjri7gw-nix-plugins-15.0.0.drv'. ```
Owner

I think someone might have a Lix compatible fork of that plugin, though I don't find one on this forgejo (making one is really not that hard if you really need the builtins from that plugin) but otherwise that stuff is not supported. Lix does not expose a compatible C++ API and will never do so.

Technically the Lix overlay could exclude nix-plugins or make them an eval error that tells you they're not supported, but I don't know if that's really a better solution.

The changes you would need in your nix-plugins fork are:

  • Change the dependency decls to lix-expr, lix-main, lix-store
  • Change the includes to include the lib name, e.g. "types.h" -> "lix/libutil/types.h"

There's so little code in that that the rest is unlikely to be too hard. If you have issues feel free to drop in on the developer Matrix room.

I think someone might have a Lix compatible fork of that plugin, though I don't find one on this forgejo (making one is really not that hard if you really need the builtins from that plugin) but otherwise that stuff is not supported. Lix does not expose a compatible C++ API and will never do so. Technically the Lix overlay could exclude nix-plugins or make them an eval error that tells you they're not supported, but I don't know if that's really a better solution. The changes you would need in your nix-plugins fork are: - Change the dependency decls to lix-expr, lix-main, lix-store - Change the includes to include the lib name, e.g. "types.h" -> "lix/libutil/types.h" There's so little code in that that the rest is unlikely to be too hard. If you have issues feel free to drop in on the developer Matrix room.
jade 2025-02-13 20:43:25 +00:00
Sign in to join this conversation.
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/lix#671
No description provided.