Skip to content

Fix potential None and PackageType comparison when deducing cpp_info - #19494

Merged
ErniGH merged 5 commits into
conan-io:develop2from
AbrilRBS:ar/package-type-none-comparison
Jan 22, 2026
Merged

ErniGH merged 5 commits into
conan-io:develop2from
AbrilRBS:ar/package-type-none-comparison

Conversation

@AbrilRBS

@AbrilRBS AbrilRBS commented Jan 21, 2026

Copy link
Copy Markdown
Member

Changelog: Bugfix: Avoid potential None and PackageType comparison when deducing cpp_info.
Docs: Omit

Got a question from @ErniGH about a failing code they were getting in another project, traced this to a case where:

  • You're calling deduce_full_cpp_info() - This tests uses CMakeConfigDeps, but they were calling it directly from within hook checks
  • You have more than one component defined in your recipe
  • You set the type of one of them.

The overloaded comparison for PackageType can't initialize an other value of None and breaks.


Maybe a better approach would be to re-think the check just above for header-only, as it makes little sense to me why this would only trigger after 2 components (because said branch is not taken)

@AbrilRBS AbrilRBS added this to the 2.25.0 milestone Jan 21, 2026
@AbrilRBS
AbrilRBS requested a review from ErniGH January 21, 2026 14:19
Comment thread test/integration/toolchains/cmake/cmakedeps2/test_cmakedeps.py Outdated
@AbrilRBS
AbrilRBS marked this pull request as draft January 21, 2026 14:23
@AbrilRBS
AbrilRBS marked this pull request as ready for review January 21, 2026 14:26
@ErniGH
ErniGH merged commit 1fb04e9 into conan-io:develop2 Jan 22, 2026
16 checks passed
@AbrilRBS
AbrilRBS deleted the ar/package-type-none-comparison branch January 22, 2026 15:31
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.

3 participants