You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug that matches the one I want to file, without success.
If this is an issue with a particular app, I have tried filing it in the appropriate issue tracker for the app (e.g. under https://github.com/flathub/) and determined that it is an issue with Flatpak itself.
This issue is not a report of a security vulnerability (see here if you need to report a security issue).
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
set CFLAGS as opensuse build service would use, specifically:
export CFLAGS='-Werror=return-type'
build flatpak using meson
Expected Behavior
build succeeds
Actual Behavior
build failed. here's an example log file of a failed build:
NOTE: this is the log from an empty dummy project with libglnx as its subproject, but flatpak 1.15.7 will give the exact same error message.
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 call meson setup and meson 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 of libglnx's custom feature detection code snippet in its meson.build:
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.
- int func (void) {+ void func (void) {
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:
* 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 <smcv@collabora.com>
smcv
linked a pull request
May 2, 2024
that will
close
this issue
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: