Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 795933 - app-admin/ansible-base-2.11.1: missing dependency 'resolvelib >= 0.5.3 < 0.6.0'
Summary: app-admin/ansible-base-2.11.1: missing dependency 'resolvelib >= 0.5.3 < 0.6.0'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
: 795954 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-06-14 10:47 UTC by Marek Szuba (RETIRED)
Modified: 2021-07-26 14:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Szuba (RETIRED) archtester gentoo-dev 2021-06-14 10:47:21 UTC
When installed on a clean stage-3 amd64 system, running ansible-galaxy fails with

ERROR! Unexpected Exception, this is probably a bug: No module named 'resolvelib'
the full traceback was:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/ansible-galaxy", line 104, in <module>
    mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
  File "/usr/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 26, in <module>
    from ansible.galaxy.collection import (
  File "/usr/lib/python3.9/site-packages/ansible/galaxy/collection/__init__.py", line 100, in <module>
    from ansible.galaxy.collection.concrete_artifact_manager import (
  File "/usr/lib/python3.9/site-packages/ansible/galaxy/collection/concrete_artifact_manager.py", line 38, in <module>
    from ansible.galaxy.dependency_resolution.dataclasses import _GALAXY_YAML
  File "/usr/lib/python3.9/site-packages/ansible/galaxy/dependency_resolution/__init__.py", line 26, in <module>
    from ansible.galaxy.dependency_resolution.providers import CollectionDependencyProvider
  File "/usr/lib/python3.9/site-packages/ansible/galaxy/dependency_resolution/providers.py", line 33, in <module>
    from resolvelib import AbstractProvider
ModuleNotFoundError: No module named 'resolvelib'

This is a new thing in 2.11.1, 2.10.7 doesn't contain the module ansible.galaxy.dependency_resolution and ansible-galaxy works.
Comment 1 Bernd Feige 2021-06-14 12:05:03 UTC
I'd add that ansible-2.11 is really badly broken for me by having no way of directly including collections that should be standard on Linux systems - such as the posix collection - not even behind a USE flag. This breaks my scripts. And then, on top of that, after finding out that yet another special package manager is supposed to be used, this bug means that it won't even work. I'll mask 2.11 until my system is no longer auto-crippled by an "update" of ansible.
Comment 2 Marek Szuba (RETIRED) archtester gentoo-dev 2021-06-14 13:16:05 UTC
*** Bug 795954 has been marked as a duplicate of this bug. ***
Comment 3 Larry the Git Cow gentoo-dev 2021-06-14 14:36:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8220319fb2840d5789b0b3ebd7e17fe2c9b4268

commit f8220319fb2840d5789b0b3ebd7e17fe2c9b4268
Author:     Matthew Thode <prometheanfire@gentoo.org>
AuthorDate: 2021-06-14 14:36:02 +0000
Commit:     Matthew Thode <prometheanfire@gentoo.org>
CommitDate: 2021-06-14 14:36:02 +0000

    app-admin/ansible: add missing dep on resolvelib
    
    Closes: https://bugs.gentoo.org/795933
    Package-Manager: Portage-3.0.18, Repoman-3.0.2
    Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>

 app-admin/ansible/ansible-2.11.1.ebuild | 1 +
 1 file changed, 1 insertion(+)
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2021-06-14 14:37:30 UTC
this bug doesn't target collections, just ansible-galaxy not working.
Comment 5 Bernd Feige 2021-06-14 14:58:49 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #4)
> this bug doesn't target collections, just ansible-galaxy not working.

I see, and I didn't mean to be rude. Thanks a lot for fixing this!
I could not find the official gentoo policy on this. I have seen some efforts to sail around custom online installers that pop up in many projects and there was even a blog post on it that I cannot find any more. Would it make sense opening a feature request asking for some collections to be installed by default?
Comment 6 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2021-06-14 15:18:57 UTC
What would be more likely to be implemented is a check to see if collections are installed and if not, ewarn the user to do so.
Comment 7 Bernd Feige 2021-06-15 10:51:51 UTC
Still fails here - any ideas?

ansible-galaxy collection install -vvv ansible.posix
ansible-galaxy [core 2.11.1] 
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/lib/python-exec/python3.9/ansible-galaxy
  python version = 3.9.5 (default, Jun  7 2021, 10:40:30) [GCC 11.1.0]
  jinja version = 3.0.1
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
Starting galaxy collection install process
Process install dependency map
ERROR! Unexpected Exception, this is probably a bug: find_matches() got an unexpected keyword argument 'identifier'
the full traceback was:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/ansible-galaxy", line 135, in <module>
    exit_code = cli.run()
  File "/usr/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 552, in run
    return context.CLIARGS['func']()
  File "/usr/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 75, in method_wrapper
    return wrapped_method(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1186, in execute_install
    self._execute_install_collection(
  File "/usr/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1213, in _execute_install_collection
    install_collections(
  File "/usr/lib/python3.9/site-packages/ansible/galaxy/collection/__init__.py", line 511, in install_collections
    dependency_map = _resolve_depenency_map(
  File "/usr/lib/python3.9/site-packages/ansible/galaxy/collection/__init__.py", line 1328, in _resolve_depenency_map
    return collection_dep_resolver.resolve(
  File "/usr/lib/python3.9/site-packages/resolvelib/resolvers.py", line 473, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.9/site-packages/resolvelib/resolvers.py", line 341, in resolve
    name, crit = self._merge_into_criterion(r, parent=None)
  File "/usr/lib/python3.9/site-packages/resolvelib/resolvers.py", line 147, in _merge_into_criterion
    matches = self._p.find_matches(
TypeError: find_matches() got an unexpected keyword argument 'identifier'
Comment 8 Marek Szuba (RETIRED) archtester gentoo-dev 2021-06-15 11:13:08 UTC
It's because it turns out Ansible requires resolvelib < 0.6.0 (I've just looked inside the source tarball and it's right there in requirements.txt) yet Matthew added 0.7.0 to the tree.
Comment 9 Larry the Git Cow gentoo-dev 2021-06-15 15:18:45 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa14c6aa3e35aa19080f2c008850cff40549ad6e

commit fa14c6aa3e35aa19080f2c008850cff40549ad6e
Author:     Matthew Thode <prometheanfire@gentoo.org>
AuthorDate: 2021-06-15 15:16:23 +0000
Commit:     Matthew Thode <prometheanfire@gentoo.org>
CommitDate: 2021-06-15 15:17:50 +0000

    app-admin/ansible: fix dep on resolvelib
    
    Closes: https://bugs.gentoo.org/795933
    Package-Manager: Portage-3.0.18, Repoman-3.0.2
    Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>

 app-admin/ansible-base/ansible-base-2.11.1.ebuild | 3 ++-
 app-admin/ansible-base/ansible-base-9999.ebuild   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
Comment 10 Sviatoslav @webknjaz Sydorenko #StandWithUkraine 2021-07-26 14:52:05 UTC
(In reply to Marek Szuba from comment #8)
> It's because it turns out Ansible requires resolvelib < 0.6.0 (I've just
> looked inside the source tarball and it's right there in requirements.txt)
> yet Matthew added 0.7.0 to the tree.

Yep. That's because v0.7.0 has breaking API changes but wasn't yet released when we merged the PR implementing the new resolver.

(In reply to Bernd Feige from comment #5)
> I could not find the official gentoo policy on this. I have seen some
> efforts to sail around custom online installers that pop up in many projects
> and there was even a blog post on it that I cannot find any more. Would it
> make sense opening a feature request asking for some collections to be
> installed by default?

I think this should be done. One would basically need to grab the collection tarballs from Galaxy and put their contents in the right place on the system. This should be easy to package and I think Fedora already has done this for some.

The package called ansible (v4+) on PyPI depends on ansible-core. It attempts to grab a snapshot of a number of collections with the content that used to "live" under ansible/ansible on GitHub and put them under site-packages. This is only necessary for the pip-managed ecosystem and OS-level package managers should implement this in a better way following their own policies.

I just want to emphasize that ansible and ansible-core are different things (and that is confusing for $reasons, I know, but I don't think we'll be renaming the core anymore). It is reasonable to have "ansible" in Gentoo do the same as "ansible" on PyPI except it shouldn't bundle stuff but rather depend on a number of separately packaged collections.

The end-users needing a slim install should use just ansible-core and a few collections that make sense for them without the stuff that they never use. The users who just used to having all-in-one thing could just use "ansible" that would pull-in all the necessary deps.