danth/stylix

Build Failure: hyperpaper-0.7.1.drv with exit code 2

Ladas552 opened this issue · 3 comments

Hyperpaper is failing to build on nixpkgs-unstable
I use Stylix NixOS module with stylix.homeManagerIntegration.autoImport and stylix.homeManagerIntegration.followSystem to also theme my Home-Manager that is a module in my NixOS

I don't have Hyprland as enabled in Home-manager or installed in packages. And if I try to disable hyperpaper with home-manager.users.user.stylix.targets.hyprpaper.enable = false; I get the error:

error: The option `home-manager.users.ladas552.stylix.targets.hyprpaper.enable' has conflicting definition values:
- In `/nix/store/nbcyd1kbx2w64g4qniz4jmss6x19q2f1-modules/hyprland/hm.nix': true
- In `/nix/store/r76nm72pmhqgyywnvg4i9s4wrv326qq5-source/nixos/desktop/stilyx': false
Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.

As if hyprpaper is enabled by default. The work around is disabling the hyperland target all together with home-manager.users.user.stylix.targets.hyprland.enable = false;.

Here is a build crash log of hyprpaper:

these 8 derivations will be built:
  /nix/store/5x6fxsdcnkik3djpvz10baaxghbw6r8k-hyprpaper-0.7.1.drv
  /nix/store/grinxc1vbsjvkw19gfg7rsm3i9l10zbf-hyprpaper.service.drv
  /nix/store/zmr81mk63v5921kbd3akmxdqan7g693s-home-manager-files.drv
  /nix/store/fxyl6a14z43njjqy6dvqaxs1y2fdy2fp-home-manager-generation.drv
  /nix/store/56fc1ivayyv06xvx997byl891nsfl6fp-unit-home-manager-ladas552.service.drv
  /nix/store/r6jwa4y3hk1bngpzf0zillbpjdiay3by-system-units.drv
  /nix/store/jzkar2n5hg845vyqj99x04mgxka649sd-etc.drv
  /nix/store/34md21xfdq02xin37sgf413xc5xm8waa-nixos-system-NixToks-24.11.20240831.12228ff.drv
hyprpaper> building '/nix/store/5x6fxsdcnkik3djpvz10baaxghbw6r8k-hyprpaper-0.7.1.drv'
hyprpaper> Running phase: unpackPhase
hyprpaper> unpacking source archive /nix/store/glq45m6948xs0n8k7gbm60qd6grircri-source
hyprpaper> source root is source
hyprpaper> Running phase: patchPhase
hyprpaper> substituteStream() in derivation hyprpaper-0.7.1: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. (file 'src/main.cpp')
hyprpaper> Running phase: updateAutotoolsGnuConfigScriptsPhase
hyprpaper> Running phase: configurePhase
hyprpaper> fixing cmake files...
hyprpaper> cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/share/doc/hyprpaper -DCMAKE_INSTALL_INFODIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/include -DCMAKE_INSTALL_SBINDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/strip -DCMAKE_RANLIB=/nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/ranlib -DCMAKE_AR=/nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1
hyprpaper> -- The C compiler identification is GNU 13.3.0
hyprpaper> -- The CXX compiler identification is GNU 13.3.0
hyprpaper> -- Detecting C compiler ABI info
hyprpaper> -- Detecting C compiler ABI info - done
hyprpaper> -- Check for working C compiler: /nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/gcc - skipped
hyprpaper> -- Detecting C compile features
hyprpaper> -- Detecting C compile features - done
hyprpaper> -- Detecting CXX compiler ABI info
hyprpaper> -- Detecting CXX compiler ABI info - done
hyprpaper> -- Check for working CXX compiler: /nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/g++ - skipped
hyprpaper> -- Detecting CXX compile features
hyprpaper> -- Detecting CXX compile features - done
hyprpaper> -- Configuring hyprpaper!
hyprpaper> bash: line 1: git: command not found
hyprpaper> bash: line 1: git: command not found
hyprpaper> -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
hyprpaper> -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
hyprpaper> -- Found Threads: TRUE
hyprpaper> -- Found PkgConfig: /nix/store/fcmc82gp5qc0s8qvcw4c0w46c67zd295-pkg-config-wrapper-0.29.2/bin/pkg-config (found version "0.29.2")
hyprpaper> -- Checking for modules 'wayland-client;wayland-protocols;cairo;pango;pangocairo;libjpeg;libwebp;hyprlang>=0.2.0;hyprutils>=0.2.0;hyprwayland-scanner>=0.4.0'
hyprpaper> --   Found wayland-client, version 1.23.0
hyprpaper> --   Found wayland-protocols, version 1.36
hyprpaper> --   Found cairo, version 1.18.0
hyprpaper> --   Found pango, version 1.52.2
hyprpaper> --   Found pangocairo, version 1.52.2
hyprpaper> --   Found libjpeg, version 3.0.3
hyprpaper> --   Found libwebp, version 1.4.0
hyprpaper> --   Found hyprlang, version 0.5.2
hyprpaper> --   Found hyprutils, version 0.2.1
hyprpaper> --   Found hyprwayland-scanner, version 0.4.0
hyprpaper> -- Found wayland-protocols at //nix/store/sm9mxbw5lanjmabjgd53yps0b9j3lrc9-wayland-protocols-1.36/share/wayland-protocols
hyprpaper> -- Found wayland-client at //nix/store/0xxjgp8nqgdwfnqbvavp1g61n8vbvyh1-wayland-1.23.0/share/wayland
hyprpaper> -- Configuring done (1.3s)
hyprpaper> -- Generating done (0.0s)
hyprpaper> CMake Warning:
hyprpaper>   Manually-specified variables were not used by the project:
hyprpaper> 
hyprpaper>     BUILD_TESTING
hyprpaper>     CMAKE_EXPORT_NO_PACKAGE_REGISTRY
hyprpaper>     CMAKE_INSTALL_DOCDIR
hyprpaper>     CMAKE_INSTALL_INCLUDEDIR
hyprpaper>     CMAKE_INSTALL_INFODIR
hyprpaper>     CMAKE_INSTALL_LIBDIR
hyprpaper>     CMAKE_INSTALL_LIBEXECDIR
hyprpaper>     CMAKE_INSTALL_LOCALEDIR
hyprpaper>     CMAKE_INSTALL_MANDIR
hyprpaper>     CMAKE_INSTALL_OLDINCLUDEDIR
hyprpaper>     CMAKE_INSTALL_SBINDIR
hyprpaper>     CMAKE_POLICY_DEFAULT_CMP0025
hyprpaper> 
hyprpaper> 
hyprpaper> -- Build files have been written to: /build/source/build
hyprpaper> cmake: enabled parallel building
hyprpaper> cmake: enabled parallel installing
hyprpaper> Running phase: buildPhase
hyprpaper> build flags: -j8 SHELL=/nix/store/vpvy79k1qq02p1vyqjk6nb89gwhxqvyb-bash-5.2p32/bin/bash
hyprpaper> [ 10%] Generating /build/source/protocols/cursor-shape-v1.cpp, /build/source/protocols/cursor-shape-v1.hpp
hyprpaper> [ 10%] Generating /build/source/protocols/linux-dmabuf-v1.cpp, /build/source/protocols/linux-dmabuf-v1.hpp
hyprpaper> [ 13%] Generating /build/source/protocols/fractional-scale-v1.cpp, /build/source/protocols/fractional-scale-v1.hpp
hyprpaper> [ 17%] Generating /build/source/protocols/tablet-v2.cpp, /build/source/protocols/tablet-v2.hpp
hyprpaper> [ 17%] Generating /build/source/protocols/xdg-shell.cpp, /build/source/protocols/xdg-shell.hpp
hyprpaper> [ 20%] Generating /build/source/protocols/viewporter.cpp, /build/source/protocols/viewporter.hpp
hyprpaper> [ 27%] Generating /build/source/protocols/wlr-layer-shell-unstable-v1.cpp, /build/source/protocols/wlr-layer-shell-unstable-v1.hpp
hyprpaper> [ 27%] Generating /build/source/protocols/wayland.cpp, /build/source/protocols/wayland.hpp
hyprpaper> Couldn't load proto
hyprpaper> make[2]: *** [CMakeFiles/hyprpaper.dir/build.make:74: /build/source/protocols/wayland.cpp] Error 1
hyprpaper> make[2]: *** Waiting for unfinished jobs....
hyprpaper> make[1]: *** [CMakeFiles/Makefile2:82: CMakeFiles/hyprpaper.dir/all] Error 2
hyprpaper> make: *** [Makefile:156: all] Error 2
error: builder for '/nix/store/5x6fxsdcnkik3djpvz10baaxghbw6r8k-hyprpaper-0.7.1.drv' failed with exit code 2;
       last 10 log lines:
       > [ 17%] Generating /build/source/protocols/tablet-v2.cpp, /build/source/protocols/tablet-v2.hpp
       > [ 17%] Generating /build/source/protocols/xdg-shell.cpp, /build/source/protocols/xdg-shell.hpp
       > [ 20%] Generating /build/source/protocols/viewporter.cpp, /build/source/protocols/viewporter.hpp
       > [ 27%] Generating /build/source/protocols/wlr-layer-shell-unstable-v1.cpp, /build/source/protocols/wlr-layer-shell-unstable-v1.hpp
       > [ 27%] Generating /build/source/protocols/wayland.cpp, /build/source/protocols/wayland.hpp
       > Couldn't load proto
       > make[2]: *** [CMakeFiles/hyprpaper.dir/build.make:74: /build/source/protocols/wayland.cpp] Error 1
       > make[2]: *** Waiting for unfinished jobs....
       > make[1]: *** [CMakeFiles/Makefile2:82: CMakeFiles/hyprpaper.dir/all] Error 2
       > make: *** [Makefile:156: all] Error 2
       For full logs, run 'nix log /nix/store/5x6fxsdcnkik3djpvz10baaxghbw6r8k-hyprpaper-0.7.1.drv'.
error: 1 dependencies of derivation '/nix/store/grinxc1vbsjvkw19gfg7rsm3i9l10zbf-hyprpaper.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/zmr81mk63v5921kbd3akmxdqan7g693s-home-manager-files.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fxyl6a14z43njjqy6dvqaxs1y2fdy2fp-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/56fc1ivayyv06xvx997byl891nsfl6fp-unit-home-manager-ladas552.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/r6jwa4y3hk1bngpzf0zillbpjdiay3by-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jzkar2n5hg845vyqj99x04mgxka649sd-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/34md21xfdq02xin37sgf413xc5xm8waa-nixos-system-NixToks-24.11.20240831.12228ff.drv' failed to build

I don't have Hyprland as enabled in Home-manager or installed in packages. And if I try to disable hyperpaper with home-manager.users.user.stylix.targets.hyprpaper.enable = false; I get the error:

error: The option `home-manager.users.ladas552.stylix.targets.hyprpaper.enable' has conflicting definition values:
- In `/nix/store/nbcyd1kbx2w64g4qniz4jmss6x19q2f1-modules/hyprland/hm.nix': true
- In `/nix/store/r76nm72pmhqgyywnvg4i9s4wrv326qq5-source/nixos/desktop/stilyx': false
Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.

I don't think /nix/store/r76nm72pmhqgyywnvg4i9s4wrv326qq5-source/nixos/desktop/stilyx comes from Stylix.

As if hyprpaper is enabled by default. The work around is disabling the hyperland target all together with home-manager.users.user.stylix.targets.hyprland.enable = false;.

#501 should resolve this.

Actually, this is being worked on in Nixpkgs: NixOS/nixpkgs#338841.

stylix.targets.hyprland.enable defaults to true:

config.lib.stylix.mkEnableTarget "Hyprland" true;

Which enables Hyprpaper:

services.hyprpaper.enable = true;

This is incorrect - although the build failure is being fixed upstream, we shouldn't be installing Hyprpaper for Stylix users which aren't on Hyprland.