Skip to content

Commit

Permalink
(puppetlabsGH-2291) Enable bootsnap loadpath caching
Browse files Browse the repository at this point in the history
!feature

* **Enable bootsnap loadpath caching** ([puppetlabs#2291](puppetlabs#2291))

   Enable bootsnap loadpath caching
  • Loading branch information
jpogran authored and lucywyman committed May 24, 2021
1 parent cf1aa54 commit 05c030d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions bolt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Gem::Specification.new do |spec|

spec.add_dependency "addressable", '~> 2.5'
spec.add_dependency "aws-sdk-ec2", '~> 1'
spec.add_dependency "bootsnap", "~> 1.5"
spec.add_dependency "CFPropertyList", "~> 2.2"
spec.add_dependency "concurrent-ruby", "~> 1.0"
spec.add_dependency "ffi", "< 1.14.0"
Expand Down
15 changes: 15 additions & 0 deletions exe/bolt
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

bootsnap_enabled = ENV['BOLT_BOOTSNAP'] || false
if bootsnap_enabled
require 'bootsnap'
cache = File.join(ENV['USERPROFILE'], '.puppetlabs', 'etc', 'bolt')
Bootsnap.setup(
cache_dir: cache, # Path to your cache
development_mode: false, # Current working environment, e.g. RACK_ENV, RAILS_ENV, etc
load_path_cache: true, # Optimize the LOAD_PATH with a cache
autoload_paths_cache: false, # Optimize ActiveSupport autoloads with cache
disable_trace: false, # Set `RubyVM::InstructionSequence.compile_option = { trace_instruction: false }`
compile_cache_iseq: true, # Compile Ruby code into ISeq cache, breaks coverage reporting.
compile_cache_yaml: true # Compile YAML into a cache
)
end

require 'bolt'
require 'bolt/cli'

Expand Down

0 comments on commit 05c030d

Please sign in to comment.