|
5 | 5 | from conan.internal.cache.home_paths import HomePaths
|
6 | 6 | from conans.client.graph.compute_pid import run_validate_package_id
|
7 | 7 | from conans.client.loader import load_python_file
|
| 8 | +from conans.client.hook_manager import HookManager |
8 | 9 | from conan.internal.errors import conanfile_exception_formatter, scoped_traceback
|
9 | 10 | from conan.errors import ConanException
|
10 | 11 | from conans.client.migrations import CONAN_GENERATED_COMMENT
|
@@ -106,13 +107,15 @@ def _should_migrate_file(file_path):
|
106 | 107 |
|
107 | 108 | class BinaryCompatibility:
|
108 | 109 |
|
109 |
| - def __init__(self, compatibility_plugin_folder): |
| 110 | + def __init__(self, cache_folder): |
| 111 | + compatibility_plugin_folder = HomePaths(cache_folder).compatibility_plugin_path |
110 | 112 | compatibility_file = os.path.join(compatibility_plugin_folder, "compatibility.py")
|
111 | 113 | if not os.path.exists(compatibility_file):
|
112 | 114 | raise ConanException("The 'compatibility.py' plugin file doesn't exist. If you want "
|
113 | 115 | "to disable it, edit its contents instead of removing it")
|
114 | 116 | mod, _ = load_python_file(compatibility_file)
|
115 | 117 | self._compatibility = mod.compatibility
|
| 118 | + self._hook_manager = HookManager(HomePaths(cache_folder).hooks_path) |
116 | 119 |
|
117 | 120 | def compatibles(self, conanfile):
|
118 | 121 | compat_infos = []
|
@@ -143,7 +146,7 @@ def compatibles(self, conanfile):
|
143 | 146 | conanfile.settings = c.settings
|
144 | 147 | conanfile.settings_target = c.settings_target
|
145 | 148 | conanfile.options = c.options
|
146 |
| - run_validate_package_id(conanfile) |
| 149 | + run_validate_package_id(conanfile, self._hook_manager) |
147 | 150 | pid = c.package_id()
|
148 | 151 | if pid not in result and not c.invalid:
|
149 | 152 | result[pid] = c
|
|
0 commit comments