Update to 5.13.0 failed (12amd64) with: --- sub-input-all --- In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:27:8: error: redefinition of 'input_event' struct input_event { ^ /usr/include/dev/evdev/input.h:44:8: note: previous definition is here struct input_event { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:53:8: error: redefinition of 'input_id' struct input_id { ^ /usr/include/dev/evdev/input.h:53:8: note: previous definition is here struct input_id { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:84:8: error: redefinition of 'input_absinfo' struct input_absinfo { ^ /usr/include/dev/evdev/input.h:60:8: note: previous definition is here struct input_absinfo { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:108:8: error: redefinition of 'input_keymap_entry' struct input_keymap_entry { ^ /usr/include/dev/evdev/input.h:71:8: note: previous definition is here struct input_keymap_entry { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:300:8: error: redefinition of 'ff_replay' struct ff_replay { ^ /usr/include/dev/evdev/input.h:164:8: note: previous definition is here struct ff_replay { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:310:8: error: redefinition of 'ff_trigger' struct ff_trigger { ^ /usr/include/dev/evdev/input.h:170:8: note: previous definition is here struct ff_trigger { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:327:8: error: redefinition of 'ff_envelope' struct ff_envelope { ^ /usr/include/dev/evdev/input.h:176:8: note: previous definition is here struct ff_envelope { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:339:8: error: redefinition of 'ff_constant_effect' struct ff_constant_effect { ^ /usr/include/dev/evdev/input.h:183:8: note: previous definition is here struct ff_constant_effect { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:350:8: error: redefinition of 'ff_ramp_effect' struct ff_ramp_effect { ^ /usr/include/dev/evdev/input.h:188:8: note: previous definition is here struct ff_ramp_effect { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:366:8: error: redefinition of 'ff_condition_effect' struct ff_condition_effect { ^ /usr/include/dev/evdev/input.h:194:8: note: previous definition is here struct ff_condition_effect { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:395:8: error: redefinition of 'ff_periodic_effect' struct ff_periodic_effect { ^ /usr/include/dev/evdev/input.h:221:8: note: previous definition is here struct ff_periodic_effect { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:416:8: error: redefinition of 'ff_rumble_effect' struct ff_rumble_effect { ^ /usr/include/dev/evdev/input.h:232:8: note: previous definition is here struct ff_rumble_effect { ^ In file included from evdevtouch/qevdevtouchhandler.cpp:62: In file included from /usr/local/include/mtdev.h:36: /usr/local/include/linux/input.h:444:8: error: redefinition of 'ff_effect' struct ff_effect { ^ /usr/include/dev/evdev/input.h:253:8: note: previous definition is here struct ff_effect { ^ 13 errors generated. *** [.obj/qevdevtouchhandler.o] Error code 1 make[3]: stopped in /ram/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhere-src-5.13.0/src/platformsupport/input 1 error make[3]: stopped in /ram/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhere-src-5.13.0/src/platformsupport/input *** [sub-input-support-pro-all-ordered] Error code 2 make[2]: stopped in /ram/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhere-src-5.13.0/src/platformsupport/input 1 error make[2]: stopped in /ram/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhere-src-5.13.0/src/platformsupport/input *** [sub-input-all] Error code 2 make[1]: stopped in /ram/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhere-src-5.13.0/src/platformsupport --- sub-linuxaccessibility-all --- A failure has been detected in another branch of the parallel make make[2]: stopped in /ram/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhere-src-5.13.0/src/platformsupport/linuxaccessibility *** [sub-linuxaccessibility-all] Error code 2 make[1]: stopped in /ram/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhere-src-5.13.0/src/platformsupport 2 errors make[1]: stopped in /ram/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhere-src-5.13.0/src/platformsupport *** Error code 2 Stop. make: stopped in /usr/ports/x11-toolkits/qt5-gui ===>>> make build failed for x11-toolkits/qt5-gui ===>>> Aborting update ===>>> Update for qt5-gui-5.12.2_1 failed ===>>> Aborting update
It builds if I remove in src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp: 52 #ifdef Q_OS_FREEBSD 53 #include <dev/evdev/input.h> 54 #else 55 #include <linux/input.h> 56 #endif 57
Can confirm I have the same issue, and the provided workaround worked for me too.
(In reply to Anders Bolt-Evensen from comment #2) Same here too!
Moin moin How can you produce the error? Are you building in an unclean environment? mfg Tobias
Error appears with the port, I have not tested it with poudriere.
Same and for me It turned out that the build fails when devel/evdev-proto port is installed.
(In reply to Anders Bolt-Evensen from comment #2) It was not meant as workaround (it is wrong). If I am right, this should the correct way: --- src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp.orig 2019-10-01 18:04:32 UTC +++ src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -38,6 +38,12 @@ ** ****************************************************************************/ +#ifdef Q_OS_FREEBSD +#include <dev/evdev/input.h> +#else +#include <linux/input.h> +#endif + #include "qevdevtouchhandler_p.h" #include "qtouchoutputmapping_p.h" #include <QStringList> @@ -49,11 +55,6 @@ #include <QtCore/private/qcore_unix_p.h> #include <QtGui/private/qhighdpiscaling_p.h> #include <QtGui/private/qguiapplication_p.h> -#ifdef Q_OS_FREEBSD -#include <dev/evdev/input.h> -#else -#include <linux/input.h> -#endif #include <math.h>
in response to patch posted in comment #7, I can confirm creating an arbitrary files/patch file with the patch contents of comment 7 will allow the build to complete if a manual "make patch" is applied. not 100% if it would auto-apply by ports or not, so manual may not be necessary, just not familiar enough with the ports Mk system to be sure. I'm going to let the rest of the remaining QT5 upgrades to occur. this perhaps is a more suitable workaround, although given the nature of things this is likely something best suited for upstream patching, as my read of what had to be fixed is likely an issue in linux too, as it seems to be an bad order of header references for the same component evdev-proto. so for folks looking to get things updated this may be a temp hack for local fix for now. if it breaks ardour or one of the other evdev-proto dependent builds I have I'll make further comment. but qt5-declarative built and installed, which is dependent on qt5-gui, and I confirmed the patch applied where it was expected to apply
(In reply to alt2600 from comment #8) in case folks read this and do not realize this. I deleted my locally created files directory when done, as I expect there will be a more correct update at some point, and updating source tree will NOT automatically delete this folder for you. it will likely cause problems with the build being corrected upstream if you take this approach for the time being.
x11-toolkits/qt5-gui builds and installs when the above patch is put in files/patch-qevdevtouchhandler.cpp.
2019Q4 branch also has the same issue. MFH needed.
Created attachment 208080 [details] patch Created svn patch based on Walter's patch. Also fixed following QA error: ====> Running Q/A tests (stage-qa) Error: /usr/local/lib/qt5/plugins/generic/libqevdevtouchplugin.so is linked to /usr/local/lib/libmtdev.so.1 from devel/l ibmtdev but it is not declared as a dependency Warning: you need LIB_DEPENDS+=libmtdev.so:devel/libmtdev
(In reply to Walter Schwarzenfeld from comment #7) This is still a workaround. You just made the #ifdef check be always false because you checked it before including files which could define it. Therefore, the patch you wrote +#ifdef Q_OS_FREEBSD +#include <dev/evdev/input.h> +#else +#include <linux/input.h> +#endif is effectively +#include <linux/input.h> because the false branch is always taken. The reason of the compilation error is that both dev/evdev/input.h (from base) and linux/input.h (from devel/evdev-proto) declare the same things. They use different macros as header guards, so including one does not prevent the other one from being included. If a source file includes both header files, it cannot be compiled because of the redefinition error shown above. Qt uses dev/evdev/input.h here, while mtdev.h provided by devel/libmtdev uses linux/input.h. Since Qt also includes mtdev.h in this file, it causes a conflict. This doesn't happen in poudriere because devel/libmtdev does not RUN_DEPENDS on devel/evdev-proto, so devel/evdev-proto isn't installed in the poudriere environment. Therefore, even if devel/libmtdev is pulled in by x11/libinput and installed in the poudriere environment, Qt still disables mtdev because including mtdev.h causes an error due to missing linux/input.h. I think devel/libmtdev should add devel/evdev-proto as RUN_DEPENDS, and headers installed by devel/evdev-proto should probably guard equivalent headers from base from being included.
(In reply to Koichiro Iwao from comment #12) This patch works for me. Thanks!
As Ting-Wei Lan says, the patch is still workaround but I would say workaround is OK. The build is now failing. We need to address the build issue soon. What about committing the current patch first? When new patch is ready, update to the new patch later.
(In reply to Koichiro Iwao from comment #15) If we want a workaround, I think we should just remove the Q_OS_FREEBSD check and leave only #include <linux/input.h> there. The current way of moving the entire #ifdef block is misleading.
Created attachment 208179 [details] devel/evdev-proto: Use the same include guard as base In order to prevent a source file from including both dev/evdev/input.h from base and linux/input.h from ports, these files should be the same include guards. This should fix the qt5-gui error caused by redefinition of structs. This patch also adds devel/evdev-proto to RUN_DEPENDS of devel/libmtdev because mtdev.h needs linux/input.h. I haven't tested the patch with poudriere. I only tested it with portmaster on my desktop computer running FreeBSD 12.1-BETA3.
(In reply to Ting-Wei Lan from comment #17) This looks promising. I'm not a fan of committing the other (broken) work around.
dev/evdev/input.h was never intended to be used outside the base system so leaving only #include <linux/input.h> is not a workaround. It is a fix. You can bump evdev-proto to 5.3 instead of assigning a new revision number
I think the same. This example is base system. I found this https://git.sr.ht/~sircmpwn/wlroots/commit/f80d174e8b179f3af80f7990529c3b0440846dca
Thanks for the clarification Vladimir. We discussed it, and I'll prepare a fix for this shortly. mfg Tobias
https://github.com/qt/qtbase/commit/e6d0d202f3c3f296b6865a63d87a7c9182b63ae2
Filed upstream as https://bugreports.qt.io/browse/QTBUG-79130
Committed with ports r514242. Commit statement in the wrong PR.
evdevmouse/qevdevmousehandler.cpp:56:10: fatal error: 'linux/kd.h' file not found #include <linux/kd.h> ^~~~~~~~~~~~ 1 error generated. *** [.obj/qevdevmousehandler.o] Error code 1
A commit references this bug: Author: adridg Date: Thu Oct 10 20:38:42 UTC 2019 New revision: 514255 URL: https://svnweb.freebsd.org/changeset/ports/514255 Log: Fix build of x11-toolkits/qt5-gui <linux/kd.h> isn't needed here. Pointy hat to adridg@, for mixing up pou-build tree and the SVN tree. PR: 240964 Reported by: vvd@unislabs.com Changes: head/x11-toolkits/qt5-gui/files/patch-src_platformsupport_input_evdevmouse_qevdevmousehandler.cpp
Since the evdev-proto part of attachment 208179 [details] is now unnecessary, can I propose committing only the libmtdev part of it?
Reassigning to maintainer of libmtdev (the relevant bit is **only** the last comment, and the part adding evdev-proto to the RUN_DEPENDS of libmtdev). Now qt5-gui has reverted to using the headers from the evdev-proto port, it's up to other parts of the stack to sort out their includes. See in particular comment #19 about using base input.h.
Ping! The bug has been opened for two months, but libmtdev is still broken.
I'll try to have a look at this later today. Thanks for the ping. --HPS
Basically the patch looks good, so if someone wants to commit it feel free! Else I'll try to queue it up myself.
Patches are approved. Who will test/commit them?
ping
See also review D18791 i.e., ad RUN_DEPENDS to devel/libevdev as well.
A commit references this bug: Author: adridg Date: Sun Sep 13 20:06:30 UTC 2020 New revision: 548573 URL: https://svnweb.freebsd.org/changeset/ports/548573 Log: Fix up (run) depends of devel/libmtdev There's some confusion about evdev headers, and this patch was shunted back and forth between Qt and others for a while, and then languished. Original patch from Ting-Wei Lan, partly obsoleted by changes in Qt in ports r514242 and r514255, OK'ed by maintainer in the PR. PR: 240964 Submitted by: Ting-Wei Lan Reported by: Walter Schwarzenfeld Reviewed by: adridg Approved by: hselasky Changes: head/devel/libmtdev/Makefile
The review mentioned by Jan is abandoned, so I've just pushed the relevant part of the patch in here; I'll be submitting a PR to update to libmtdev 1.1.6 (released January 2020) shortly.
(In reply to commit-hook from comment #35) FWIW, this change was reverted in ports 5d998836b36f.