rodjek / librarian-puppet

http://librarian-puppet.com
MIT License
691 stars 209 forks source link

Dependency in module overrides Puppetfile if --verbose is used. #33

Open jamezpolley opened 12 years ago

jamezpolley commented 12 years ago

My Puppetfile stipulates:

mod "sudo",
  :git => "git://github.com/saz/puppet-sudo.git",
  :ref => 'master'

One of my modules has a reference to the same module:

dependency 'saz/sudo', '>= 2.0.6'

2.0.6 is https://github.com/saz/puppet-sudo/commit/232845e698f2edc8ede0a668aed901edac1fe78f master is currently at https://github.com/saz/puppet-sudo/commit/ac5ea2127e0842e4b2514335103101b7fc600d3a - one commit after 2.0.6, and containing a vital bugfix to 2.0.6 which was broken and unuseable. I do not understand why this commit wasn't labelled 2.0.7.

But in any case, my problem is that puppet-librarian keeps reverting back to 2.0.6, which is not what I want.

Specifically, librarian-puppet update sudo --verbose will reset the sudo module to 2.0.6. librarian-puppet update sudo will update it to the latest commit on master.

I would expect that, given the summarised output below, the latest version that is >= 2.0.6 and also on master would always be chosen. I would not expect that "--verbose" should have any effect on what gets chosen.

Please note that I'm running 0.9.3, as #31 makes 0.9.4 completely unuseable for me.

Summarised output:

jpolley@puppetmaster:puppet$sudo librarian-puppet update --verbose | grep sudo
[Librarian]   [:git, "git://github.com/saz/puppet-sudo.git", {:ref=>"master"}]
[Librarian] Scheduling sudo (>= 0) <git://github.com/saz/puppet-sudo.git#master>
[Librarian]       Scheduling saz/sudo (>= 2.0.0) <http://forge.puppetlabs.com>
[Librarian]                                                                   Resolving sudo (>= 0) <git://github.com/saz/puppet-sudo.git#master>
[Librarian]                                                                       Checking sudo/0.0.1 <git://github.com/saz/puppet-sudo.git#master>
[Librarian]                                                                                                                               Resolving saz/sudo (>= 2.0.0) <http://forge.puppetlabs.com>
[Librarian]                                                                                                                                   Checking saz/sudo/2.0.6 <http://forge.puppetlabs.com>
[Librarian]                                                                                                                                     Resolved saz/sudo (>= 2.0.0) <http://forge.puppetlabs.com> at saz/sudo/2.0.6 <http://forge.puppetlabs.com>
[Librarian]                                                                                                                                 Resolved saz/sudo (>= 2.0.0) <http://forge.puppetlabs.com>
[Librarian]                                                                         Resolved sudo (>= 0) <git://github.com/saz/puppet-sudo.git#master> at sudo/0.0.1 <git://github.com/saz/puppet-sudo.git#master>
[Librarian]                                                                     Resolved sudo (>= 0) <git://github.com/saz/puppet-sudo.git#master>
[Librarian]   [:git, "git://github.com/saz/puppet-sudo.git", {:ref=>"master"}]
[Librarian] Installing sudo/0.0.1 <git://github.com/saz/puppet-sudo.git#master>
[Librarian] Deleting modules/sudo
[Librarian] Copying .tmp/librarian/cache/source/git/fea3c6aa476fc0e0257fdd836f83670f to modules/sudo
jamezpolley commented 12 years ago
One of my modules has a reference to the same module:

Actually, I don't know enough about how the names are handled, so I don't know if these two references to the sudo module are actually interpreted as being the same module or if they're handled as different modules with the same name.

Either way, I wouldn't expect that using "--verbose" would change which of the modules gets selected.

jamezpolley commented 12 years ago

FWIW, this is only half-true.

If I use --verbose, librarian reliably installs the version from forge.

If I don't use --verbose, librarian installs the version from forge about one time in three, and the version from github the rest of the time.

It sounds like it's a race condition, and the extra output generated by --verbose slows things down enough to get a predictable outcome.