Hello 👋 . I'm a maintainer for the Homebrew project. While packaging v5.4.9 we are running into a build error with Qt 6:
uic-qt6 -o ui_QtGnuplotSettings.h qtterminal/QtGnuplotSettings.ui
make[4]: uic-qt6: No such file or directory
make[4]: *** [ui_QtGnuplotSettings.h] Error 1
Relates to https://github.com/Homebrew/homebrew-core/pull/141412
I do not have direct experience with macOS or Homebrew, but perhaps this will help to diagnose or fix the problem.
The uic and moc utilities are part of the Qt internationalization support. They were fully integrated into Qt5, but seem to have been incompletely forward-ported to Qt6. To mitigate this, there is a Qt5/Qt6 compatibility subsystem Qt6Core5Compat that unfortunately does not work quite the same way as the other Qt6 subsystems. In particular it seems not to have a well-defined policy for where its components are installed. Two possible paths are provided in the pkgconfig file
The uic executable itself is installed as ${prefix}/lib64/qt6/libexec/uic
That's a little bit odd (the Qt5 uic was installed in bindir rather than libexecdir), but anyhow that's where gnuplot's configure script looks for it first.
After that it gets more idiosyncratic. In order to allow installation of both Qt5 and Qt6, there are symlinks uic-qt5 and uic-qt6. On one of my test machines these were both created in /usr/bin but on another they were created as /usr/lib64/qt5/bin/uic-qt5 and /usr/lib64/qt6/bin/uic-qt6. On the other hand, that second machine adds those .../qtX/bin directories to PATH at login, so effectively both machines make the executables available simply as "uic-qt6". So that's what the gnuplot configure script falls back to, and is apparently what is happening on your machine.
The same issue applies to
mocand torcc.So there are at least three levels at which this might be failing on your machine.
uic/moc/rcc are located in libexec, but they do not have the "-qt6" suffix, which I believe is the issue we are having.
Hmm. I take it that the libexec dir is not reported by
pkg-config --variable=libexecdir Qt6Core. If it were corretly reported, that should match gnuplot's first tested alternative. Does it fail because the Qt6Core.pc file is missing, or does pkg-config report a directory that doesn't match the actual installation path? Or is it that we need to specifically query$PKG_CONFIG --variable=libexecdir Qt6Core5Compat? IOW is there something that the configure script can do better?I am surprised that they would be installed in a top level system directory (no versioned subdirectory) with no suffix to distinguish the Qt version. Does the Homebrew environment not support having more than one Qt version installed?
I apologize if I didn't provide enough information. We do support having multiple versions of Qt installed. Here is the full path for uic with Qt 6:
#{HOMEBREW_PREFIX}/Cellar/qt/6.5.1_3/share/qt/libexec/uic#{HOMEBREW_PREFIX}is/usr/local/on Intel and/opt/homebrew/on Apple Silicon machines.OK, but how should the configure script know this?
My understanding is that the way this is supposed to work is that the script does
QT6LOC=
pkg-config --variable=libexecdirwhich in your case should result in QT6LOC=${HOMEBREW_PREFIX}/Cellar/qt/6.5.1_3/share/qt/libexec
and the configure script then sets
UIC=${QT6LOC}/uicwhich would succeed. Something in there is failing. Can we fix it?Hi, other Homebrew maintainer here. Qt6 does not ship pkgconfig files, so we run
configurewith explicit paths to the right binaries set inMOC,UICandRCC. This is working with gnuplot 5.4.8 and fails with 5.4.9. Somehow howUICvalue is not obeyed.Our full configure line is:
Last edit: FX 2023-09-06
Looking at this commit https://github.com/gnuplot/gnuplot/commit/098cd3883416e7c1617b719ac9dfa8277c5c3000#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810R1013
you can see that configure.ac was made to set
UIC=uic-qt6, even if it was defined by user, which should not be the case.Got it.
Can you confirm that this patch to the configure script would fix things for you?
That helped. We are encountering a new error now:
It figures. Same story, different Qt package. lrelease is in qttools6. OK, here's a somewhat larger patch that hopefully catches lrelease as well as the others.
Unfortunately the same error with lrelease-qt6 persists despite using this updated patch.
Are you defining LRELEASE before running ./configure, as I gather you are doing for UIC MOC and RCC? Is the lrelease binary installed somewhere outside the Qt6 hierarchy? Is QT6BIN defined but the lrelease binary is not there?
Thanks for your patience in working this out. I face the same problem that the configure script does - I don't know where to look for these things without some help from the local environment.
Stepping outside this particular issue for a moment, is there a global reason why Homebrew does not or cannot use pkg-config? Even if an upstream library does not already provide a suitable .pc file, I would have guessed it easier to create one that serves all Homebrew client packages rather than having to work through this sort of package-by-package tweaking to make up for the lack of a global solution.
Thank you for the pointer. Using the configure patch and defining the LRELEASE location fixed the issue and I was able to build gnuplot 5.4.9 successfully. Here is the final formula (package definition) including the configure patch:
Last edit: Patrick Linnane 2023-09-09