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

Issue with 'automatic' compatible packages and custom package ids #16772

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions conans/client/graph/graph_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,17 @@ def _compute_package_id(self, node, default_package_id_mode, default_python_requ
default_python_requires_id_mode=
default_python_requires_id_mode)
conanfile.original_info = conanfile.info.clone()

# Call the package id before any compatibility, as the other way around
# compatibile packages will be cloned from a wrong info set. How?
# If the package id erases a few options / settings and it is done AFTER
# compatibility, the compatible packages will still look for packages
# containing those - later erased - options, settings
with conanfile_exception_formatter(str(conanfile), "package_id"):
with conan_v2_property(conanfile, 'cpp_info',
"'self.cpp_info' access in package_id() method is deprecated"):
conanfile.package_id()

if not self._cache.new_config["core.package_id:msvc_visual_incompatible"]:
msvc_compatible = conanfile.info.msvc_compatible()
if msvc_compatible:
Expand All @@ -403,12 +414,6 @@ def _compute_package_id(self, node, default_package_id_mode, default_python_requ
if apple_clang_compatible:
conanfile.compatible_packages.append(apple_clang_compatible)

# Once we are done, call package_id() to narrow and change possible values
with conanfile_exception_formatter(str(conanfile), "package_id"):
with conan_v2_property(conanfile, 'cpp_info',
"'self.cpp_info' access in package_id() method is deprecated"):
conanfile.package_id()

if hasattr(conanfile, "validate") and callable(conanfile.validate):
with conanfile_exception_formatter(str(conanfile), "validate"):
try:
Expand Down