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

[Tests] Fix conan install of cpython #540

Merged
merged 1 commit into from Jul 28, 2022

Conversation

feltech
Copy link
Member

@feltech feltech commented 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 failure only occurred recently due to our GitHub CI cache being busted (a separate mystery).

The primary cause of the failure 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:

    default: xorg/system: ERROR: while executing system_requirements(): Can't update because tools.system.package_manager:mode is 'check'.Please update packages manually or set 'tools.system.package_manager:mode' to 'install' in the [conf] section of the profile, or in the command line using '-c tools.system.package_manager:mode=install'
    default: ERROR: Error in system requirements

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.

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

@feltech feltech requested a review from foundrytom July 27, 2022 17:10
@feltech feltech self-assigned this 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>
Copy link
Collaborator

@foundrytom foundrytom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh, but excellent work investigating + fixing 👍 thanks @feltech.

@foundrytom foundrytom merged commit 6ad3de3 into OpenAssetIO:main Jul 28, 2022
@feltech feltech deleted the work/fixConanInstall branch July 28, 2022 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants