Bug 271581 - x11-toolkits/qt5-gui: fails to package when ATKONLY=on in accessibility/at-spi2-core
Summary: x11-toolkits/qt5-gui: fails to package when ATKONLY=on in accessibility/at-sp...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
: 276026 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-23 11:26 UTC by Tassilo Philipp
Modified: 2025-02-28 04:25 UTC (History)
9 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
Add ATK_BRIDGE option for qt5-gui (8.41 KB, patch)
2023-08-09 15:56 UTC, Corey Halpin
no flags Details | Diff
Add ATK_BRIDGE option for qt5-widgets (871 bytes, patch)
2023-08-09 16:00 UTC, Corey Halpin
no flags Details | Diff
Add ATK_BRIDGE option for qt5-gui, with DESC (8.45 KB, patch)
2023-08-20 16:33 UTC, Corey Halpin
no flags Details | Diff
Add ATK_BRIDGE option for qt5-widgets, with DESC (914 bytes, patch)
2023-08-20 16:34 UTC, Corey Halpin
no flags Details | Diff
Add ATK_BRIDGE option for qt5-gui, option vars version (8.25 KB, patch)
2023-08-27 17:42 UTC, Corey Halpin
no flags Details | Diff
Add ATK_BRIDGE option for qt5-widgets, option vars version (1.21 KB, patch)
2023-08-27 17:43 UTC, Corey Halpin
no flags Details | Diff
qt5-gui-config.log after applying patch and build error (64.32 KB, text/plain)
2024-01-22 20:59 UTC, jakub_lach
no flags Details
Add ATK_BRIDGE option for qt5-gui, option vars version (8.20 KB, patch)
2025-02-27 03:03 UTC, Mark Linimon
no flags Details | Diff
Add ATK_BRIDGE option for qt5-widgets, option vars version (1.18 KB, patch)
2025-02-27 03:05 UTC, Mark Linimon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tassilo Philipp 2023-05-23 11:26:17 UTC
The accessibility/at-spi2-core port has an option ATKONLY which disables spi. The qt5-gui port builds just fine with at-spi2-core built with ATKONLY=on, but fails in the package phase as it assumes certain files to be available:

[...]
=======================<phase: package        >============================
===>  Building package for qt5-gui-5.15.8p157_1
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.8/QtLinuxAccessibilitySupport/private/application_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.8/QtLinuxAccessibilitySupport/private/atspiadaptor_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.8/QtLinuxAccessibilitySupport/private/bridge_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.8/QtLinuxAccessibilitySupport/private/cache_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.8/QtLinuxAccessibilitySupport/private/constant_mappings_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.8/QtLinuxAccessibilitySupport/private/dbusconnection_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.8/QtLinuxAccessibilitySupport/private/struct_marshallers_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/QtLinuxAccessibilitySupport:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/QtLinuxAccessibilitySupportDepends:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/QtLinuxAccessibilitySupportVersion:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/qtlinuxaccessibilitysupportversion.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/lib/cmake/Qt5LinuxAccessibilitySupport/Qt5LinuxAccessibilitySupportConfig.cmake:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/lib/cmake/Qt5LinuxAccessibilitySupport/Qt5LinuxAccessibilitySupportConfigVersion.cmake:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/lib/qt5/libQt5LinuxAccessibilitySupport.a:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/lib/qt5/libQt5LinuxAccessibilitySupport.prl:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/lib/qt5/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri:No such file or directory
*** Error code 1


I am not sure how to handle this (or if this can/should be handled)?
Comment 1 Corey Halpin 2023-08-09 15:56:53 UTC
Created attachment 243986 [details]
Add ATK_BRIDGE option for qt5-gui

Add an ATK_BRIDGE option for qt5-gui, parallel to the same option in gtk30. When this option is unset, qt5-gui packages correctly when ATKONLY=on is set in accessibility/at-spi2-core .
Comment 2 Corey Halpin 2023-08-09 16:00:36 UTC
Created attachment 243987 [details]
Add ATK_BRIDGE option for qt5-widgets

This, similarly, adds an ATK_BRIDGE option to qt5-widgets, working similarly to the one for qt5-gui.
Comment 3 Tassilo Philipp 2023-08-20 12:38:40 UTC
Thanks! I tested it and it builds fine now. One thing though, I think the Makefiles need a ATK_BRIDGE_DESC variable, otherwise the ATK_BRIDGE option in the options dialog lacks a description.
Comment 4 Corey Halpin 2023-08-20 16:33:46 UTC
Created attachment 244229 [details]
Add ATK_BRIDGE option for qt5-gui, with DESC
Comment 5 Corey Halpin 2023-08-20 16:34:14 UTC
Created attachment 244230 [details]
Add ATK_BRIDGE option for qt5-widgets, with DESC
Comment 6 Tobias C. Berner freebsd_committer freebsd_triage 2023-08-20 16:42:43 UTC
Moin moin 

Please convert your patches to https://docs.freebsd.org/en/books/porters-handbook/makefiles/#options-vars

mfg Tobias
Comment 7 Corey Halpin 2023-08-27 15:19:16 UTC
(In reply to Tobias C. Berner from comment #6)

When I attempt to use the option vars formulation then x11-toolkits/qt5-gui fails to configure. The error is `Project ERROR: Unknown module(s) in QT_PRIVATE: dbus`. Adding a `CONFIGURE_ENV` to also pass the customized QT_CONFIG and QT_DEFINES did not help. I'm not entirely clear on what is going wrong. It seems like `ATK_BRIDGE_USE_QT= dbus` is no longer being recognized by the USE_QT machinery when using `ATK_BRIDGE_VARS(_OFF)?` to customize QT_CONFIG and QT_DEFINES.
Comment 8 Corey Halpin 2023-08-27 15:39:26 UTC
(In reply to Corey Halpin from comment #7)

Oh! Ugh. Nevermind. I see now what I was doing wrong. I'll have updated patches after a few more `testport` runs complete.
Comment 9 Corey Halpin 2023-08-27 17:42:38 UTC
Created attachment 244391 [details]
Add ATK_BRIDGE option for qt5-gui, option vars version
Comment 10 Corey Halpin 2023-08-27 17:43:08 UTC
Created attachment 244392 [details]
Add ATK_BRIDGE option for qt5-widgets, option vars version
Comment 11 Corey Halpin 2023-08-27 17:43:54 UTC
Both option vars versions pass `poudriere testport` for 13.2/amd64 both with and without the ATK_BRIDGE option set.
Comment 12 jakub_lach 2023-12-30 20:29:53 UTC
(In reply to Corey Halpin from comment #11)

Thanks for your work, unfortunately  I think that patch needs updating for qt5-gui 5.15.12p148 (I've ran into this issue yet again after recent update).
Comment 13 Corey Halpin 2023-12-30 20:51:24 UTC
(In reply to jakub_lach from comment #12)

What specifically is the problem you are seeing? With a ports tree updated from git this morning, both the above patches still apply and the ports still build correctly in poudriere. I'm now building on 14.0/amd64 rather than 13.2/amd64, but offhand I can't think of a reason that would make any difference.
Comment 14 Jason E. Hale freebsd_committer freebsd_triage 2023-12-30 21:12:31 UTC
*** Bug 276026 has been marked as a duplicate of this bug. ***
Comment 15 jakub_lach 2023-12-30 23:57:51 UTC
(In reply to Corey Halpin from comment #13)

--- sub-ibus-all ---                                                                                                                                
./qibustypes.h:152:8: error: unknown type name 'QDBusArgument'                                                                        
inline QDBusArgument &operator<<(QDBusArgument &argument, const QIBusAttribute &attribute)                                                                                     
       ^                                                                                                                            
./qibustypes.h:152:34: error: unknown type name 'QDBusArgument'                                                                       
inline QDBusArgument &operator<<(QDBusArgument &argument, const QIBusAttribute &attribute)                                                                        
                                 ^                                                                                                                 
./qibustypes.h:154:14: error: unknown type name 'QDBusArgument'                                                                       
inline const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusAttribute &attribute)                                                                            
             ^                                                                                                                        
./qibustypes.h:154:46: error: unknown type name 'QDBusArgument'                                                                       
inline const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusAttribute &attribute)                                                            
                                             ^                                                                                                      
./qibustypes.h:157:8: error: unknown type name 'QDBusArgument'                                                                        
inline QDBusArgument &operator<<(QDBusArgument &argument, const QIBusAttributeList &attributeList)                                                                             
       ^                                                                                                                            
./qibustypes.h:157:34: error: unknown type name 'QDBusArgument'
inline QDBusArgument &operator<<(QDBusArgument &argument, const QIBusAttributeList &attributeList)
                                 ^
./qibustypes.h:159:14: error: unknown type name 'QDBusArgument'
inline const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusAttributeList &attributeList)
             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** [.obj/qibustypes.o] Error code 1

make[3]: stopped in /usr/obj/usr/ports/x11-toolkits/qt5-gui/work/kde-qtbase-5.15.12p148/src/plugins/platforminputcontexts/ibus
1 error

make[3]: stopped in /usr/obj/usr/ports/x11-toolkits/qt5-gui/work/kde-qtbase-5.15.12p148/src/plugins/platforminputcontexts/ibus
*** [sub-ibus-all] Error code 2

make[2]: stopped in /usr/obj/usr/ports/x11-toolkits/qt5-gui/work/kde-qtbase-5.15.12p148/src/plugins/platforminputcontexts
--- sub-compose-all ---
*** [sub-compose-all] Error code 6

make[2]: stopped in /usr/obj/usr/ports/x11-toolkits/qt5-gui/work/kde-qtbase-5.15.12p148/src/plugins/platforminputcontexts
2 errors

make[2]: stopped in /usr/obj/usr/ports/x11-toolkits/qt5-gui/work/kde-qtbase-5.15.12p148/src/plugins/platforminputcontexts
*** Error code 2
Comment 16 Corey Halpin 2023-12-31 00:47:28 UTC
(In reply to jakub_lach from comment #15)

Error messages without any context about how you got them are pretty difficult to debug.

Could you please specify:

  - What version of FreeBSD you are using and on what architecture?

  - How you are building the port (e.g., ports directly, `portmaster`, `poudriere`, etc)?

  - What options you are using for the port?


(For what it's worth, if you haven't unset the ATK_BRIDGE option for these two ports, but you have set ATKONLY in accessibility/at-spi2-core, then it wouldn't be expected to work. The new options added in this patch must be unset in combination with the ATKONLY=on in accessibility/at-spi2-core - that is the situation for the successful builds in poudriere under 14.0/amd64 that I mentioned earlier.)
Comment 17 jakub_lach 2023-12-31 00:55:26 UTC
(In reply to Corey Halpin from comment #16)

Hello,

Sorry for the cryptic message, I'm still running some (portmaster) rebuilds to be 100% sure, though the above was with patch "Add ATK_BRIDGE option for qt5-gui, option vars version" applied and ATK_BRIDGE set to off, ATKONLY set to on (both portswide), 14.0-STABLE #0 stable/14-0a6b61a89 amd64.

Previously had the same packaging error as you.
Comment 18 Corey Halpin 2024-01-07 21:06:54 UTC
(In reply to jakub_lach from comment #17)

Thank you for the additional information - it is very helpful.

Unfortunately, I'm still not able to replicate the error your are getting. I created a 14.0 jail, pulled ports from git, applied the patches from this bug, and added the following to make.conf:

```
OPTIONS_UNSET+= ATK_BRIDGE
OPTIONS_UNSET+= DBUS

accessibility_at-spi2-core_SET+= ATKONLY
```

With these settings in place, portmaster correctly builds `x11-toolkits/qt5-gui`.

I suspect that either 1) there's something installed on your system that's confusing `configure` so that it depends on dbus despite `-DQT_NO_DBUS` in the build, or 2) there's some other port on your system built against dbus that implicitly forces the dbus dependency.

Can you do (as root):
```
cd /usr/ports/x11-toolkits/qt5-gui
make clean
make configure | tee ~/qt5-gui-config.log
```

Then please attach the `qt5-gui-config.log` from root's homedir to this bug?

Thank you.
Comment 19 jakub_lach 2024-01-07 23:08:39 UTC
(In reply to Corey Halpin from comment #18)

Thanks for reply, I will test again later, though for fwiw it occurred to me that I didn't really need ATKONLY=on in accessibility/at-spi2-core so for now I just recompiled/updated all affected ports without additional patches.
Comment 20 jakub_lach 2024-01-22 20:59:27 UTC
Created attachment 247856 [details]
qt5-gui-config.log after applying patch and build error

qt5-gui-config.log after applying patch and build error
Comment 21 takefu 2024-08-02 02:06:39 UTC
(In reply to jakub_lach from comment #20)

I think the cause might be that the X11 option was disabled when building.
I added the following to /etc/make.conf and then rebuilt the port, which solved the problem.

x11_libxkbcommon_SET=X11
Comment 22 Mark Linimon freebsd_committer freebsd_triage 2025-02-27 03:03:45 UTC
Created attachment 258018 [details]
Add ATK_BRIDGE option for qt5-gui, option vars version

^Triage: rebase patch.
Comment 23 Mark Linimon freebsd_committer freebsd_triage 2025-02-27 03:05:16 UTC
Created attachment 258019 [details]
Add ATK_BRIDGE option for qt5-widgets, option vars version

^Triage: rebase patch.
Comment 24 Max Brazhnikov freebsd_committer freebsd_triage 2025-02-27 13:03:49 UTC
It seems this patch is not complete, pkg-plist has to be adapted for the changes. However, I'm not in favour of this option:
ATKONLY option in accessibility/at-spi2-core says that upstream does not support this configuration, besides building Qt 5 with unsupported at-spi2-core could result in cryptic problems with downstream ports.
Comment 25 Corey Halpin 2025-02-28 04:25:43 UTC
Adding this option allows users who do not want dbus on their systems to build qt5 without it.

The ports tree has not previously provided for this without local patches, so not including it at least would not be a regression.

I'm perfectly happy continuing to maintain my local patches for this purpose.

My personal experience has been that removing dbus support tends to avoid "cryptic problems", auto-starting daemons that I didn't want, and programs hanging seemingly at random. Including this option in the port would allow users to decide which "cryptic problems" they want to experience - those caused by dbus or those caused by omitting it.