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
[Bug]: 1.15.7 pre-release subproject libglnx build failure in opensuse rpmbuild environment using meson due to flaw in feature detection code #5778
Labels
Comments
The upstream for the libglnx copylib is https://gitlab.gnome.org/GNOME/libglnx. |
Please review/test https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/57. This is not going to be fixed as a Flatpak-specific change, but it can be fixed by fixing libglnx and then updating Flatpak's copy. |
smcv
added a commit
to smcv/flatpak
that referenced
this issue
May 2, 2024
* Fix function detection when using -Werror=return-type (Resolves: flatpak#5778) * Add a fallback definition for G_PID_FORMAT * Avoid warnings for g_steal_fd() when targeting older GLib Signed-off-by: Simon McVittie <[email protected]>
smcv
added a commit
to smcv/flatpak
that referenced
this issue
May 2, 2024
* Fix function detection when using -Werror=return-type (Resolves: flatpak#5778) * Add a fallback definition for G_PID_FORMAT * Avoid warnings for g_steal_fd() when targeting older GLib This commit was created via: git remote add --no-tags libglnx https://gitlab.gnome.org/GNOME/libglnx.git git fetch libglnx git diff HEAD:subprojects/libglnx libglnx/master git subtree merge -P subprojects/libglnx libglnx/master git commit --amend -s Signed-off-by: Simon McVittie <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist
Flatpak version
1.15.7 pre-release
What Linux distribution are you using?
openSUSE
Linux distribution version
tumbleweed
What architecture are you using?
x86_64
How to reproduce
export CFLAGS='-Werror=return-type'
Expected Behavior
build succeeds
Actual Behavior
build failed. here's an example log file of a failed build:
libglnx
as its subproject, but flatpak 1.15.7 will give the exact same error message.https://build.opensuse.org/package/live_build_log/home:nerditation/libglnx-testing/openSUSE_Tumbleweed/x86_64
Additional Information
I was testing the fix for fcitx/fcitx5#1017, which requires a new feature in flatpak 1.15.7. opensuse tumbleweed still has 1.15.6 in it's repository, so I forked it and updated the rpm spec to use the 1.15.7 pre-release tarball as source code.
because 1.15.7 removed support for autotools, I also adapted the spec to use meson. but the build failed when compiling
libglnx
. so I tried to chroot into the build environment to do some digging, but if I manually callmeson setup
andmeson compile
with the same command line flags, it builds just fine.after going through tons of log messages, I finally figured it out: opensuse's build service wants set some compiler flags before actually building the package, one of such flags is
-Werror=return-type
. it turns out this flag will change the behavior oflibglnx
's custom feature detection code snippet in itsmeson.build
:https://github.com/GNOME/libglnx/blob/202b294e6079e23242e65e0426f8639841d1210b/meson.build#L32-L49
because the return type at line 43 is
int
,-Werror=return-type
will reject such code, thus the detected feature set is incorrect and later compilation fails due to duplicated function definitions.currently, I managed to work around this with a simple patch, but it's better to be fixed upstream, since 1.15.7 is still in pre-release anyway.
in the long run thoug, I think we should add more feature detections to meson (similar to
autoconf
) so we can avoid this kind of ad-hoc feature detection in the package.The text was updated successfully, but these errors were encountered: