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

[bug] PremakeDeps fails in Conan v1 #14482

Open
valgur opened this issue Aug 15, 2023 · 1 comment
Open

[bug] PremakeDeps fails in Conan v1 #14482

valgur opened this issue Aug 15, 2023 · 1 comment

Comments

@valgur
Copy link
Contributor

valgur commented Aug 15, 2023

Environment details

  • Operating System+version: Windows
  • Conan version: 1.60.2 (worked without issues in 2.0.9)
  • Python version: 3.11

Steps to reproduce

  1. Add PremakeDeps(self).generate() to some recipe.
    I was trying to use it with yojimbo: migrate to Conan v2 conan-center-index#18853
  2. Run conan create on the recipe.

Logs

yojimbo/1.2.1: Calling generate()
Traceback (most recent call last):
  File "C:\Users\martin\.conan\data\yojimbo\1.2.1\_\_\export\conanfile.py", line 73, in generate
    tc.generate()
  File "C:\Users\martin\miniconda3\envs\conan1\Lib\site-packages\conan\tools\premake\premakedeps.py", line 45, in generate
    generator_files = self.content
                      ^^^^^^^^^^^^
  File "C:\Users\martin\miniconda3\envs\conan1\Lib\site-packages\conan\tools\premake\premakedeps.py", line 80, in content
    deps = _PremakeTemplate(self._get_cpp_info())
                            ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\martin\miniconda3\envs\conan1\Lib\site-packages\conan\tools\premake\premakedeps.py", line 52, in _get_cpp_info
    dep_cppinfo = dep.cpp_info.copy()
                  ^^^^^^^^^^^^^^^^^
  File "C:\Users\martin\miniconda3\envs\conan1\Lib\site-packages\conans\model\new_build_info.py", line 106, in __getattr__
    return getattr(self.components[None], attr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: '_NewComponent' object has no attribute 'copy'

Fails here:

def _get_cpp_info(self):
ret = NewCppInfo()
for dep in self._conanfile.dependencies.host.values():
dep_cppinfo = dep.cpp_info.copy()
dep_cppinfo.set_relative_base_folder(dep.package_folder)
# In case we have components, aggregate them, we do not support isolated "targets"
dep_cppinfo.aggregate_components()
ret.merge(dep_cppinfo)
return ret

@memsharded
Copy link
Member

Yes, I am afraid that PremakeDeps is not even documented in Conan 1 (https://docs.conan.io/1/reference/conanfile/tools.html), so this is not expected to work, even if it is there.

It is also not documented in Conan 2, I think this generator might still not be ready to be released, it might need more work and stabilization, but unfortunately we never had the time to invest in it (neither the expertise).

If you are interested in this generator, the recommendation would be to push it in Conan 2.0, contribute and give feedback there, until it is matured and documented.

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

No branches or pull requests

2 participants