Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on glaze #9067

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Remove dependency on glaze #9067

wants to merge 3 commits into from

Conversation

earboxer
Copy link
Contributor

@earboxer earboxer commented Jan 15, 2025

Describe your PR, what does it fix/add?

Attempt to remove dependency on glaze by making hyprctl plugins list output a 'terse' format.

see #8812 #8899

I was originally trying to compile glaze on alpine, but it had issues (with _Float128 and std::to_chars and std::from_chars), which I think belong to libc++ when compiled on musl... Given that glaze was only added to simplify some string parsing, I think it would be much less effort for me to just not use glaze in hyprland than to fix issues compiling glaze.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Need to test this more

Is it ready for merging, or does it need work?

I've tested this... but not fully

Also needs documentation updates

@gksudolol
Copy link

I got a segfault building with this PR

[196/330] x86_64-pc-linux-gnu-g++ -Isrc/Hyprland.p -Isrc -I../hyprland-9999/src -Isubprojects/udis86 -I../hyprland-9999/subprojects/udis86 -I../hyprland-9999/subprojects/udis86/libudis86 -Isubprojects/udis86/__CMake_build -I../hyprland-9999/subprojects/udis86/__CMake_build -Iprotocols -I/usr/lib64/libffi/include -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/uuid -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++26 -Wno-unused-parameter -Wno-unused-value -Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith '-DDATAROOTDIR="/usr/share"' '-DHYPRLAND_VERSION="0.46.0"' -DHAS_EXECINFO '-DAQUAMARINE_VERSION="0.7.1"' '-DHYPRCURSOR_VERSION="0.1.11"' '-DHYPRGRAPHICS_VERSION="0.1.1"' '-DHYPRLANG_VERSION="0.6.0"' '-DHYPRUTILS_VERSION="0.3.3"' -march=x86-64-v3 -O2 -pipe -pthread -Wnon-virtual-dtor -DNOMINMAX -MD -MQ src/Hyprland.p/managers_DonationNagManager.cpp.o -MF src/Hyprland.p/managers_DonationNagManager.cpp.o.d -o src/Hyprland.p/managers_DonationNagManager.cpp.o -c ../hyprland-9999/src/managers/DonationNagManager.cpp
FAILED: src/Hyprland.p/managers_DonationNagManager.cpp.o 
x86_64-pc-linux-gnu-g++ -Isrc/Hyprland.p -Isrc -I../hyprland-9999/src -Isubprojects/udis86 -I../hyprland-9999/subprojects/udis86 -I../hyprland-9999/subprojects/udis86/libudis86 -Isubprojects/udis86/__CMake_build -I../hyprland-9999/subprojects/udis86/__CMake_build -Iprotocols -I/usr/lib64/libffi/include -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/uuid -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++26 -Wno-unused-parameter -Wno-unused-value -Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith '-DDATAROOTDIR="/usr/share"' '-DHYPRLAND_VERSION="0.46.0"' -DHAS_EXECINFO '-DAQUAMARINE_VERSION="0.7.1"' '-DHYPRCURSOR_VERSION="0.1.11"' '-DHYPRGRAPHICS_VERSION="0.1.1"' '-DHYPRLANG_VERSION="0.6.0"' '-DHYPRUTILS_VERSION="0.3.3"' -march=x86-64-v3 -O2 -pipe -pthread -Wnon-virtual-dtor -DNOMINMAX -MD -MQ src/Hyprland.p/managers_DonationNagManager.cpp.o -MF src/Hyprland.p/managers_DonationNagManager.cpp.o.d -o src/Hyprland.p/managers_DonationNagManager.cpp.o -c ../hyprland-9999/src/managers/DonationNagManager.cpp
In file included from ../hyprland-9999/src/managers/../debug/../SharedDefs.hpp:4,
                 from ../hyprland-9999/src/managers/../debug/../includes.hpp:36,
                 from ../hyprland-9999/src/managers/../debug/Log.hpp:8,
                 from ../hyprland-9999/src/managers/DonationNagManager.cpp:2:
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/functional:393:31: internal compiler error: Segmentation fault
  393 |         { return __arg.get(); }
      |                               ^
0x556f09ece500 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t)
	???:0
0x556f09ee613e internal_error(char const*, ...)
	???:0
0x556f0818ee40 gt_ggc_mx_lang_tree_node(void*)
	???:0
x86_64-pc-linux-gnu-g++: internal compiler error: Segmentation fault signal terminated program cc1plus

Gentoo doesn't natively package glaze and it's a pain having to build it out of tree. I don't use plugins either so I'm not of much use either sorry

@earboxer
Copy link
Contributor Author

@gksudolol not completely sure what's up with that segfault, I was able to build it (with the latest hyprutils and aquamarine) and it's running fine for me now. (also, I don't use plugins, and hyprpm doesn't seem to work for me)... But this should work fine in theory.

@gksudolol
Copy link

it might have been my end, i'll build again and test out hyprpm

@gksudolol
Copy link

plugins don't seem to work for me with or without this PR

@earboxer
Copy link
Contributor Author

earboxer commented Jan 16, 2025

plugins don't seem to work for me with or without this PR

I haven't gotten hyprpm to work correctly either, but I can load a plugin if

  1. I build it manually against the correct version of hyprland
  2. I load it like plugin = /path/to/plugin.so

So, to be honest, I wouldn't mind a build flavor without hyprpm... that whole idea (of having code that downloads and compiles plugins) is kind of against how I want [plugins] to work from a distro perspective.

@gksudolol
Copy link

My lack of hyprpm knowledge would have never figured to make and load manually haha

Perhaps a build option for hyprpm would be the best use case? Then figure whether to pull out glaze dep, or keep

Using an advanced JSON library for string parsing was overkill,
and limited compatibility as glaze compiles on fewer systems than all of hypr*
@fufexan
Copy link
Member

fufexan commented Jan 18, 2025

Perhaps a build option for hyprpm would be the best use case?

Sure, can be done.

@fufexan
Copy link
Member

fufexan commented Jan 18, 2025

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants