-
Notifications
You must be signed in to change notification settings - Fork 988
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
[develop2] Improving system_requirements #12912
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally did:
mode=check
always does a check, raise if packages not found. Can be done ingraph info
toomode=report
do nothing except collect and report the system_requires. Do not check, do not raise.
conan/cli/commands/graph.py
Outdated
@@ -156,6 +156,8 @@ def graph_info(conan_api, parser, subparser, *args): | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_requires
of the graph:create
andinstall
commandsgraph info
commands, without installing anythingcollect
mode for system-requiresClose #5959