Skip to content

qt 6.10.0#247354

Closed
cho-m wants to merge 46 commits intomainfrom
qt-6.10.0
Closed

qt 6.10.0#247354
cho-m wants to merge 46 commits intomainfrom
qt-6.10.0

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Oct 8, 2025

Version bump supersedes and closes #247166


Need to re-add header symlink as current pkg-config file needs it. Don't have time right now to add a fix upstream so restoring original logic.

This impacts a few formulae which don't use CMake/QMake, e.g. octave, gnuplot, audacious

EDIT: No longer needed after


Note

Dropping below preserve_rpath changes for now as not available in brew tag. Can be done in follow up or future release.

This PR also applies new preserve_rpath as users want to use macdeployqt:

This does introduce some breakage for existing users who may now need to add RPATH to create functional binaries. QMake automatically does this, but other build systems may need some changes in build commands

Comments on PR changes:

  • Didn't add DSL to qt-* formulae as it has no impact there. Those formulae don't have frameworks.
  • Added -DQT_EXTRA_RPATHS=#{HOMEBREW_PREFIX}/lib" due to split packages needing help finding other formulae's frameworks. Using a relative path is tricky here so just using absolute to linked prefix. We were already rewriting install names so changing this to rewriting RPATHs isn't similar.

@github-actions github-actions bot added CI-linux-self-hosted Build on Linux self-hosted runner long build Set a long timeout for formula testing long dependent tests Set a long timeout for dependent testing labels Oct 8, 2025
@cho-m cho-m added CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. CI-no-fail-fast-deps Continue dependent tests despite failing GitHub Actions matrix tests. labels Oct 8, 2025
@botantony botantony mentioned this pull request Oct 8, 2025
@cho-m
Copy link
Member Author

cho-m commented Oct 8, 2025

Opened upstream https://codereview.qt-project.org/c/qt/qtbase/+/682915 for Cflags, but can keep workaround until it is reviewed. Also will likely defer removal until 6.11 and add caveat in case anyone was using.

I think adding -F should work, e.g.

clang -std=c++17 -c test.cpp -o test.o -I/opt/homebrew/lib/QtCore.framework/Headers -DQT_CORE_LIB
In file included from test.cpp:1:
/opt/homebrew/lib/QtCore.framework/Headers/QtCore:3:10: fatal error: 'QtCore/QtCoreDepends' file not found
    3 | #include <QtCore/QtCoreDepends>
      |          ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.clang -std=c++17 -c test.cpp -o test.o -F/opt/homebrew/lib -I/opt/homebrew/lib/QtCore.framework/Headers -DQT_CORE_LIBecho $?
0

@mmuetzel
Copy link

mmuetzel commented Oct 9, 2025

We are seeing similar pre-processor errors to what you described earlier when building Octave with Qt6 from Homebrew:

libtool: compile:  clang++ -std=gnu++17 -DHAVE_CONFIG_H -I. -I.. -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/opt/libpng/include/libpng16 -I/opt/homebrew/Cellar/fontconfig/2.17.1/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/opt/libpng/include/libpng16 -DOCTGUI_DLL -I/opt/homebrew/lib/QtHelp.framework/Headers -I/opt/homebrew/lib/QtHelp.framework -I/opt/homebrew/lib/QtSql.framework/Headers -I/opt/homebrew/lib/QtSql.framework -I/opt/homebrew/lib/QtNetwork.framework/Headers -I/opt/homebrew/lib/QtNetwork.framework -I/opt/homebrew/lib/QtOpenGLWidgets.framework/Headers -I/opt/homebrew/lib/QtOpenGLWidgets.framework -I/opt/homebrew/lib/QtOpenGL.framework/Headers -I/opt/homebrew/lib/QtOpenGL.framework -I/opt/homebrew/lib/QtPrintSupport.framework/Headers -I/opt/homebrew/lib/QtPrintSupport.framework -I/opt/homebrew/lib/QtWidgets.framework/Headers -I/opt/homebrew/lib/QtWidgets.framework -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtGui.framework -I/opt/homebrew/lib/QtXml.framework/Headers -I/opt/homebrew/lib/QtXml.framework -I/opt/homebrew/lib/QtCore5Compat.framework/Headers -I/opt/homebrew/lib/QtCore5Compat.framework -I/opt/homebrew/lib/QtCore.framework/Headers -I/opt/homebrew/lib/QtCore.framework -I/opt/homebrew/share/qt/mkspecs/macx-clang -I/opt/homebrew/include -I../libgui/qterminal/libqterminal -Ilibgui/src -I../libgui/src -Ilibgui/graphics -I../libgui/graphics -I../libgui/src/m-editor -Iliboctave -I../liboctave/array -Iliboctave/numeric -I../liboctave/numeric -Iliboctave/operators -I../liboctave/operators -I../liboctave/system -I../liboctave/util -Ilibinterp -I../libinterp -I../libinterp/template-inst -Ilibinterp/parse-tree -I../libinterp/parse-tree -Ilibinterp/corefcn -I../libinterp/corefcn -I../libinterp/octave-value -I../liboctave/wrappers -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/icu4c/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/opt/qt@6/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/include -fPIC -pthread -Wall -W -Wshadow -Woverloaded-virtual -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -fvisibility=hidden -O2 -g -MT libgui/src/libgui_src_la-octave-dock-widget.lo -MD -MP -MF libgui/src/.deps/libgui_src_la-octave-dock-widget.Tpo -c ../libgui/src/octave-dock-widget.cc  -fno-common -DPIC -o libgui/src/.libs/libgui_src_la-octave-dock-widget.o
In file included from ../libgui/src/news-reader.cc:32:
In file included from /opt/homebrew/lib/QtCore.framework/Headers/QDateTime:1:
/opt/homebrew/lib/QtCore.framework/Headers/qdatetime.h:8:10: fatal error: 'QtCore/qcalendar.h' file not found
#include <QtCore/qcalendar.h>
         ^~~~~~~~~~~~~~~~~~~~
In file included from ../libgui/src/main-window.cc:34:
In file included from /opt/homebrew/lib/QtGui.framework/Headers/QAction:1:
/opt/homebrew/lib/QtGui.framework/Headers/qaction.h:7:10: fatal error: 'QtGui/qtguiglobal.h' file not found
#include <QtGui/qtguiglobal.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [libgui/src/libgui_src_la-news-reader.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../libgui/src/octave-dock-widget.cc:30:
In file included from /opt/homebrew/lib/QtGui.framework/Headers/QAction:1:
/opt/homebrew/lib/QtGui.framework/Headers/qaction.h:7:10: fatal error: 'QtGui/qtguiglobal.h' file not found
#include <QtGui/qtguiglobal.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [libgui/src/libgui_src_la-octave-dock-widget.lo] Error 1
1 error generated.
make[2]: *** [libgui/src/libgui_src_la-main-window.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Error: Process completed with exit code 2.

Afaict, that is with Qt 6.9.3.

Is there a workaround that we could use intermediately? Or should we just wait for Qt 6.10.0?

Edit: Link to failed build attempt: https://github.com/gnu-octave/octave/actions/runs/18363007522/job/52310219656#step:10:4739

@cho-m
Copy link
Member Author

cho-m commented Oct 9, 2025

Is there a workaround that we could use intermediately? Or should we just wait for Qt 6.10.0?

Easiest is waiting for 6.10.0 (or I may apply my upstream patch to 6.9.3 given this PR is waiting behind Python 3.14 PR right now as we only have a single self-hosted Linux runner).

Mainly needs the -F in cflags to work without the extra symlinks, e.g. -F$(brew --prefix)/lib. I'm not sure if there is an environment variable that does this.

@cho-m
Copy link
Member Author

cho-m commented Oct 9, 2025

or I may apply my upstream patch to 6.9.3

Trying this out in

EDIT: Looks like for Octave this won't be enough as the QT_CPPFLAGS don't have -F,

QT_CFLAGS = -I/opt/homebrew/lib/QtHelp.framework/Headers -I/opt/homebrew/lib/QtHelp.framework -DQT_HELP_LIB -F/opt/homebrew/lib -I/opt/homebrew/lib/QtSql.framework/Headers -I/opt/homebrew/lib/QtSql.framework -DQT_SQL_LIB -I/opt/homebrew/lib/QtNetwork.framework/Headers -I/opt/homebrew/lib/QtNetwork.framework -DQT_NETWORK_LIB -I/opt/homebrew/lib/QtOpenGLWidgets.framework/Headers -I/opt/homebrew/lib/QtOpenGLWidgets.framework -DQT_OPENGLWIDGETS_LIB -I/opt/homebrew/lib/QtOpenGL.framework/Headers -I/opt/homebrew/lib/QtOpenGL.framework -DQT_OPENGL_LIB -I/opt/homebrew/lib/QtPrintSupport.framework/Headers -I/opt/homebrew/lib/QtPrintSupport.framework -DQT_PRINTSUPPORT_LIB -I/opt/homebrew/lib/QtWidgets.framework/Headers -I/opt/homebrew/lib/QtWidgets.framework -DQT_WIDGETS_LIB -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtGui.framework -DQT_GUI_LIB -I/opt/homebrew/lib/QtXml.framework/Headers -I/opt/homebrew/lib/QtXml.framework -DQT_XML_LIB -I/opt/homebrew/lib/QtCore5Compat.framework/Headers -I/opt/homebrew/lib/QtCore5Compat.framework -DQT_CORE5COMPAT_LIB -I/opt/homebrew/lib/QtCore.framework/Headers -I/opt/homebrew/lib/QtCore.framework -DQT_CORE_LIB -I/opt/homebrew/share/qt/mkspecs/macx-clang -I/opt/homebrew/include
QT_CPPFLAGS = -I/opt/homebrew/lib/QtHelp.framework/Headers -I/opt/homebrew/lib/QtHelp.framework -I/opt/homebrew/lib/QtSql.framework/Headers -I/opt/homebrew/lib/QtSql.framework -I/opt/homebrew/lib/QtNetwork.framework/Headers -I/opt/homebrew/lib/QtNetwork.framework -I/opt/homebrew/lib/QtOpenGLWidgets.framework/Headers -I/opt/homebrew/lib/QtOpenGLWidgets.framework -I/opt/homebrew/lib/QtOpenGL.framework/Headers -I/opt/homebrew/lib/QtOpenGL.framework -I/opt/homebrew/lib/QtPrintSupport.framework/Headers -I/opt/homebrew/lib/QtPrintSupport.framework -I/opt/homebrew/lib/QtWidgets.framework/Headers -I/opt/homebrew/lib/QtWidgets.framework -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtGui.framework -I/opt/homebrew/lib/QtXml.framework/Headers -I/opt/homebrew/lib/QtXml.framework -I/opt/homebrew/lib/QtCore5Compat.framework/Headers -I/opt/homebrew/lib/QtCore5Compat.framework -I/opt/homebrew/lib/QtCore.framework/Headers -I/opt/homebrew/lib/QtCore.framework -I/opt/homebrew/share/qt/mkspecs/macx-clang -I/opt/homebrew/include
QT_LDFLAGS = -F/opt/homebrew/lib 

The above needs a fix in Octave to get -F from pkg-config otherwise it relies on the custom symlinks that Homebrew currently provides. Would be better to avoid that so it works on other installations

@mmuetzel
Copy link

mmuetzel commented Oct 9, 2025

Thanks for looking into this.

If I'm getting this right, Octave should use the -F flags and the -I flags from the Cflags in the pkg-config file and use them for QT_CPPFLAGS. Is that correct?

Is that a general rule for the preprocessor flags on macOS (and platforms with frameworks)? Or is that only for Qt6?

@cho-m
Copy link
Member Author

cho-m commented Oct 9, 2025

If I'm getting this right, Octave should use the -F flags and the -I flags from the Cflags in the pkg-config file and use them for QT_CPPFLAGS. Is that correct?

If #247555 is merged then yes.

Currently, the -F is missing in our Qt6Core.pc


Is that a general rule for the preprocessor flags on macOS (and platforms with frameworks)? Or is that only for Qt6?

At least for macOS frameworks, the preprocessor needs to handle it separate from -I as frameworks use an odd directory structure (e.g. <FW>.framework/Headers/<H>.h would need to be found for #include "<FW>/<H>.h)

Some references not specific to this but on frameworks:

Will note that many projects don't use Frameworks (or at least in Homebrew we prefer the GNU layout if available). Qt is one of few that only offer Frameworks on macOS and don't officially install symlinks/copies of headers in traditional include directory.

@cho-m cho-m marked this pull request as draft October 9, 2025 16:22
@mmuetzel
Copy link

mmuetzel commented Oct 9, 2025

Thank you for clarifying, and for cherry-picking your change to Qt 6.9.3. 🙏

I've talked with other developers of Octave, and we decided to go with taking all Cflags from pkg-config files:
gnu-octave/octave@7fc17a4

It's currently only on the development branch of Octave. And if it causes issues somewhere, we might need to revert or adapt that change. But potentially (and if it turns out that this is all that is needed after #247555 is merged), something like that could be used by Homebrew if you need to rebuild Octave.

@cho-m
Copy link
Member Author

cho-m commented Oct 10, 2025

Will drop the symlink workaround here since no longer needed by any dependent formula. It also avoids us deviating from other installations (e.g. official, MacPorts, etc).

Also, will likely try adding macdeployqt support to qtbase by preserving original install names like @rpath/QtCore.framework/Versions/A/QtCore. Not sure yet if this will impact any existing usage of formula.

@cho-m cho-m marked this pull request as ready for review October 10, 2025 16:54
@cho-m cho-m marked this pull request as draft October 10, 2025 17:20
@cho-m
Copy link
Member Author

cho-m commented Oct 10, 2025

Actually, may just add preserve_rpaths everywhere as reverting it requires rebuilding dependents too (install name will be saved in dependent binaries).

Also want to wait for bottling jobs to slow down as GitHub API limits will cause problems for this PR.

@cho-m
Copy link
Member Author

cho-m commented Oct 10, 2025

preserve_rpath change will cause some breakage for users (i.e. binaries must have RPATH to #{HOMEBREW_PREFIX}/lib), but doesn't seem to be any great alternative based on analysis at

QMake does automatically handle this. CMake didn't, but it may be because I'm not running install. Pkg-config will need a -Wl,-rpath,... or some other alternative.


For split package, also need to add HOMEBREW_PREFIX/"lib" RPATH on macOS (difficult to calculate relative as impacts frameworks and dylibs in various locations). Not much difference for relocation given we were previously handling install_name rewrites. And in future it should have no impact for default prefix once we stop using @@HOMEBREW_PREFIX@@ placeholder in bottle

Linux should already have path in RPATH due to superenv

@cho-m cho-m added the in progress Stale bot should stay away label Oct 11, 2025
@cho-m cho-m marked this pull request as ready for review October 11, 2025 03:16
@cho-m
Copy link
Member Author

cho-m commented Oct 11, 2025

Will comment out preserve_rpath for now. Can do as follow up. I won't have time to work on this PR for a couple weeks around time of next brew release see if we can get a passing run (excluding arm64 linux)

@cho-m
Copy link
Member Author

cho-m commented Oct 14, 2025

Dependent tests were skipped as arm64 linux timed out. Need a way to ignore the result of that runner in workflow until we have a self hosted

@botantony botantony mentioned this pull request Oct 22, 2025
@daeho-ro
Copy link
Member

Is there any possibility to re-use bottle cache by re-run CI several times? Not sure about this, but just looking for a way to forward.

@botantony
Copy link
Member

qt 6.10.1 is out

@p-linnane p-linnane removed the in progress Stale bot should stay away label Dec 30, 2025
@cho-m
Copy link
Member Author

cho-m commented Jan 6, 2026

Superseding with

Will be trying a upstream commit for RPATH issue which hopefully will avoid the breakage if we switch to @rpath-install-names.

@cho-m cho-m closed this Jan 6, 2026
@github-actions github-actions bot deleted the qt-6.10.0 branch January 6, 2026 01:30
@cho-m cho-m added the superseded PR was replaced by another PR label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-linux-self-hosted Build on Linux self-hosted runner CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. CI-no-fail-fast-deps Continue dependent tests despite failing GitHub Actions matrix tests. CI-test-bot-no-concurrent-downloads Do not pass `--concurrent-downloads` to `brew test-bot`. long build Set a long timeout for formula testing long dependent tests Set a long timeout for dependent testing superseded PR was replaced by another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants