Skip to content
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

openssl: define OPENSSL_FOUND in CMakeDeps generator #12838

Merged

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Sep 5, 2022

OPENSSL_FOUND is not defined if find_package() consumes the config file from CMakeDeps (another side effect for conan-io/conan#10387). This PR fixes this issue by setting OPENSSL_FOUND to TRUE unconditionally.

I've seen this issue while trying to migrate mariadb-connector-c, its CMakeLists has a strong logic based on OPENSSL_FOUND, and it miserably fails if casing is wrong.


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the conan-center hook activated.

@ghost
Copy link

ghost commented Sep 5, 2022

I detected other pull requests that are modifying openssl/1.x.x recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@conan-center-bot

This comment has been minimized.

@SpaceIm SpaceIm force-pushed the fix/openssl-cmakedeps-variable branch from 7b4f655 to 755a0c5 Compare September 5, 2022 22:30
@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Sep 5, 2022

FYI, several recipes should be fixed the same way:
bzip2
freetype
jasper
libgeotiff
libxml2
openal
xz_utils

If they are not fixed, any recipe migrating to CMakeToolchain and depending on one of these libraries may fail (or worse, silently disable a feature and not honor an option).

@conan-center-bot
Copy link
Collaborator

All green in build 4 (755a0c5bda7871bde2372619d053e3cb4e712dc6):

  • openssl/1.1.1q@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py", line 6, in <module>
        from conans import AutoToolsBuildEnvironment, tools
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • openssl/1.1.0l@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py", line 6, in <module>
        from conans import AutoToolsBuildEnvironment, tools
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • openssl/1.1.1p@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py", line 6, in <module>
        from conans import AutoToolsBuildEnvironment, tools
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • openssl/3.0.5@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12838/recipes/openssl/3.x.x/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12838/recipes/openssl/3.x.x/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12838/recipes/openssl/3.x.x/conanfile.py", line 6, in <module>
        from conans import AutoToolsBuildEnvironment, tools
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • openssl/1.1.1o@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py", line 6, in <module>
        from conans import AutoToolsBuildEnvironment, tools
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • openssl/1.0.2u@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12838/recipes/openssl/1.x.x/conanfile.py", line 6, in <module>
        from conans import AutoToolsBuildEnvironment, tools
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • openssl/3.0.4@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12838/recipes/openssl/3.x.x/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12838/recipes/openssl/3.x.x/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12838/recipes/openssl/3.x.x/conanfile.py", line 6, in <module>
        from conans import AutoToolsBuildEnvironment, tools
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • openssl/3.0.3@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12838/recipes/openssl/3.x.x/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12838/recipes/openssl/3.x.x/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12838/recipes/openssl/3.x.x/conanfile.py", line 6, in <module>
        from conans import AutoToolsBuildEnvironment, tools
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost ghost mentioned this pull request Sep 6, 2022
4 tasks
@conan-center-bot conan-center-bot merged commit a0a72a3 into conan-io:master Sep 6, 2022
@SpaceIm SpaceIm deleted the fix/openssl-cmakedeps-variable branch September 6, 2022 13:16
ericLemanissier pushed a commit to ericLemanissier/conan-center-index that referenced this pull request Sep 26, 2022
…ator

* define OPENSSL_FOUND in CMakeDeps also

* few more conan v2 tools to satisfy hooks
jngrb added a commit to jngrb/conan-center-index that referenced this pull request Nov 25, 2022
this extends the improvements of PR conan-io#12838 done for the 1.x.x recipe
to the 3.x.x one; also there is a new 3.x.x test_package using
the CMakeDeps generator
jngrb added a commit to jngrb/conan-center-index that referenced this pull request Feb 28, 2023
this extends the improvements of PR conan-io#12838 done for the 1.x.x recipe
to the 3.x.x one; also there is a new 3.x.x test_package using
the CMakeDeps generator
jngrb added a commit to jngrb/conan-center-index that referenced this pull request Mar 5, 2023
this extends the improvements of PR conan-io#12838 done for the 1.x.x recipe
to the 3.x.x one; also there is a new 3.x.x test_package using
the CMakeDeps generator
@jngrb jngrb mentioned this pull request Mar 14, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants