spox / batali

Light weight cookbook resolver
https://spox.github.io/batali
Other
32 stars 6 forks source link

Batali fails to resolve dependencies when encountering a candidate cookbook version whose dependencies cannot be resolved #27

Closed cwjohnston closed 9 years ago

cwjohnston commented 9 years ago

Given a Batali file such as this one:

Batali.define do
  source 'https://supermarket.chef.io'
  cookbook 'varnish'
end

Batali will fail to resolve the specified dependencies:

 batali resolve -V -D
[Batali]: Loading sources... [Batali]: Loading Batali file from: /private/tmp/batali-test/Batali
[DEBUG]: Cache directory to persist cookbooks: /Users/cwj/.batali/cache
complete!
[Batali]: Loading manifest file from: /private/tmp/batali-test/batali.manifest
[DEBUG]: Logging units checksum for world addition. (`b843086ddc132ab52d4b7a94d26d0e1b7062237095051de3ec2aebc4edb6a9cd`)
[DEBUG]: Logging units checksum for world addition. (`5c22f9ca778ba5b8233fd4b22d567e3728c29a341e521a4348311cc7d1f0814e`)
[DEBUG]: Units added to world: [{"apt":"2.6.0"},{"apt":"2.5.2"},{"apt":"2.4.0"},{"apt":"2.5.3"},{"apt":"2.7.0"},{"apt":"2.5.1"},{"apt":"2.6.1"},{"apt":"2.5.0"}]
[DEBUG]: Logging units checksum for world addition. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units added to world: [{"yum":"3.1.2"},{"yum":"3.2.0"},{"yum":"3.5.4"},{"yum":"3.3.0"},{"yum":"3.1.6"},{"yum":"3.3.1"},{"yum":"3.3.2"},{"yum":"3.5.2"},{"yum":"3.0.0"},{"yum":"3.0.6"},{"yum":"3.4.1"},{"yum":"3.0.2"},{"yum":"3.4.0"},{"yum":"3.5.3"},{"yum":"3.2.4"},{"yum":"3.5.0"},{"yum":"3.5.1"},{"yum":"3.0.4"},{"yum":"3.6.0"},{"yum":"3.1.4"},{"yum":"3.1.0"},{"yum":"3.2.2"}]
[DEBUG]: Units checksum already added to world. Skipping. (`5c22f9ca778ba5b8233fd4b22d567e3728c29a341e521a4348311cc7d1f0814e`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`5c22f9ca778ba5b8233fd4b22d567e3728c29a341e521a4348311cc7d1f0814e`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`5c22f9ca778ba5b8233fd4b22d567e3728c29a341e521a4348311cc7d1f0814e`)
[DEBUG]: Logging units checksum for world addition. (`d0dff26b5983d74d070af07afd8167d7ec5d55674e2eee330b85192d7fa2a509`)
[DEBUG]: Units added to world: [{"build-essential":"2.1.0"},{"build-essential":"1.0.0"},{"build-essential":"2.2.0"},{"build-essential":"2.1.2"},{"build-essential":"1.3.4"},{"build-essential":"1.3.0"},{"build-essential":"2.2.1"},{"build-essential":"1.3.2"},{"build-essential":"2.0.2"},{"build-essential":"2.2.2"},{"build-essential":"2.2.3"},{"build-essential":"1.1.0"},{"build-essential":"1.4.0"},{"build-essential":"1.1.2"},{"build-essential":"1.4.2"},{"build-essential":"2.0.4"},{"build-essential":"2.0.0"},{"build-essential":"1.4.4"},{"build-essential":"0.7.0"},{"build-essential":"1.2.0"},{"build-essential":"1.0.2"},{"build-essential":"2.0.6"},{"build-essential":"2.1.3"}]
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Logging units checksum for world addition. (`d4d57aff191f7563242c398f89ecb33c033c9f67ab1b219865d8d76c01196cbb`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units added to world: [{"yum-epel":"0.4.0"},{"yum-epel":"0.1.4"},{"yum-epel":"0.1.6"},{"yum-epel":"0.2.0"},{"yum-epel":"0.5.0"},{"yum-epel":"0.5.1"},{"yum-epel":"0.3.0"},{"yum-epel":"0.3.2"},{"yum-epel":"0.3.4"},{"yum-epel":"0.3.6"},{"yum-epel":"0.6.0"},{"yum-epel":"0.5.3"},{"yum-epel":"0.5.2"}]
[DEBUG]: Units checksum already added to world. Skipping. (`5c22f9ca778ba5b8233fd4b22d567e3728c29a341e521a4348311cc7d1f0814e`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`5c22f9ca778ba5b8233fd4b22d567e3728c29a341e521a4348311cc7d1f0814e`)
[DEBUG]: Units checksum already added to world. Skipping. (`2147f53a4801a09b07e50ec22cc4907d82a225ec082311c67f0cc6a429a90772`)
[DEBUG]: Units checksum already added to world. Skipping. (`5c22f9ca778ba5b8233fd4b22d567e3728c29a341e521a4348311cc7d1f0814e`)
[DEBUG]: Units checksum already added to world. Skipping. (`d0dff26b5983d74d070af07afd8167d7ec5d55674e2eee330b85192d7fa2a509`)
ERROR: KeyError: Failed to locate any units loaded in system with requested name: `disable_ipv6`

I belive this is happening because universe.json lists a version of "varnish" (1.0.0) which lists an unsatisfiable dependency on "disable_ipv6".

chrisroberts commented 9 years ago

:100: Great edge case. The fix for this was applied within the solver library here: https://github.com/spox/grimoire/commit/ac4b9235f041f2c9dd5214f5c0f1fd67a19a7fd6

This also highlighted the same situation arising when running an infrastructure style resolution and a dependency is requested for a non-existent cookbook. Added in a fix for this as well which just drops the version and its dep chain: https://github.com/spox/grimoire/commit/a499343a95e657592b9fabce5f018a8f8d3e0f76

Need to add some specs on both ends to cover this and then I'll get releases pushed. Thanks for providing so much info and examples. Made this pretty quick to track down!

cwjohnston commented 9 years ago

clapping

chrisroberts commented 9 years ago

This update was released in the supporting library.