-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[package] qt/6.7.1: cannot build without system installed libclang #24729
Comments
#22997 tangentially related as it makes a libclang recipe possible,however that PR has been green for months and I'm becoming a bit disillusioned with making further contributions. |
Yes, this has been a problem for a while now but progress adding anything having to do with LLVM from community contributors tends to end up languishing. You can try commenting on #23834 perhaps to try to get something to happen, but nothing has come of that issue even with all of the interest shown. We basically also need a |
I was able to get it to build by editing the modules.yml file to make QtTranslation and QtTools not "essential". I think in lieu of getting a conan packaged libClang this might be the way to go, because in my view Qt is still useful without these "essential" features. For my own use, I'm happy to have a distro packaged Qt with all the bells and whistles. Where I need the conan build, I don't generally need the translation tools etc tbh. |
p.s. I personally do not need to build Qt with libc++. I want to build everything with libstdc++ and gcc. The only need for libclang is for the qttools module - come to think of it, another way round this problem in my particular case is to install libclang from the conda package. |
Hi @weatherhead99 , thank you for reporting this
Was there a version or revision of the recipe where you could build qt 6.7.1 without having libclang installed? if the answer is yes - I have a strong suspicion it is related to this PR: #24701 - if this was the cause, if we cannot find a trivial solution, will revert this one to its previous state
This is true, however, it should not error out if it doesn't find libclang - it displays a warning that qdoc cannot be compiled and carries on without issue. On Debian bookworm without having libclang installed in any way, I'm able to build successfully:
And the build proceeds successfully.
Indeed this is a separate bug - I have been tasked with looking after the qt recipe this week and the next, so this is in our radar. Could you post what error you are getting when you try to build qt 6.7.1 and something complains about libclang? If you are getting something like this:
it means that there is a partial installation of clang that may or may not have libclang, but it doesn't have all the development finds it needs. @weatherhead99 - if you are using a recent version of Conan 2 (I'm using 2.5.0), could you try building qt with the following conf? It can be passed without modifying the recipe, e.g:
alternatively, it can be added to the profiles. This will prevent trying to locate libclang altogether, which is only needed for qtdoc and is optional - regardless of whether there may or may not be a case for requiring libclang from a conan package, I think this falls more in the realm of recipes should disable conditionals on system instrospection. |
Hi @jcar87, Here is the error I get, when building a package which depends on qt/6.7.1 -o shared=True, using --build=missing...
then some other unrelated output I think, then:
is it possible that this is related to me using Ninja as the generator? running with the CMAKE_DISABLE_FIND_PACKAGE_WrapLibClang option, I get the below warning (expected I guess!) and then the build seems to proceed correctly.
looking at it carefully, I suppose this may be somehow related to a borked Debian package or missing package installation on the system. On this particular system I don't have root so I'm afraid I can't easily test that. I should point out perhaps that it seems that whilst I don't have libClangBasic.a on this system, I DO have a shared library install of libclang, at /usr/lib/llvm-14/lib/libclang-14.so.1 . So maybe somehow qt is asking for static libclang rather than shared libclang here... |
Thanks @weatherhead99 for following up on this! This makes more sense now. I think the reality is that Qt6 has "looked for" libclang for a while - even if the recipe never had that listes as a dependency. Most devs will get a successful build if This is generally undesirable - as that leaves it unpredictable based on system state.
What's happening in your case is that
I think Qt specifically isn't - it's the config files debian ships that seem to require this target to at least be present.
Interestingly, LLVM themselves don't recommend building it as shared libraries: https://llvm.org/docs/CMake.html and the docs still recommend this only for LLVM developers. I'd say that we should add |
Closing via #24753, thank you for reporting this. We're making an assumption that the QDoc tool is optional, and mainly useful for generating docs for Qt itself - and thus unlikely to be of much use for consumers of the qt recipe - but if this is not the case, we will of course reassess. |
Description
I can no longer build the qt recipe without installing libclang on my system. The submodule "qttools" depends on libclang,
but passing
-oqt/*:qttools=False
does not prevent building of the qttools module, because it is marked as "essential" (#24481).I understand there is not a conan recipe that contains libclang, fair enough, but there should be some way to build this without an installed libclang. I do not believe qttools actually is "essential" especially because one could also disable qtdoc and qttranslations which depend on it.
Furthermore, if a system libclang is going to be required, it should be actually in the dependencies of the conan file (i.e. via a "libclang/system" package or similar), and not implicitly assumed.
Package and Environment Details
Conan profile
Host profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu20
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux
[options]
/:shared=True
qt/*:with_x11=False
[conf]
tools.gnu:pkg_config=/usr/bin/pkg-config
Build profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu20
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux
[options]
/:shared=True
qt/*:with_x11=False
[conf]
tools.gnu:pkg_config=/usr/bin/pkg-config
Steps to reproduce
conan install qt/6.7./1@ --build=missing -oqt/:qttools=False -oqt/:qttranslations=False -oqt/*:qtdoc=False
Logs
======== Computing dependency graph ========
ERROR: qt/6.7.1: Error in configure() method, line 230
_enablemodule(module_name)
while calling '_enablemodule', line 220
_enablemodule(req)
while calling '_enablemodule', line 218
setattr(self.options, mod, True)
ConanException: Incorrect attempt to modify option 'qttools' from 'False' to 'True'
The text was updated successfully, but these errors were encountered: