Buster
Buster

Reputation: 715

berkshelf unable to resolve chained git dependency

C:\git\test (master) × berks --version
7.0.8

I have an issue with Berkshelf resolving chained git dependencies.

I have a test cookbook I generated to narrow down the issue, this cookbook depends on the cookbook windows-automation via a git reference.

test Berksfile

# frozen_string_literal: true
source 'https://supermarket.chef.io'

cookbook 'win-telegraf', path: '../win-telegraf/'
cookbook 'windows-automation', '~> 0.4.0', git: '[email protected]:ops/chef-windows-automation.git', branch: 'master'
# cookbook 'windows-library', '~> 0.1.0', git: '[email protected]:ops/chef-windows-library.git', branch: 'master'

metadata

test metadata.rb

depends 'win-telegraf'

depends 'windows-automation', '~> 0.4.0'
# depends 'windows-library',  '~> 0.1.0'

windows-automation depends on windows-library via another git reference

windows-automation Berksfile

source 'https://supermarket.chef.io'

metadata

cookbook 'powershell', '~> 6.1.3'
cookbook 'windows', '~> 4.2.5'

# cookbook 'windows-library', path: '../chef-windows-library'
cookbook 'windows-library', '~> 0.1.0', git: '[email protected]:ops/chef-windows-library.git', branch: 'master'

windows-automation metadata

supports 'windows'

depends 'powershell', '~> 6.1.3'
depends 'windows-library', '~> 0.1.0'

This issue comes when I try to run berks install for the test cookbook. I get the following output

C:\git\test (master) × berks install
Resolving cookbook dependencies...
Fetching 'test' from source at .
Fetching 'win-telegraf' from source at ../win-telegraf
Fetching 'windows-automation' from [email protected]:ops/chef-windows-automation.git (at master)
Fetching cookbook index from https://supermarket.chef.io...
Unable to satisfy constraints on package windows-library, which does not exist, due to solution constraint (test = 0.1.0). Solution constraints that may result in a constraint on windows-library: [(test = 0.1.0) -> (windows-automation = 0.4.0) -> (windows-library >= 0.0.0)], [(windows-automation = 0.4.0) -> (windows-library >= 0.0.0)]
Missing artifacts: windows-library
Demand that cannot be met: (test = 0.1.0)
Unable to find a solution for demands: test (0.1.0), win-telegraf (0.1.0), windows-automation (0.4.0)

This issue gets resolved if in the test cookbook I add a dependency to windows-library. But I am wondering why berkshelf cannot resolve this without the dependency. I feel like I should not need to explicitly depend on all transative git dependencies.

Upvotes: 0

Views: 256

Answers (1)

Buster
Buster

Reputation: 715

Known issue with berkshelf that is marked as wontfix.

https://github.com/berkshelf/berkshelf/issues/1829

Upvotes: 0

Related Questions