-
-
Notifications
You must be signed in to change notification settings - Fork 768
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
Plugin API: Add version query #3545
Conversation
Very very good to have. I won't need to parse shell command output querying the state of the program I'm using, was a really roundabout way to do it. Info seems well organized, happy that ignoring the |
I'd still gatekeep it under some #ifdef for people on < 0.31 |
Looks good to me. It might also be a good idea to have a standard check in place you can opt out of that would show a hyprland notification along the lines of "plugin {} was compiled for a different hyprland version and could not be loaded." (implemented in the header so its compiled on the plugin side) |
Plugins have to do that themselves, I'll gatekeep all the official plugins with that once this is merged and versioned like duckonaut. |
Do you have any reason not to implement a standard check for it in the header? |
if you have an idea on how to do that, feel free |
You implement the check in the header so it gets compiled plugin side, and uses the GIT_COMMIT_HASH of the headers its compiling against. I can implement it later if you want. |
how do I make it not compile hl-side though? |
have a plugin side api header, in that header define a function to get the commit it was compiled against. it dosen't matter if its compiled hyprland side because you're only checking the result from the function in the plugin. |
Yeah, I could do that as well, i'll just need to tweak the build system to handle that. |
fair point, I'll see tomorrow if I can do it |
maybe not very tomorrow but have a look guys :) |
For maximum compatibility, maybe it could be useful to return this as a C str just using |
good point. |
I think it would be useful to have hyprland compare the result of __hyprland_api_get_hash by default (maybe some kind of opt out) and show an error via the notification system that the plugin couldn't be loaded if it mismatches. |
that can be done in a follow-up |
yeah otherwise LGTM |
although I am opposed to that |
I feel like an opt-out makes sense because most plugins have to touch a lot more than the "HyprlandAPI" header surface to do anything useful. What's your reasoning? |
many don't break between rebuilds, like e.g. csgo-vulkan-fix that had been working at one point for 4 months without an issue for me. it'd be better to make it a warning rather than error |
Yeah I'm not opposed to that, I just want there to be a visual indication something is/may be wrong by default, because a ton of people get ABI breakage all the time with hy3. |
why don't they just use hyprload :) |
its been broken with hy3 for quite a while (since the pkg config change). I think echoduck fixed it like a couple days ago but I haven't checked yet. |
Yeah it wasn't properly serving its own headers ever since the pkgconfig change, in the meantime I think literally every plugin moved to pkg-config so now that I made it serve headers via that, it works well again. It still always worked for downloading and updating plugins, just didn't actually help with building them correctly since May |
since fuffie is dead I will just merge it |
Meson breaks down magnificently. |
all checks passed tho? wot |
From gcc, |
This will also cause plugin build to fail, so I think it's safe to say that include version.h is needed. |
I know
hyprctl version
exists but this is better.cc @fufexan @outfoxxed @Duckonaut RFC