[develop2] Improving system_requirements#12912
Conversation
| if self._mode == self.mode_collect: | ||
| return | ||
|
|
||
| if check or self._mode == self.mode_check: |
There was a problem hiding this comment.
@czoido I am not sure if this was a bug or on-purpose, but apt was not running checks for mode=="check"?
There was a problem hiding this comment.
I would say it is on-purpouse as it was conceived, mode==check is the default mode and means that it won't install anything but it will check packages at most if you set that as an argument in the install method or call directly to the check method, but does not mean that it will force the check even if you set the check argument to False.
There was a problem hiding this comment.
But it has a problem, apt-get is not doing even a check, but always returning the install() packages list, because the override has different default: def install(self, packages, update=False, check=False, recommends=False):
There was a problem hiding this comment.
Finally did:
mode=checkalways does a check, raise if packages not found. Can be done ingraph infotoomode=reportdo nothing except collect and report the system_requires. Do not check, do not raise.
| conan_api.graph.analyze_binaries(deps_graph, args.build, remotes=remotes, update=args.update, | ||
| lockfile=lockfile) | ||
| print_graph_packages(deps_graph) | ||
| if profile_host.conf.get("tools.system.package_manager:mode") == "collect": |
There was a problem hiding this comment.
This is the first usage of such a conf in our code, getting it directly from profile instead of conanfile, but I don't see a strong reason to not allow it in our codebase.
Changelog: Fix: Improving system_requirements.
Allow collecting the
system_requiresof the graph:createandinstallcommandsgraph infocommands, without installing anythingcollectmode for system-requiresClose #5959