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

librarian-puppet pre-emptively chooses dependency version and then perceives a "conflict", but it's caused by the early choice #125

Open
lelutin opened this issue Oct 22, 2024 · 1 comment

Comments

@lelutin
Copy link

lelutin commented Oct 22, 2024

I'm using librarian-puppet 5.0.0 from the debian package in debian sid.

I'm seeing a conflict reported by librarian-puppet that I think should not be a conflict at all (librarian-puppet should be able to resolve this by itself).

The following example will possibly not stand the test of time (maybe it will, since the second module uses a git commit hash directly?). The following Puppet file is a minimal reproducer for the issue:

forge "https://forgeapi.puppetlabs.com"

mod 'puppet/kmod'

mod 'smash/ganeti',
    :git => 'https://gitlab.com/shared-puppet-modules-group/puppet-ganeti.git',
    :commit => '393056a9e57f47be60ad15e1acfa46b963cb92a5'

when I launch librarian-puppet install --verbose with this file, I get told that there is a version conflict between puppet/kmod, which has no version restriction, and smash/ganeti which has an upper bound on the kmod module version.

What seems to be happening is that librarian-puppet first processes the line mod 'puppet/kmod' and chooses the current latest version, 4.0.1, then it processes the line mod 'smash/ganeti' and since it has already chosen the earliest version for kmod, it's unable to fulfill the requirements for ganeti. But in this situation, since there is no version restriction on kmod, librarian-puppet should be able "backtrack" and to decide to bump kmod's version down to the last version before 4.0.0 as long as that change respects all other known constraints for the version of kmod.

Here's the full output from librarian-puppet with the Puppetfile above:

$ librarian-puppet install --verbose
[Librarian] Ruby Version: 3.1.2
[Librarian] Ruby Platform: x86_64-linux-gnu
[Librarian] Rubygems Version: 3.4.20
[Librarian] Librarian Version: 0.6.4
[Librarian] Librarian Adapter: puppet
[Librarian] Librarian Adapter Version: 5.0.0
[Librarian] Project: /home/user/librarian-puppet-bug
[Librarian] Specfile: Puppetfile
[Librarian] Lockfile: Puppetfile.lock
[Librarian] Git: /usr/bin/git
[Librarian] Git Version: 2.45.2
[Librarian] Git Environment Variables:
[Librarian]   GIT_PS1_SHOWDIRTYSTATE=true
[Librarian]   GIT_PS1_SHOWSTASHSTATE=true
[Librarian]   GIT_PS1_SHOWUNTRACKEDFILES=true
[Librarian] Pre-Cached Sources:
[Librarian] Post-Cached Sources:
[Librarian]   [:forge, "https://forgeapi.puppetlabs.com", {}]
[Librarian]   [:git, "https://gitlab.com/shared-puppet-modules-group/puppet-ganeti.git", {:commit=>"393056a9e57f47be60ad15e1acfa46b963cb92a5"}]
[Librarian] Resolving puppet-kmod (>= 0) <https://forgeapi.puppetlabs.com> (from Puppetfile)
[Librarian]   Checking manifests
[Librarian]   Module puppet-kmod found versions: 4.0.1, 4.0.0, 3.2.0, 3.1.1, 3.1.0, 3.0.0
[Librarian]     Checking puppet-kmod/4.0.1 <https://forgeapi.puppetlabs.com>
[Librarian]       Resolved puppet-kmod (>= 0) <https://forgeapi.puppetlabs.com> (from Puppetfile) at puppet-kmod/4.0.1 <https://forgeapi.puppetlabs.com>
[Librarian]   Resolved puppet-kmod (>= 0) <https://forgeapi.puppetlabs.com> (from Puppetfile)
[Librarian] Resolving smash-ganeti (>= 0) <https://gitlab.com/shared-puppet-modules-group/puppet-ganeti.git#393056a9e57f47be60ad15e1acfa46b963cb92a5> (from Puppetfile)
[Librarian]   Checking manifests
[Librarian]     --- No output
[Librarian]     --- No output
[Librarian]     --- No output
[Librarian]     --- No output
[Librarian]     --> origin
[Librarian]     -->   origin/HEAD -> origin/master
[Librarian]     -->   origin/bullseye_ci
[Librarian]     -->   origin/master
[Librarian]     --> 393056a9e57f47be60ad15e1acfa46b963cb92a5
[Librarian]     --> 393056a9e57f47be60ad15e1acfa46b963cb92a5
[Librarian]     Checking smash-ganeti/1.0.8 <https://gitlab.com/shared-puppet-modules-group/puppet-ganeti.git#393056a9e57f47be60ad15e1acfa46b963cb92a5>
[Librarian]       Resolved smash-ganeti (>= 0) <https://gitlab.com/shared-puppet-modules-group/puppet-ganeti.git#393056a9e57f47be60ad15e1acfa46b963cb92a5> (from Puppetfile) at smash-ganeti/1.0.8 <https://gitlab.com/shared-puppet-modules-group/puppet-ganeti.git#393056a9e57f47be60ad15e1acfa46b963cb92a5>
[Librarian]   Resolved smash-ganeti (>= 0) <https://gitlab.com/shared-puppet-modules-group/puppet-ganeti.git#393056a9e57f47be60ad15e1acfa46b963cb92a5> (from Puppetfile)
[Librarian] Resolving puppetlabs-stdlib (>= 5.0.0, < 10.0.0) <(no source specified)> (from puppet-kmod)
[Librarian]   Checking manifests
[Librarian]   Module puppetlabs-stdlib found versions: 9.6.0, 9.5.0, 9.4.1, 9.4.0, 9.3.0, 9.2.0, 9.1.0, 9.0.0, 8.6.0, 8.5.0, 8.4.0, 8.3.0, 8.2.0, 8.1.0, 8.0.0, 7.1.0, 7.0.1, 7.0.0, 6.6.0, 6.5.0, 6.4.0, 6.3.0, 6.2.0, 6.1.0, 6.0.0, 5.2.0, 5.1.0, 5.0.0, 4.25.1, 4.25.0, 4.24.0, 4.23.0, 4.22.0, 4.21.0, 4.20.0, 4.19.0, 4.18.0, 4.17.1, 4.17.0, 4.16.0, 4.15.0, 4.14.0, 4.13.1, 4.13.0, 4.12.0, 4.11.0, 4.10.0, 4.9.1, 4.9.0, 4.8.0, 4.7.0, 4.6.0, 4.5.1, 4.5.0, 4.4.0, 4.3.2, 4.3.0, 4.2.2, 4.2.1, 4.2.0, 4.1.0, 3.2.2, 3.2.1, 3.2.0, 3.1.1, 3.1.0, 3.0.1, 3.0.0, 2.6.0, 2.5.1, 2.5.0, 2.4.0, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.1, 2.2.0, 2.1.3, 2.0.0, 1.1.0, 1.0.0, 0.1.7, 0.1.6, 0.1.5, 0.1.4, 0.1.3, 0.1.2, 0.1.1
[Librarian]     Checking puppetlabs-stdlib/9.6.0 <https://forgeapi.puppetlabs.com>
[Librarian]       Conflict between puppetlabs-stdlib/9.6.0 <https://forgeapi.puppetlabs.com> and puppetlabs-stdlib (>= 4.6.0, < 9.0.0) <https://forgeapi.puppetlabs.com> (from smash-ganeti)
[Librarian]       Backtracking from puppetlabs-stdlib/9.6.0 <https://forgeapi.puppetlabs.com>
[Librarian]     Checking puppetlabs-stdlib/9.5.0 <https://forgeapi.puppetlabs.com>
[Librarian]       Conflict between puppetlabs-stdlib/9.5.0 <https://forgeapi.puppetlabs.com> and puppetlabs-stdlib (>= 4.6.0, < 9.0.0) <https://forgeapi.puppetlabs.com> (from smash-ganeti)
[Librarian]       Backtracking from puppetlabs-stdlib/9.5.0 <https://forgeapi.puppetlabs.com>
[Librarian]     Checking puppetlabs-stdlib/9.4.1 <https://forgeapi.puppetlabs.com>
[Librarian]       Conflict between puppetlabs-stdlib/9.4.1 <https://forgeapi.puppetlabs.com> and puppetlabs-stdlib (>= 4.6.0, < 9.0.0) <https://forgeapi.puppetlabs.com> (from smash-ganeti)
[Librarian]       Backtracking from puppetlabs-stdlib/9.4.1 <https://forgeapi.puppetlabs.com>
[Librarian]     Checking puppetlabs-stdlib/9.4.0 <https://forgeapi.puppetlabs.com>
[Librarian]       Conflict between puppetlabs-stdlib/9.4.0 <https://forgeapi.puppetlabs.com> and puppetlabs-stdlib (>= 4.6.0, < 9.0.0) <https://forgeapi.puppetlabs.com> (from smash-ganeti)
[Librarian]       Backtracking from puppetlabs-stdlib/9.4.0 <https://forgeapi.puppetlabs.com>
[Librarian]     Checking puppetlabs-stdlib/9.3.0 <https://forgeapi.puppetlabs.com>
[Librarian]       Conflict between puppetlabs-stdlib/9.3.0 <https://forgeapi.puppetlabs.com> and puppetlabs-stdlib (>= 4.6.0, < 9.0.0) <https://forgeapi.puppetlabs.com> (from smash-ganeti)
[Librarian]       Backtracking from puppetlabs-stdlib/9.3.0 <https://forgeapi.puppetlabs.com>
[Librarian]     Checking puppetlabs-stdlib/9.2.0 <https://forgeapi.puppetlabs.com>
[Librarian]       Conflict between puppetlabs-stdlib/9.2.0 <https://forgeapi.puppetlabs.com> and puppetlabs-stdlib (>= 4.6.0, < 9.0.0) <https://forgeapi.puppetlabs.com> (from smash-ganeti)
[Librarian]       Backtracking from puppetlabs-stdlib/9.2.0 <https://forgeapi.puppetlabs.com>
[Librarian]     Checking puppetlabs-stdlib/9.1.0 <https://forgeapi.puppetlabs.com>
[Librarian]       Conflict between puppetlabs-stdlib/9.1.0 <https://forgeapi.puppetlabs.com> and puppetlabs-stdlib (>= 4.6.0, < 9.0.0) <https://forgeapi.puppetlabs.com> (from smash-ganeti)
[Librarian]       Backtracking from puppetlabs-stdlib/9.1.0 <https://forgeapi.puppetlabs.com>
[Librarian]     Checking puppetlabs-stdlib/9.0.0 <https://forgeapi.puppetlabs.com>
[Librarian]       Conflict between puppetlabs-stdlib/9.0.0 <https://forgeapi.puppetlabs.com> and puppetlabs-stdlib (>= 4.6.0, < 9.0.0) <https://forgeapi.puppetlabs.com> (from smash-ganeti)
[Librarian]       Backtracking from puppetlabs-stdlib/9.0.0 <https://forgeapi.puppetlabs.com>
[Librarian]     Checking puppetlabs-stdlib/8.6.0 <https://forgeapi.puppetlabs.com>
[Librarian]       Resolved puppetlabs-stdlib (>= 5.0.0, < 10.0.0) <(no source specified)> (from puppet-kmod) at puppetlabs-stdlib/8.6.0 <https://forgeapi.puppetlabs.com>
[Librarian]   Resolved puppetlabs-stdlib (>= 5.0.0, < 10.0.0) <(no source specified)> (from puppet-kmod)
[Librarian] Conflict between puppet-kmod (>= 3.0.0, < 4.0.0) <https://forgeapi.puppetlabs.com> (from smash-ganeti) and puppet-kmod/4.0.1 <https://forgeapi.puppetlabs.com>
Could not resolve the dependencies.
/usr/share/rubygems-integration/all/gems/librarianp-0.6.4/lib/librarian/action/persist_resolution_mixin.rb:11:in `persist_resolution'
/usr/share/rubygems-integration/all/gems/librarianp-0.6.4/lib/librarian/action/resolve.rb:32:in `run'
/usr/lib/ruby/vendor_ruby/librarian/puppet/action/resolve.rb:11:in `run'
/usr/lib/ruby/vendor_ruby/librarian/puppet/cli.rb:111:in `resolve!'
/usr/lib/ruby/vendor_ruby/librarian/puppet/cli.rb:68:in `install'
/usr/share/rubygems-integration/all/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
/usr/share/rubygems-integration/all/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
/usr/share/rubygems-integration/all/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
/usr/share/rubygems-integration/all/gems/thor-1.3.1/lib/thor/base.rb:584:in `start'
/usr/share/rubygems-integration/all/gems/librarianp-0.6.4/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
/usr/share/rubygems-integration/all/gems/librarianp-0.6.4/lib/librarian/cli.rb:31:in `returning_status'
/usr/share/rubygems-integration/all/gems/librarianp-0.6.4/lib/librarian/cli.rb:26:in `block in bin!'
/usr/share/rubygems-integration/all/gems/librarianp-0.6.4/lib/librarian/cli.rb:47:in `with_environment'
/usr/share/rubygems-integration/all/gems/librarianp-0.6.4/lib/librarian/cli.rb:26:in `bin!'
/usr/bin/librarian-puppet:7:in `<main>'
@lelutin
Copy link
Author

lelutin commented Oct 22, 2024

Note: In the example Puppetfile, if I move the line mod 'puppet/kmod' to the bottom of the file, librarian-puppet is then able to figure out the dependencies correctly. This shows that librarian-puppet is just tripping over its own wires.

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

No branches or pull requests

1 participant