conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.1k stars 960 forks source link

Cannot install qt 6.7.0 prebuilt binary on Windows #16215

Closed ABBAPOH closed 2 weeks ago

ABBAPOH commented 3 months ago

What is your question?

Hello, I am trying to install Qt prebuilt binariy on Windows. Here's my profile:

[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows

conan install --requires=qt/6.7.0


ERROR: Missing prebuilt package for 'qt/6.7.0'. You can try:
- List all available packages using 'conan list qt/6.7.0:* -r=remote'
- Explain missing binaries: replace 'conan install ...' with 'conan graph explain ...'
- Try to build locally from sources using the '--build=qt/6.7.0' argument

More Info at 'https://docs.conan.io/2/knowledge/faq.html#error-missing-prebuilt-package'

> conan graph explain --requires=qt/6.7.0

======== Closest binaries ======== qt/6.7.0 qt/6.7.0#0d41d85b2ab456f5751faa25c1554581%1712318691.56 (2024-04-05 12:04:51 UTC) qt/6.7.0#0d41d85b2ab456f5751faa25c1554581:024d8d75a587ccc6ec19a5f6e7082c608ea3527b remote: conancenter settings: Windows, x86_64, Release, msvc, 17, dynamic, Release, 193 options(diff): requires: brotli/1.1.Z, bzip2/1.0.Z, double-conversion/3.3.Z, freetype/2.13.Z, glib/2.78.Z, harfbuzz/8.3.Z, libffi/3.4.Z, libgettext/0.22.Z, libiconv/1.17.Z, libpng/1.6.Z, libpq/15.4.Z, md4c/0.4.Z, openssl/3.2.Z, pcre2/10.42.Z, sqlite3/3.45.Z, zlib/1.3.Z diff options expected: qtdeclarative=True, qtdoc=True, qttools=True, qttranslations=True existing: qtdeclarative=False, qtdoc=False, qttools=False, qttranslations=False explanation: This binary was built with the same settings, but different options

> conan graph explain --requires=qt/6.7.0 -o:h qt/*:qttools=False

======== Computing dependency graph ======== ERROR: qt/6.7.0: Error in configure() method, line 229 _enablemodule(module_name) while calling '_enablemodule', line 217 setattr(self.options, mod, True) ConanException: Incorrect attempt to modify option 'qttools' from 'False' to 'True'

Tried setting options in the conanfile.py:
def config_options(self):
    self.options["qt"].qtdeclarative = False
    self.options["qt"].qtdoc = False
    self.options["qt"].qttools = False
    self.options["qt"].qttranslations = False

Same error.
I have run out of ideas, any help appreciated.

### Have you read the CONTRIBUTING guide?

- [ ] I've read the CONTRIBUTING guide
memsharded commented 3 months ago

Hi @ABBAPOH

Thanks for your report.

I have been able to reproduce, first I also got the same "Missing binary" error, and then:

(conan2_310) λ conan graph explain --requires=qt/6.7.0 -s compiler.cppstd=17 -o qt*:qtdeclarative=False -o qt*:qtdoc=False -o qt*:qttools=False -o qt*:qttranslation=False

======== Computing dependency graph ========
ERROR: qt/6.7.0: Error in configure() method, line 229
        _enablemodule(module_name)
while calling '_enablemodule', line 217
        setattr(self.options, mod, True)
        ConanException: Incorrect attempt to modify option 'qtdeclarative' from 'False' to 'True'

This looks like a bug in the recipe in ConanCenter, not in Conan itself, I'll try to have a look.

ABBAPOH commented 3 months ago

From this comment https://github.com/conan-io/conan/issues/10104#issuecomment-982450067 it seems that one cannot modify props here https://github.com/conan-io/conan-center-index/blob/master/recipes/qt/6.x.x/conanfile.py#L215

jcar87 commented 3 months ago

Hi @ABBAPOH , thank you for reporting this. We have located the issue in the Conan Center recipe. Apologies for this - we will be more careful in the future.

glennaycock commented 3 months ago

I get the same issues with Linux. All the dependency options affect the package ID.

jcar87 commented 2 months ago

Hi @glennaycock - thanks for reporting this.

Looking to sort this out - however it's not ideal. We can set essential_modules=False for everyone, but that probably means reduced functionality Or we can set essential_modules=True, but we maintain too many qt versions and this has a severe impact on our CI.

While we address this, in the meantime:

It really does depend on what your needs are with regards to the components that qt should have been built with

jcar87 commented 3 weeks ago

@ABBAPOH , @glennaycock - this is being fixed in https://github.com/conan-io/conan-center-index/pull/24876

jcar87 commented 2 weeks ago

Should be fixed with the most recent recipe revision (might take ~20 minutes to be published).

ABBAPOH commented 2 weeks ago

I'll try take a look tonight, thanks!

ABBAPOH commented 2 weeks ago

Works for me now, thanks!