Skip to content

Commit

Permalink
Fixes to support unbundled rake use
Browse files Browse the repository at this point in the history
We're using Bundler::GemHelper without requiring it

We're requiring `lib/chef/dist.rb` which requires files out
of `chef-config/lib/chef-config` which will escape into the
main fileset if we don't push that libdir on there.

(Also:  all of `lib/chef/dist.rb` and
`chef-config/lib/chef-config/dist.rb` needs to be pushed into
chef-utils and reading values into `lib/chef/dist.rb` from
the Chef::Config itself seems like the wrong flow of information)

Signed-off-by: Lamont Granquist <[email protected]>
  • Loading branch information
lamont-granquist committed Apr 28, 2020
1 parent 87eb453 commit 01fc4a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
# limitations under the License.
#

# we need this to resolve files required by lib/chef/dist
$LOAD_PATH.unshift(File.expand_path("../chef-config/lib", __FILE__))

begin
require_relative "tasks/rspec"
require_relative "tasks/dependencies"
Expand All @@ -27,6 +30,8 @@ rescue LoadError => e
puts "Skipping missing rake dep: #{e}"
end

require "bundler/gem_helper"

ENV["CHEF_LICENSE"] = "accept-no-persist"

# hack the chef-config install to run before the traditional install task
Expand Down
2 changes: 2 additions & 0 deletions chef-bin/Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# we need to force the install in order to overwrite the binstubs from
# old chef gems.

require "bundler/gem_helper"

Bundler::GemHelper.install_tasks

# this is necessary to use to overwrite any chef-14 or earlier era gem which has the bin files in
Expand Down

0 comments on commit 01fc4a0

Please sign in to comment.