hyprwm / hyprland-plugins

Official plugins for Hyprland
BSD 3-Clause "New" or "Revised" License
462 stars 43 forks source link

Hyprbars fails to build on NixOS #104

Closed RoseHobgoblin closed 3 months ago

RoseHobgoblin commented 3 months ago

Performing Home Rebuild
warning: Git tree '/home/rosa/RosebloomOS' is dirty
error: builder for '/nix/store/vni9yyqmnrw8zhngdrng9p79pra4ydsp-hyprbars-0.1.drv' failed with exit code 1;
       last 10 log lines:
       >       |                                                                             ^~~~~~~~~~~~~~~~~
       > ../barDeco.cpp:429:63: error: could not convert '{<expression error>, <expression error>, (((double)((CHyprBar*)this)->CHyprBar::m_pWindow->CWindow::m_vRealSize.CAnimatedVariable<Vector2D>::value().Vector2D::x) - (double)2), (((double)((CHyprBar*)this)->CHyprBar::m_pWindow->CWindow::m_vRealSize.CAnimatedVariable<Vector2D>::value().Vector2D::y) - (double)2)}' from '<brace-enclosed initializer list>' to 'CBox'
       >   429 |                           m_pWindow->m_vRealSize.value().y - 2};
       >       |                                                               ^
       >       |                                                               |
       >       |                                                               <brace-enclosed initializer list>
       > ../barDeco.cpp:392:24: warning: unused variable 'BUTTONSRIGHT' [-Wunused-variable]
       >   392 |     const bool         BUTTONSRIGHT = std::string{*PALIGNBUTTONS} != "left";
       >       |                        ^~~~~~~~~~~~
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/vni9yyqmnrw8zhngdrng9p79pra4ydsp-hyprbars-0.1.drv'.
error: 1 dependencies of derivation '/nix/store/4b8bjwzrjrmg43jca22lz03kkl9hz2wd-hm_hyprhyprland.conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/s75l2xizvzdp8kwy7yi72kahm0k3lcxf-activation-script.drv' failed to build
error: 1 dependencies of derivation '/nix/store/aqc1hwhv3g0sq68r7mfhavbjcfbz5mfc-home-manager-generation.drv' failed to build```
vaxerski commented 3 months ago

@fufexan

fufexan commented 3 months ago

https://github.com/hyprwm/Hyprland/commit/ef23ef60c5641c5903f9cf40571ead7ad6aba1b9 breaks it @vaxerski

vaxerski commented 3 months ago

huh, sec

vaxerski commented 3 months ago

ah, right. Would be nice if the errors werent fucking cut off

fufexan commented 3 months ago

They aren't if you pass the -L arg when building.

RoseHobgoblin commented 2 months ago

Even after that, I recieve the same error.

Found ninja-1.11.1 at /nix/store/sxkp17y5ilj8j2kabc6lh74d6v0mhpgq-ninja-1.11.1/bin/ninja
mesonConfigurePhase: enabled\ parallel\ building
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
build flags: -j8
[1/3] Compiling C++ object libhyprbars.so.p/main.cpp.o
FAILED: libhyprbars.so.p/main.cpp.o 
g++ -Ilibhyprbars.so.p -I. -I.. -I/nix/store/vcxnb4igflh8l0my4rqf3c5g87wwjlhm-hyprland-0.37.1+date=2024-03-29_543>
In file included from /nix/store/rqga421d43q40blrrgmiw820p01a4nba-gcc-13.2.0/include/c++/13.2.0/memory:78,
                 from /nix/store/vcxnb4igflh8l0my4rqf3c5g87wwjlhm-hyprland-0.37.1+date=2024-03-29_54376d7-dev/inc>
                 from ../main.cpp:6:
/nix/store/rqga421d43q40blrrgmiw820p01a4nba-gcc-13.2.0/include/c++/13.2.0/bits/unique_ptr.h: In instantiation of >
../main.cpp:23:75:   required from here
/nix/store/rqga421d43q40blrrgmiw820p01a4nba-gcc-13.2.0/include/c++/13.2.0/bits/unique_ptr.h:1070:30: error: inval>
 1070 |     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../main.cpp:10:
../barDeco.hpp:9:7: note:   because the following virtual functions are pure within 'CHyprBar':
    9 | class CHyprBar : public IHyprWindowDecoration {
      |       ^~~~~~~~
In file included from /nix/store/vcxnb4igflh8l0my4rqf3c5g87wwjlhm-hyprland-0.37.1+date=2024-03-29_54376d7-dev/inc>
                 from /nix/store/vcxnb4igflh8l0my4rqf3c5g87wwjlhm-hyprland-0.37.1+date=2024-03-29_54376d7-dev/inc>
                 from /nix/store/vcxnb4igflh8l0my4rqf3c5g87wwjlhm-hyprland-0.37.1+date=2024-03-29_54376d7-dev/inc>
                 from /nix/store/vcxnb4igflh8l0my4rqf3c5g87wwjlhm-hyprland-0.37.1+date=2024-03-29_54376d7-dev/inc>
/nix/store/vcxnb4igflh8l0my4rqf3c5g87wwjlhm-hyprland-0.37.1+date=2024-03-29_54376d7-dev/include/hyprland/src/rend>
   42 |     virtual void                       draw(CMonitor*, float a, const Vector2D& offset = Vector2D()) = 0;
      |                                        ^~~~
[2/3] Compiling C++ object libhyprbars.so.p/barDeco.cpp.o
FAILED: libhyprbars.so.p/barDeco.cpp.o 
g++ -Ilibhyprbars.so.p -I. -I.. -I/nix/store/vcxnb4igflh8l0my4rqf3c5g87wwjlhm-hyprland-0.37.1+date=2024-03-29_543>
../barDeco.cpp: In member function 'void CHyprBar::onMouseDown(SCallbackInfo&, wlr_pointer_button_event*)':
../barDeco.cpp:78:18: warning: comparison between 'enum wl_pointer_button_state' and 'enum wlr_button_state' [-We>
   78 |     if (e->state != WLR_BUTTON_PRESSED) {
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
../barDeco.cpp: In member function 'void CHyprBar::renderBarTitle(const Vector2D&, float)':
../barDeco.cpp:236:82: warning: comparison with string literal results in unspecified behavior [-Waddress]
  236 |     const int paddingTotal = scaledBarPadding * 2 + scaledButtonsSize + (*PALIGN != "left" ? scaledButton>
      |                                                                          ~~~~~~~~^~~~~~~~~
../barDeco.cpp:246:33: warning: comparison with string literal results in unspecified behavior [-Waddress]
  246 |     const int xOffset = *PALIGN == "left" ? std::round(scaledBarPadding + (BUTTONSRIGHT ? 0 : scaledButto>
      |                         ~~~~~~~~^~~~~~~~~
../barDeco.cpp:213:18: warning: unused variable 'scaledButtonsPad' [-Wunused-variable]
  213 |     const auto   scaledButtonsPad  = **PBARBUTTONPADDING * scale;
      |                  ^~~~~~~~~~~~~~~~
../barDeco.cpp: In member function 'virtual void CHyprBar::draw(CMonitor*, float)':
../barDeco.cpp:399:45: error: 'class CWindow' has no member named 'm_pWorkspace'; did you mean 'm_iWorkspaceID'?
  399 |     const auto PWORKSPACE      = m_pWindow->m_pWorkspace;
      |                                             ^~~~~~~~~~~~
      |                                             m_iWorkspaceID
../barDeco.cpp:418:38: error: 'class CWindow' has no member named 'm_vFloatingOffset'
  418 |     titleBarBox.translate(m_pWindow->m_vFloatingOffset).scale(pMonitor->scale).round();
      |                                      ^~~~~~~~~~~~~~~~~
../barDeco.cpp:427:77: error: 'class CWindow' has no member named 'm_vFloatingOffset'
  427 |         CBox windowBox = {m_pWindow->m_vRealPosition.value().x + m_pWindow->m_vFloatingOffset.x - pMonito>
      |                                                                             ^~~~~~~~~~~~~~~~~
../barDeco.cpp:428:77: error: 'class CWindow' has no member named 'm_vFloatingOffset'
  428 |                           m_pWindow->m_vRealPosition.value().y + m_pWindow->m_vFloatingOffset.y - pMonito>
      |                                                                             ^~~~~~~~~~~~~~~~~
../barDeco.cpp:429:63: error: could not convert '{<expression error>, <expression error>, (((double)((CHyprBar*)t>
  429 |                           m_pWindow->m_vRealSize.value().y - 2};
      |                                                               ^
      |                                                               |
      |                                                               <brace-enclosed initializer list>
../barDeco.cpp:392:24: warning: unused variable 'BUTTONSRIGHT' [-Wunused-variable]
  392 |     const bool         BUTTONSRIGHT = std::string{*PALIGNBUTTONS} != "left";
      |                        ^~~~~~~~~~~~
../barDeco.cpp: In member function 'CBox CHyprBar::assignedBoxGlobal()':
../barDeco.cpp:522:45: error: 'class CWindow' has no member named 'm_pWorkspace'; did you mean 'm_iWorkspaceID'?
  522 |     const auto PWORKSPACE      = m_pWindow->m_pWorkspace;
      |                                             ^~~~~~~~~~~~
      |                                             m_iWorkspaceID
ninja: build stopped: subcommand failed.
fufexan commented 2 months ago

@RoseHobgoblin how are you building hyprbars?

RoseHobgoblin commented 2 months ago

@RoseHobgoblin how are you building hyprbars?

Calling the flake.

fufexan commented 2 months ago

Yeah that's the issue. The flake.lock file is pretty old, and it gets old fast. That's why I don't update it explicitly, as it would require an almost-daily update commit which clutters the history.

What users are supposed to do instead is either use inputs.hyprland.follows = "hyprland" in their own flake, or nix build github:hyprwm/hyprland-plugins#plugin --override-input hyprland github:hyprwm/hyprland in order to build the plugins with the latest Hyprland.

RoseHobgoblin commented 2 months ago

@fufexan I am using inputs.hyprland.follows = "hyprland". I suppose I'll try the other option

fufexan commented 2 months ago

Then you may want to nix flake update.

RoseHobgoblin commented 2 months ago

Then you may want to nix flake update.

I'm in tears that worked