Skip to content

if the build_require not activated shouldn't fail - #9046

Merged
memsharded merged 2 commits into
conan-io:release/1.37from
memsharded:fix/cmakedeps_build_not_activated
Jun 3, 2021
Merged

memsharded merged 2 commits into
conan-io:release/1.37from
memsharded:fix/cmakedeps_build_not_activated

Conversation

@memsharded

Copy link
Copy Markdown
Member

Changelog: Fix: Do not fail in CMakeDeps when there are build_requires with same name as host requires, unless build_context_activated is enabled for those and a different suffix has not been defined.
Docs: Omit

@memsharded memsharded added this to the 1.37.1 milestone Jun 2, 2021
build_req = self._conanfile.dependencies.build_requires_build_context

# Check if the same package is at host and build and the same time
common = {r.ref.name for r in host_req}.intersection({r.ref.name for r in build_req})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be more readable and short just filtering the activated, something like:

activated_br = {r.ref.name for r in build_req if r.ref.name in self.build_context_activated}
common_names = {r.ref.name for r in host_req}.intersection(activated_br)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed, please review.

In any case, the important feedback here is if this makes sense as default behavior, or I am missing some other thing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This check? Yes, it was missing and makes perfect sense.

@memsharded
memsharded merged commit cca8d1d into conan-io:release/1.37 Jun 3, 2021
@memsharded
memsharded deleted the fix/cmakedeps_build_not_activated branch June 3, 2021 20:01
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.

2 participants