Skip to content

[develop2] Improving system_requirements#12912

Merged
czoido merged 6 commits into
conan-io:develop2from
memsharded:feature/develop2_system_requirements
Jan 19, 2023
Merged

[develop2] Improving system_requirements#12912
czoido merged 6 commits into
conan-io:develop2from
memsharded:feature/develop2_system_requirements

Conversation

@memsharded

@memsharded memsharded commented Jan 17, 2023

Copy link
Copy Markdown
Member

Changelog: Fix: Improving system_requirements.

Allow collecting the system_requires of the graph:

  • In create and install commands
  • In graph info commands, without installing anything
  • Added new collect mode for system-requires
  • Decouple the installation of system_requires (doing it first) from the installation of the graph packages.

Close #5959

@memsharded memsharded added this to the 2.0.0-beta9 milestone Jan 17, 2023
Comment thread conan/tools/system/package_manager.py Outdated
if self._mode == self.mode_collect:
return

if check or self._mode == self.mode_check:

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.

@czoido I am not sure if this was a bug or on-purpose, but apt was not running checks for mode=="check"?

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 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.

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.

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):

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.

Finally did:

  • mode=check always does a check, raise if packages not found. Can be done in graph info too
  • mode=report do nothing except collect and report the system_requires. Do not check, do not raise.

Comment thread conan/cli/commands/graph.py Outdated
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":

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.

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.

@memsharded memsharded marked this pull request as ready for review January 18, 2023 12:31
@czoido czoido merged commit b7c012d into conan-io:develop2 Jan 19, 2023
@memsharded memsharded deleted the feature/develop2_system_requirements branch January 19, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants