Repository navigation
build(libobs): state the Wayland host conversions the ratchet reports (#2885) - #2889
Merged
Merged
Conversation
…#2885) The #2625 ratchet turned on -Wconversion/-Wsign-conversion/-Wfloat-conversion for the libobs and libobs-opengl targets, but the Wayland host TUs are not compiled by the PR lanes, so their implicit conversions only showed up in an app build with ENABLE_WAYLAND=ON. Six conversions, each stated at its boundary with the value the site already had: - obs-nix-wayland.c.h: the keymap level loop is an xkb_level_index_t (what xkb_keymap_key_get_syms_by_level() takes), and the two xkb_keysym_t values handed to obs_key_from_virtual_key()'s int parameter are cast once, matching the opposite cast in obs_nix_wayland_key_to_virtual_key(). - obs-nix-portal-shortcuts.c.h: the three flag clears cast the int constant to uint32_t before complementing it, as obs-hotkey.c.h already does. - gl-wayland-egl.c.h: the two window-size calls pass gs_init_data's uint32_t cx/cy as int, the type wl_egl_window_create()/wl_egl_window_resize() take. No -Wno-* returns.
This was referenced Oct 29, 2026
zackees
commented
Oct 29, 2026
zackees
left a comment
Member
Author
There was a problem hiding this comment.
Reviewed — correct; each site now states the conversion it was already doing.
obs-nix-wayland.c.h:xkb_level_index_t levelis the counterxkb_keymap_key_get_syms_by_level()takes, andMAX_SHIFT_LEVELSis 4, so the loop bound is unchanged; the two(int)syms[0]casts match the explicitintvtable inobs-nix.h(X11/Windows hosts keep the same signature). No behaviour change.obs-nix-portal-shortcuts.c.h:background->flagsisuint32_t(obs-internal.h), and~(uint32_t)MASKis the same mask as the previous~MASKafter the implicit conversion — the three clears keep clearing exactly the bits they cleared.gl-wayland-egl.c.h:gs_init_data.cx/cyareuint32_t;wl_egl_window_create()/_resize()takeint. Sizes aboveINT_MAXare not a real case, and the value passed is unchanged for every size that fits.
No -Wno-*, no pragma, no touch outside the Wayland/portal host TUs, and the GREEN evidence in the body is a real ENABLE_WAYLAND=ON build of these targets, which the PR lanes do not compile.
Two notes, neither blocking:
- The "Why the lane missed it" follow-up you describe as tracked separately (
infra:) does not exist as an issue yet — the only open Wayland issue is #2885, which this PR closes. I am not opening one; it is in this tick's report for the maintainer. libobs/obs-hotkey.c.h:1222does the same&= ~MASKon the sameuint32_twithout a cast and is not in the error list; worth the same treatment in a later slice so the two files read alike.
Member
Author
|
Correction to note 1 above: #2890 ( |
zackees
added a commit
that referenced
this pull request
Oct 29, 2026
The Tier 2 lane builds obs-nix-portal-shortcut-ids.c.h in the C-reference library, where 'size_t len = plus - part' is a ptrdiff_t to size_t conversion and fails at the lane's -Werror=sign-conversion. #2889 states the three Wayland host TUs; this one file is outside its scope, so the lane cannot be green without it.
2 tasks done
zackees
added a commit
that referenced
this pull request
Oct 29, 2026
#2885 broke a default Linux build with nine -Werror=sign-conversion diagnostics in obs-nix-wayland.c.h, obs-nix-portal-shortcuts.c.h and gl-wayland-egl.c.h while every PR lane stayed green: the Tier 2 build configures ENABLE_WAYLAND=OFF although cmake/linux/defaults.cmake defaults it ON, so those three unity TUs are compiled by nobody. Configure -DENABLE_WAYLAND=ON (the build tree and the configure-only Debug tree) and drop --without-wayland from the ported-group expansion, so the Wayland ported groups (hotkey state, portal shortcut ids and sets) join the exclusion list CMake actually builds. GREEN: uv run python -m unittest ci/test_tier2_wayland_lane.py -> 4 tests OK. Local graph evidence (validate image a82d9e80, -DENABLE_WAYLAND=ON, -OBS_BUILD_C_REFERENCE=ON), with #2889's three conversion fixes applied: libobs: libobs.nix-wayland+.h.c.o, libobs.nix-portal-shortcuts+.h.c.o libobs-c-reference: libobs.nix-wayland+.h.c.o, libobs.nix-portal-shortcuts+.h.c.o, libobs.ported-nix-portal-shortcut-ids+.h.c.o, libobs.ported-nix-portal-shortcut-sets+.h.c.o The three TUs compile clean at the lane's -Werror setting, and the two Wayland ported groups stay out of hybrid libobs, which is what the lane's excluded-object check requires. Depends on #2889: master still carries the nine diagnostics this lane would now report, so the PR is queued after it merges.
zackees
added a commit
that referenced
this pull request
Oct 29, 2026
The Tier 2 lane builds obs-nix-portal-shortcut-ids.c.h in the C-reference library, where 'size_t len = plus - part' is a ptrdiff_t to size_t conversion and fails at the lane's -Werror=sign-conversion. #2889 states the three Wayland host TUs; this one file is outside its scope, so the lane cannot be green without it.
MCPVOT
pushed a commit
to MCPVOT/obs-studio
that referenced
this pull request
Oct 30, 2026
…st#2890) (obs-rust#2894) * test(ci): pin the Tier 2 Linux lane to the Wayland host sources (obs-rust#2890) ci/test_tier2_wayland_lane.py fails on master: validate.sh configures -DENABLE_WAYLAND=OFF and passes --without-wayland to ported_sources.py, so libobs.nix-wayland+, libobs.nix-portal-shortcuts+ and opengl.nix-wayland+ reach no lane. RED: uv run python -m unittest ci/test_tier2_wayland_lane.py FAIL: test_every_tier2_configure_enables_wayland FAIL: test_no_wayland_opt_out_is_passed_to_the_source_sets * ci: build the Wayland host sources in the Tier 2 Linux lane (obs-rust#2890) obs-rust#2885 broke a default Linux build with nine -Werror=sign-conversion diagnostics in obs-nix-wayland.c.h, obs-nix-portal-shortcuts.c.h and gl-wayland-egl.c.h while every PR lane stayed green: the Tier 2 build configures ENABLE_WAYLAND=OFF although cmake/linux/defaults.cmake defaults it ON, so those three unity TUs are compiled by nobody. Configure -DENABLE_WAYLAND=ON (the build tree and the configure-only Debug tree) and drop --without-wayland from the ported-group expansion, so the Wayland ported groups (hotkey state, portal shortcut ids and sets) join the exclusion list CMake actually builds. GREEN: uv run python -m unittest ci/test_tier2_wayland_lane.py -> 4 tests OK. Local graph evidence (validate image a82d9e80, -DENABLE_WAYLAND=ON, -OBS_BUILD_C_REFERENCE=ON), with obs-rust#2889's three conversion fixes applied: libobs: libobs.nix-wayland+.h.c.o, libobs.nix-portal-shortcuts+.h.c.o libobs-c-reference: libobs.nix-wayland+.h.c.o, libobs.nix-portal-shortcuts+.h.c.o, libobs.ported-nix-portal-shortcut-ids+.h.c.o, libobs.ported-nix-portal-shortcut-sets+.h.c.o The three TUs compile clean at the lane's -Werror setting, and the two Wayland ported groups stay out of hybrid libobs, which is what the lane's excluded-object check requires. Depends on obs-rust#2889: master still carries the nine diagnostics this lane would now report, so the PR is queued after it merges. * ci: state the portal shortcut substring length (obs-rust#2890) The Tier 2 lane builds obs-nix-portal-shortcut-ids.c.h in the C-reference library, where 'size_t len = plus - part' is a ptrdiff_t to size_t conversion and fails at the lane's -Werror=sign-conversion. obs-rust#2889 states the three Wayland host TUs; this one file is outside its scope, so the lane cannot be green without it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2885
The #2625 ratchet put
-Wconversion -Wsign-conversion -Wfloat-conversion(with-Werror) on thelibobsandlibobs-opengltargets, but the Wayland host TUsare not compiled by the PR lanes: they only appear in a build with
ENABLE_WAYLAND=ON. On master they still carry implicit conversions, so adefault Linux app build stops.
RED
ninja libobs libobs-openglat07340d52ein aRelWithDebInfotree configuredwith
-DENABLE_WAYLAND=ON(the target flags above):(The issue quotes GCC 16.2; the same diagnostics reproduce with GCC 15.2, so this
is not a compiler-version regression but the missing Wayland TUs.)
GREEN
Same tree, same command, same flags, after this change:
exit=0, zeroerror:lines;
libobs/libobs.so.30andlibobs-opengl/libobs-opengl.so.30link.Each conversion is stated at the boundary and keeps the value the site already
computed:
obs-nix-wayland.c.h— the keymap level loop now uses thexkb_level_index_tthatxkb_keymap_key_get_syms_by_level()takes (it is a0..
MAX_SHIFT_LEVELScounter, so nothing changes), and the twoxkb_keysym_tvalues passed to
obs_key_from_virtual_key()'sintparameter are cast once.That mirrors the opposite explicit cast already present in
obs_nix_wayland_key_to_virtual_key()at line 344, and the vtable inlibobs/obs-nix.hstaysint-typed for the X11 and Windows hosts.obs-nix-portal-shortcuts.c.h— the three background-flag clears cast theintconstant touint32_tbefore complementing it, exactly asobs-hotkey.c.h:1222already does forOBS_HOTKEYS_BACKGROUND_CONFIGURE_FAILED.gl-wayland-egl.c.h— the two window-size call sites passgs_init_data'suint32_tcx/cyasint, the typewl_egl_window_create()/wl_egl_window_resize()take.No
-Wno-*returns, and no file outside the Wayland/portal host code is touched.Why the lane missed it
Tracked separately as a follow-up (
infra:): the PR and Tier 2 lanes shouldcompile these host files with the conversion flags, so the next ratchet slice
cannot land green while an app build is red.