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

Update just in mode install and don't fail if mode check for tools.system.package_manager #11712

Merged
merged 3 commits into from Jul 27, 2022

Conversation

czoido
Copy link
Contributor

@czoido czoido commented Jul 27, 2022

Changelog: Feature: Do the package manager update just in mode install and ignore if mode is check.
Docs: conan-io/docs#2663

Just checking if this may make more sense than raising an exception if mode=check and update=True because unless you use mode=install you will never check if the packages are installed.

Closes: #11706

@czoido czoido added this to the 1.51 milestone Jul 27, 2022
@czoido czoido requested a review from memsharded July 27, 2022 07:08
@czoido czoido marked this pull request as ready for review July 27, 2022 07:14
conan/tools/system/package_manager.py Outdated Show resolved Hide resolved
@czoido czoido merged commit b2ddd7a into conan-io:develop Jul 27, 2022
feltech added a commit to feltech/OpenAssetIO that referenced this pull request Jul 27, 2022
Due to a new `xorg/system` recipe, which the cpython recipe depends on,
the `conan install` step on CI (and Vagrant) fails attempting to
install system packages (i.e. `apt` packages).

This is because the `xorg/system` recipe has been refactored and will
now always try to install the latest version of system packages, even
if they are already available.

The default conan mode in this case is to only "check" if packages are
installed and throw an error if they're not found (the alternative
behaviour being to "install" if not found). However, this has a bug
(reported and hopefully fixed in
conan-io/conan#11712), whereby if the recipe has
specified to `apt-get update` (or platform-specific equivalent) before
installing, then conan always tries and throws an error if in "check"
mode.

So switch to "install" mode, which will cause a pointless
`apt-get update` followed by
> xorg/system: System requirements:  already installed
during the conan install.

Added a TODO to revisit this once conan 1.51 is released, where this
problem should be fixed.

Signed-off-by: David Feltell <david.feltell@foundry.com>
feltech added a commit to feltech/OpenAssetIO that referenced this pull request Jul 27, 2022
Due to a new `xorg/system` recipe, which the cpython recipe depends on,
the `conan install` step on CI (and Vagrant) fails attempting to
install system packages (i.e. `apt` packages).

This is because the `xorg/system` recipe has been refactored and will
now always try to install the latest version of system packages, even
if they are already available.

The default conan mode in this case is to only "check" if packages are
installed and throw an error if they're not found (the alternative
behaviour being to "install" if not found). However, this has a bug
(reported and hopefully fixed in
conan-io/conan#11712), whereby if the recipe has
specified to `apt-get update` (or platform-specific equivalent) before
installing, then conan always tries and throws an error if in "check"
mode.

So switch to "install" mode, which will cause a pointless
`apt-get update` followed by
> xorg/system: System requirements:  already installed
during the conan install.

Also extracted the list of system packages required by the latest
`xorg/system` recipe and updated the package list in our bootstrap
script.

Added a TODO to revisit this once conan 1.51 is released, where this
problem should be fixed.

Signed-off-by: David Feltell <david.feltell@foundry.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] make system_requirements error logger more informative
3 participants