Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 953902 - =games-strategy/freeciv-3.1.4[qt6] failed (configure phase) "meson.build:3180:4: ERROR: Problem encountered: Qt6 >= 6.0 required for qt-client in Qt6 mode, but not found"
Summary: =games-strategy/freeciv-3.1.4[qt6] failed (configure phase) "meson.build:3180...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-16 03:47 UTC by Zdenek Sojka
Modified: 2025-04-17 00:43 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,12.47 KB, text/x-log)
2025-04-16 03:47 UTC, Zdenek Sojka
Details
emerge --info (emerge--info.txt,9.10 KB, text/plain)
2025-04-16 03:50 UTC, Zdenek Sojka
Details
meson-log.txt (meson-log.txt,153.48 KB, text/plain)
2025-04-16 03:51 UTC, Zdenek Sojka
Details
freeciv-3.1.4-qt6.patch (freeciv-3.1.4-qt6.patch,1.85 KB, patch)
2025-04-17 00:40 UTC, Matt Jolly
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2025-04-16 03:47:02 UTC
Created attachment 924944 [details]
build.log

games-strategy/freeciv-3.1.4[qt6] fails during configure phase; it buils fine with USE=-qt6, and games-strategy/freeciv-3.1.3[qt6] builds fine as well, and the qt6 frontend works fine.

[ebuild   R   ~] games-strategy/freeciv-3.1.4::gentoo  USE="gtk3 gtk4 nls qt6* readline sdl server sound system-lua -dedicated -json -mapimg -modpack -mysql -rule-editor -web-server" LUA_SINGLE_TARGET="lua5-4" 0 KiB

[ebuild     U ~] games-strategy/freeciv-3.1.4::gentoo [3.1.3::gentoo] USE="gtk3 gtk4 nls qt6 readline sdl server sound system-lua -dedicated -json -mapimg -modpack -mysql -rule-editor -web-server" LUA_SINGLE_TARGET="lua5-4" 0 KiB


# MAKEOPTS=-j1 FEATURES=-ccache emerge -v games-strategy/freeciv

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 14.57 s (backtrack: 0/20).

[ebuild   R   ~] games-strategy/freeciv-3.1.4::gentoo  USE="gtk3 gtk4 nls qt6* readline sdl server sound system-lua -dedicated -json -mapimg -modpack -mysql -rule-editor -web-server" LUA_SINGLE_TARGET="lua5-4" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB


>>> Verifying ebuild manifests

>>> Emerging (1 of 1) games-strategy/freeciv-3.1.4::gentoo
 * freeciv-3.1.4.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                   [ ok ]

...

Run-time dependency qt6 (modules: Core, Gui, Widgets) found: YES 6.8.2 (pkg-config)
Checking if "qt minver" with dependencies Qt6Core, Qt6Core, Qt6Gui, Qt6Widgets compiles: NO 

meson.build:3180:4: ERROR: Problem encountered: Qt6 >= 6.0 required for qt-client in Qt6 mode, but not found

A full log can be found at /var/tmp/portage/games-strategy/freeciv-3.1.4/work/freeciv-3.1.4-build/meson-logs/meson-log.txt
 * ERROR: games-strategy/freeciv-3.1.4::gentoo failed (configure phase):
 *   configure failed

...


In meson-log.txt, there is:
...
-----------
Command line: `x86_64-pc-linux-gnu-g++ -I/usr/include/qt6/QtWidgets -I/usr/include/qt6 -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtCore -I/usr/lib64/qt6/mkspecs/linux-g++ /var/tmp/portage/games-strategy/freeciv-3.1.4/work/freeciv-3.1.4-build/meson-private/tmp_mm75uu9/testfile.cpp -o /var/tmp/portage/games-strategy/freeciv-3.1.4/work/freeciv-3.1.4-build/meson-private/tmp_mm75uu9/output.obj -c -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -O3 -pipe -march=native -fomit-frame-pointer -fno-stack-protector -fno-stack-clash-protection -D_FILE_OFFSET_BITS=64 -O0 -fpermissive -std=c++17` -> 1
stderr:
In file included from /usr/include/qt6/QtCore/qtcoreexports.h:7,
                 from /usr/include/qt6/QtCore/qglobal.h:26,
                 from /usr/include/qt6/QtCore/QtCore:4,
                 from /var/tmp/portage/games-strategy/freeciv-3.1.4/work/freeciv-3.1.4-build/meson-private/tmp_mm75uu9/testfile.cpp:1:
/usr/include/qt6/QtCore/qcompilerdetection.h:1281:4: error: #error "You must build your code with position independent code if Qt was configured with -reduce-relocations. " "Compile your code with -fPIC (and not with -fPIE)."
 1281 | #  error "You must build your code with position independent code if Qt was configured with -reduce-relocations. "\
      |    ^~~~~
-----------
Checking if "qt minver" with dependencies Qt6Core, Qt6Core, Qt6Gui, Qt6Widgets compiles: NO 
...

Disabling any CFLAGS (eg. lto, O3, march=native) does not help:


-----------
Command line: `x86_64-pc-linux-gnu-g++ -I/usr/include/qt6/QtWidgets -I/usr/include/qt6 -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtCore -I/usr/lib64/qt6/mkspecs/linux-g++ /var/tmp/portage/games-strategy/freeciv-3.1.4/work/freeciv-3.1.4-build/meson-private/tmpsefbv08e/testfile.cpp -o /var/tmp/portage/games-strategy/freeciv-3.1.4/work/freeciv-3.1.4-build/meson-private/tmpsefbv08e/output.obj -c -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_FILE_OFFSET_BITS=64 -O0 -fpermissive -std=c++17` -> 1
stderr:
In file included from /usr/include/qt6/QtCore/qtcoreexports.h:7,
                 from /usr/include/qt6/QtCore/qglobal.h:26,
                 from /usr/include/qt6/QtCore/QtCore:4,
                 from /var/tmp/portage/games-strategy/freeciv-3.1.4/work/freeciv-3.1.4-build/meson-private/tmpsefbv08e/testfile.cpp:1:
/usr/include/qt6/QtCore/qcompilerdetection.h:1281:4: error: #error "You must build your code with position independent code if Qt was configured with -reduce-relocations. " "Compile your code with -fPIC (and not with -fPIE)."
 1281 | #  error "You must build your code with position independent code if Qt was configured with -reduce-relocations. "\
      |    ^~~~~
-----------

In freeciv-3.1.3 meson-log.txt, there is no such line, so maybe there is no check to fail.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-16 03:50:09 UTC
Could you upload meson-log.txt too (and emerge --info)?
Comment 2 Zdenek Sojka 2025-04-16 03:50:34 UTC
Created attachment 924945 [details]
emerge --info
Comment 3 Zdenek Sojka 2025-04-16 03:51:26 UTC
Created attachment 924946 [details]
meson-log.txt
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-16 03:53:24 UTC
The check they do is..interesting?

https://github.com/freeciv/freeciv/blob/main/meson.build#L3630

I think the dependency('qt6') object should contain the flags needed, but the manual check only does cxx_compiler.compiles + qt_cppflags which isn't enough.

But why are they doing that to begin with? Why can't they either query qt_dep.version(), or just specify a min version when forming qt_dep to begin with?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-16 03:55:16 UTC
Passing qt_dep.compile_args() in arguments may work there.
Comment 6 Zdenek Sojka 2025-04-16 05:01:35 UTC
Thank you for the quick response, Sam!
Comment 7 Matt Jolly gentoo-dev 2025-04-17 00:40:45 UTC
Created attachment 924999 [details, diff]
freeciv-3.1.4-qt6.patch

Hi!

I raised the issue upstream and they've provided a patch. I've attached a patch to ::gentoo to modify the ebuild for testing. Could you please try it and let me know if it resolves your issue? It seems to work for me, but I wasn't impacted in the first place.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-17 00:42:51 UTC
(In reply to Zdenek Sojka from comment #6)
> Thank you for the quick response, Sam!

No problem!

(In reply to Matt Jolly from comment #7)
> Created attachment 924999 [details, diff] [details, diff]
> freeciv-3.1.4-qt6.patch
> 
> Hi!
> 
> I raised the issue upstream and they've provided a patch. I've attached a
> patch to ::gentoo to modify the ebuild for testing. Could you please try it
> and let me know if it resolves your issue? It seems to work for me, but I
> wasn't impacted in the first place.

FWIW, I think the patch isn't really correct (it may work), and instead https://bugs.gentoo.org/953902#c5 if it works would be better.
Comment 9 Matt Jolly gentoo-dev 2025-04-17 00:43:21 UTC
It looks like there's now work upstream to drop this check in favour of depending only on pkg-config-supported versions of Qt6. Since that's every version in-tree for us the long-term solution may be backporting that change for future 3.1.x releases.