hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
20.98k stars 880 forks source link

Hyprpm cannot build plugins #4344

Closed REALERvolker1 closed 9 months ago

REALERvolker1 commented 9 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch HEAD at commit 03ebbe18ed8517ee22591eac82cd54322f42cb7d (props: bump ver to 0.34.0). Date: Mon Jan 1 12:03:15 2024 Tag: v0.34.0 flags: (if any) ```

Bug or Regression?

Bug

Description

I tried to use hyprpm to add plugins, but I can't get plugins to build. Also, hyprpm does not provide any information on how to fix plugin builds.

How to reproduce

  1. Run the commands:
hyprpm add https://github.com/hyprwm/hyprland-plugins
hyprpm add https://github.com/VortexCoyote/hyprfocus
  1. Observe

Crash reports, logs, images, videos

 1  ~  hyprpm add https://github.com/hyprwm/hyprland-plugins
✔ adding a new plugin repository from https://github.com/hyprwm/hyprland-plugins
  MAKE SURE that you trust the authors. DO NOT install random plugins without verifying the code and author.
  Are you sure? [Y/n] y

! old plugin repo build files found in temp directory, removing.
 → Cloning https://github.com/hyprwm/hyprland-plugins
✔ cloned
✔ found hyprpm manifest
✔ parsed manifest, found 5 plugins:
 → borders-plus-plus by Vaxry version
 → csgo-vulkan-fix by Vaxry version
 → hyprbars by Vaxry version
 → hyprtrails by Vaxry version
 → hyprwinwrap by Vaxry version
✔ Hyprland headers OK
 → Building borders-plus-plus
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╍━━━━━━━━━━━━━━━━━━━  3 / 5  Building plugin(s)
✖ Plugin borders-plus-plus failed to build.
 1  ~  hyprpm add https://github.com/VortexCoyote/hyprfocus
✔ adding a new plugin repository from https://github.com/VortexCoyote/hyprfocus
  MAKE SURE that you trust the authors. DO NOT install random plugins without verifying the code and author.
  Are you sure? [Y/n] y

! old plugin repo build files found in temp directory, removing.
 → Cloning https://github.com/VortexCoyote/hyprfocus
✔ cloned
✔ found hyprload manifest
✔ parsed manifest, found 1 plugins:
 → hyprfocus by Vortex version 2.0
✔ Hyprland headers OK
 → Building hyprfocus
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╍━━━━━━━━━━━━━━━━━━━  3 / 5  Building plugin(s)
✖ Plugin hyprfocus failed to build.

 󰅗 1   ~ 
vaxerski commented 9 months ago

run hyprpm with -v to see build logs

REALERvolker1 commented 9 months ago

Thanks a bunch. I can see the error.

 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╍━━━━━━━━━━━━━━━━━━━  3 / 5  Building plugin(s)
✖ Plugin borders-plus-plus failed to build.
[v] shell returned: make: Entering directory '/tmp/hyprpm/new/borders-plus-plus'
g++ -shared -fPIC --no-gnu-unique main.cpp borderDeco.cpp -o borders-plus-plus.so -g `pkg-config --cflags pixman-1 libdrm hyprland` -std=c++2b -O2
In file included from /usr/include/hyprland/src/includes.hpp:150,
                 from /usr/include/hyprland/src/defines.hpp:1,
                 from /usr/include/hyprland/src/Compositor.hpp:7,
                 from main.cpp:6:
/usr/include/hyprland/src/helpers/Vector2D.hpp:4:10: fatal error: format: No such file or directory
    4 | #include <format>
      |          ^~~~~~~~
compilation terminated.
In file included from /usr/include/hyprland/src/includes.hpp:150,
                 from /usr/include/hyprland/src/defines.hpp:1,
                 from /usr/include/hyprland/src/render/decorations/IHyprWindowDecoration.hpp:4,
                 from borderDeco.hpp:5,
                 from borderDeco.cpp:1:
/usr/include/hyprland/src/helpers/Vector2D.hpp:4:10: fatal error: format: No such file or directory
    4 | #include <format>
      |          ^~~~~~~~
compilation terminated.
make: *** [Makefile:2: all] Error 1
make: Leaving directory '/tmp/hyprpm/new/borders-plus-plus'

How do I get this "format" on arch? I thought I had all the headers alright

vaxerski commented 9 months ago

outdated compiler or stdlib. image

if on arch, switch to gcc, easiest method.

Anyways, not a hyprpm issue

Edit: I see it's already g++, in that case, it's most likely outdated. g++ -v should be 13.2.1 (arch repos)

REALERvolker1 commented 9 months ago

For anyone else having this problem, I found that the version of g++ in my $PATH was from /opt/cuda/bin/g++, which symlinks to /usr/bin/g++-12. Run the command ln -s /usr/bin/g++ $HOME/.local/bin to prioritize the newer version of gcc. If your cuda app doesn't work or whatever, run export CC=gcc-12 CXX=g++-12 before running it again.