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] self.deps_cpp_info[dependency].version is None in build() of conan v1 test package in a conan v2 recipe #11784

Closed
SpaceIm opened this issue Aug 4, 2022 · 2 comments

Comments

@SpaceIm
Copy link
Contributor

SpaceIm commented Aug 4, 2022

Environment Details (include every applicable attribute)

  • Operating System+version: macOS Monterey
  • Compiler+version: AppleClang 13
  • Conan version: 1.51.0
  • Python version: 3.9.13

Steps to reproduce (Include if Applicable)

  • create a test_v1_package of a recipe, write something like foo = tools.Version(self.deps_cpp_info[recipename].version) in build()
  • run conan create . foo/version -tf test_v1_package

see conan-io/conan-center-index#12056 for a more complex example:

  • checkout this PR
  • run conan create . abseil/20211102.0@ -tf test_v1_package

Logs (Executed commands with output) (Include/Attach if Applicable)

ERROR: abseil/20200923.3 (test package): Error in build() method, line 12
	cmake.definitions["CXX20_SUPPORTED"] = tools.Version(self.deps_cpp_info["abseil"].version) > "20210324.2"
	ConanException: Invalid version 'None'
@SpaceIm SpaceIm changed the title [bug] Regression: self.deps_cpp_info[dependency].version is None in build()` method [bug] Regression: self.deps_cpp_info[dependency].version is None in build() method Aug 4, 2022
@SpaceIm SpaceIm changed the title [bug] Regression: self.deps_cpp_info[dependency].version is None in build() method [bug] self.deps_cpp_info[dependency].version is None in build() method of test_package if non-standard folder name Aug 4, 2022
@SpaceIm
Copy link
Contributor Author

SpaceIm commented Aug 4, 2022

After further tests, it seems that it's not related to folder name.

In abseil recipe of cci master branch:

  • conan create . abseil/20211102.0@ => OK
  • rename test_package to test_v1_package then conan create . abseil/20211102.0@ -tf test_v1_package => OK

In conan-io/conan-center-index#12056:

conan create . abseil/20211102.0@ -tf test_v1_package always fails with the same error even if I change folder name to test_package, despite conanfile.py of this test package is identical to the one of master branch. It's worth noting that conan-io/conan-center-index#12056 migrates abseil recipe to conan v2, so maybe a weird interaction between a conan v2 recipe, conan create, and test_package where the class inherits from conans.ConanFile instead of conan.ConanFile?

@SpaceIm SpaceIm changed the title [bug] self.deps_cpp_info[dependency].version is None in build() method of test_package if non-standard folder name [bug] self.deps_cpp_info[dependency].version is None in build() of conan v1 test package in a conan v2 recipe Aug 4, 2022
@franramirez688 franramirez688 self-assigned this Aug 5, 2022
@franramirez688 franramirez688 added this to the 1.51.1 milestone Aug 5, 2022
@czoido
Copy link
Contributor

czoido commented Aug 8, 2022

Closed by #11790 to be released soon in 1.51.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants