Repository navigation
Closed
Description
The last release, 0.30.12, fails to build with Qt 6.12.0 like:
g++ -Wl,-O1 -Wl,-rpath,/gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib -Wl,-rpath-link,/gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib -shared -Wl,-soname,libklayout_lvs.so.0 -o libklayout_lvs.so.0.30.12 lvsForceLink.o qrc_lvsResources.o -lgit2 -lz -L/tmp/guix-build-klayout-0.30.12.drv-0/source/build-release/lvs/lvs/../.. -lklayout_tl -lklayout_db -lklayout_gsi -lklayout_lym -lklayout_rdb -lklayout_drc /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib/libQt6PrintSupport.so /gnu/store/242x5wvmwkr84p09h6lbfj0dhwvpc4pr-qttools-6.12.0/lib/libQt6Designer.so -lQt6Xml /gnu/store/242x5wvmwkr84p09h6lbfj0dhwvpc4pr-qttools-6.12.0/lib/libQt6UiTools.so -lQt6OpenGLWidgets /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib/libQt6OpenGLWidgets.so -lQt6OpenGL /gnu/store/v1yg8ak2c31vz1r3vxz05bbl85z2hgx1-qtmultimedia-6.12.0/lib/libQt6MultimediaWidgets.so -lQt6Multimedia -lQt6Widgets /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib/libQt6Widgets.so /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib/libQt6OpenGL.so /gnu/store/v1yg8ak2c31vz1r3vxz05bbl85z2hgx1-qtmultimedia-6.12.0/lib/libQt6Multimedia.so -lQt6Network /gnu/store/7vc4lrc1dylymhxglrs1hxslcj73yrp4-qtsvg-6.12.0/lib/libQt6Svg.so -lQt6Gui /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib/libQt6Gui.so /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib/libQt6Xml.so /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib/libQt6Network.so /gnu/store/am7hz5wgb2rbbipymxpwjavqvx4k0csk-qt5compat-6.12.0/lib/libQt6Core5Compat.so /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib/libQt6Sql.so -lQt6Core /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/lib/libQt6Core.so -lpthread -lGL
ln -s libklayout_lvs.so.0.30.12 libklayout_lvs.so
ln -s libklayout_lvs.so.0.30.12 libklayout_lvs.so.0
ln -s libklayout_lvs.so.0.30.12 libklayout_lvs.so.0.30
rm -f ../../../build-release/libklayout_lvs.so.0.30.12
mv -f libklayout_lvs.so.0.30.12 ../../../build-release/libklayout_lvs.so.0.30.12
rm -f ../../../build-release/libklayout_lvs.so
../../../../src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamEntityResolver.cc:116:19: error: virtual function ‘virtual QString QXmlStreamEntityResolver_Adaptor::resolveEntity(const QString&, const QString&)’ overriding final function
116 | virtual QString resolveEntity(const QString &publicId, const QString &systemId)
| ^~~~~~~~~~~~~
In file included from /gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/include/qt6/QtCore/QXmlStreamEntityResolver:1,
from ../../../../src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamEntityResolver.cc:30:
/gnu/store/cg90hqvs0aq1hba1wcs7xp7fbj5qvjcs-qtbase-6.12.0/include/qt6/QtCore/qxmlstream.h:236:21: note: overridden function is ‘virtual QString QXmlStreamEntityResolver::resolveEntity(const QString&, const QString&)’
236 | virtual QString resolveEntity(const QString& publicId, const QString& systemId) final;
| ^~~~~~~~~~~~~
rm -f ../../../build-release/libklayout_lvs.so.0
rm -f ../../../build-release/libklayout_lvs.so.0.30
mv -f libklayout_lvs.so ../../../build-release/libklayout_lvs.so
mv -f libklayout_lvs.so.0 ../../../build-release/libklayout_lvs.so.0
mv -f libklayout_lvs.so.0.30 ../../../build-release/libklayout_lvs.so.0.30
Activity
klayoutmatthias commentedon Oct 17, 2026
You need to build with "--without-qt-binding". Qt bindings are only available on certain Qt versions. I don't spend the effort following up on all Qt changes.
apteryks commentedon Oct 18, 2026
OK, thank you. For the record, 6.12 is an LTS supported until 2028 IIRC; it may be worth supporting it in klayout, or alternatively not building the Qt bindings by default otherwise.
gonsolo commentedon Oct 26, 2026
I put together a fix for this: https://github.com/gonsolo/klayout/tree/qt6.12-resolveentity-fix
The following is what my little robot Claude has to say about this, I like the clang-based approach where a real C++ compiler is used for parsing.
Let me know what you think.
klayout: fix build with Qt 6.12
klayout: fix build with Qt 6.12
klayoutmatthias commentedon Oct 26, 2026
gonsolo commentedon Oct 26, 2026
If you have 30 seconds to read this comment maybe I can convince you to reconsider:
finalspecifier, so it kept generating an override for a method Qt 6.12 made illegal to override.klayoutmatthias commentedon Oct 26, 2026
Yes, I have 30 seconds, but that won't be enough to explain my decision.
Let me give you 30 minutes:
I am not against AI, but I want to use it with my prompting, not everybody to throw PRs against me recently. Maybe it took you a day to set up the patch (which is appreciated), but I will be the one to maintain your solution forever. I will be the one doing deployment and that includes super-old installations, some even with Qt4 BTW. In total, that will be much more effort than your single day. KLayout is a hobby project - the time I spend on it are my nights and weekends and often enough my sleep time. So I think I am in a position to raise some concerns on the effort side.
And please watch the language. Since AI entered the scene, statements became snobbish and preachy. "I made an effort to fix it properly .." implies that it's not done properly now. It is, but there is a reason. The way I am using the script is single-time use and that is why the code sits hidden in "scripts". A new Qt version means I am patching the script until it works with that version, and then I commit the generated headers. That's all. So "properly done" is not my main objective. The generated code is supposed to be portable across different Qt versions - currently 6.5 upwards, which means efforts have to be made to achieve this compatibility. There is more than just parsing the C++ code - there are also many decisions to drop functions not available on older Qt versions or to disable overloads that cause trouble with the interface. There is some level of ownership management built into the API through add-on declarations. All of that is not done "properly" if you like, or "good enough" as I would call it. Doing it "properly" eventually means replicating the efforts of PyQt for example, and that is not my goal. So while you dig deeper you will discover all of that.
This is not the path I like you or anyone else to follow. And I don't like AI to make that path easy for everyone else, but a nightmare for me.
That's basically why I am not looking at AI-supported patches anymore and it does not apply to this problem only.
Matthias
gonsolo commentedon Oct 26, 2026
I see.
In case you change your mind, I have a minimal 20-lines patch to fix klayout for Qt 6.12:
https://github.com/gonsolo/klayout/tree/qt6.12-minimal-fix
klayout: fix build with Qt 6.12
klayoutmatthias commentedon Nov 5, 2026
I enabled Qt 6.12, but the patch is much bigger than just fixing the "final" keyword. Goal was to provide a common code base for 6.6.1 and Qt versions upwards (tested with 6.6.1 and 6.12.0).
gonsolo commentedon Nov 5, 2026
Thanks Matthias! 🎉 I'll update the Nix package as soon as possible!