chef install Policyfile.rb cannot resolve cookbook-specific source of supermarket
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 18
- Forks
- 23
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 1
Description
Description
If the Policyfile default_source for cookbooks is set to a local folder, this cannot be overridden using a cookbook-specific source as specified by public supermarket for example Supermarket chef-dk cookbook page:.
ChefDK Version
Chef Development Kit Version: 1.2.22
chef-client version: 12.18.31
Platform Version
Ubuntu 16.04.1 LTS (xenial)
Replication Case
chef generate repo test
cd test
gedit Policyfile.rb
name 'policyfile'
run_list 'example::default'
default_source :chef_repo, '.'
cookbook 'example'
cookbook 'chef-dk', '~> 3.1.0', :supermarket
chef install -D
Stacktrace
Building policy policyfile
Expanded run list: recipe[example::default]
Caching Cookbooks...
Error: Failed to generate Policyfile.lock
Reason: (Solve::Errors::NoSolutionError) Unable to satisfy the following requirements:
chef-dk (~> 3.1.0)required byuser-specified dependency
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/solve-3.1.0/lib/solve/ruby_solver.rb:197:in rescue in resolve_with_error_wrapping'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/solve-3.1.0/lib/solve/ruby_solver.rb:195:in resolve_with_error_wrapping'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/solve-3.1.0/lib/solve/ruby_solver.rb:75:in resolve'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/solve-3.1.0/lib/solve.rb:64:in it!'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.2.22/lib/chef-dk/policyfile_compiler.rb:182:in graph_solution'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.2.22/lib/chef-dk/policyfile_compiler.rb:127:in install'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.2.22/lib/chef-dk/policyfile_services/install.rb:98:in generate_lock_and_install'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.2.22/lib/chef-dk/policyfile_services/install.rb:62:in run'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.2.22/lib/chef-dk/command/install.rb:78:in run'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.2.22/lib/chef-dk/command/base.rb:58:in run_with_default_options'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.2.22/lib/chef-dk/cli.rb:73:in run'
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.2.22/bin/chef:25:in <top (required)>'
/usr/bin/chef:81:in load'
/usr/bin/chef:81:in
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the case with chef generate repo test and chef install -D, then inspect the Policyfile compiler and install paths named in the stack trace, especially policyfile_compiler.rb, policyfile_services/install.rb, and solve/ruby_solver.rb. Done means a local default_source can be overridden for chef-dk by its supermarket source and Policyfile.lock is generated successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100