diff --git a/brakeman.gemspec b/brakeman.gemspec index 11f0b7eaf..10ec080c2 100644 --- a/brakeman.gemspec +++ b/brakeman.gemspec @@ -30,8 +30,13 @@ Gem::Specification.new do |s| s.files += Dir['bundle/ruby/*/gems/**/*'].reject do |path| # Skip unnecessary files in dependencies - path =~ /^bundle\/ruby\/\d\.\d\.\d\/gems\/[^\/]+\/(Rakefile|benchmark|bin|doc|example|man|site|spec|test)/ + path =~ /^bundle\/ruby\/\d\.\d\.\d\/gems\/[^\/]+\/(Rakefile|benchmark|bin|doc|example|man|site|spec|test)/ or + path.include? '/gems/racc' end + + # racc is not only a built-in gem, but also has native code which we cannot + # bundle with Brakeman, so leaving it as a regular dependency + s.add_dependency "racc" else Brakeman::GemDependencies.dev_dependencies(s) unless ENV['BM_PACKAGE'] Brakeman::GemDependencies.base_dependencies(s) diff --git a/build.rb b/build.rb index bbc24e018..938dabc44 100755 --- a/build.rb +++ b/build.rb @@ -13,7 +13,7 @@ f.puts "path = File.expand_path('../..', __FILE__)" Dir["bundle/ruby/**/lib"].each do |dir| - f.puts %Q[$:.unshift "\#{path}/#{dir}"] + f.puts %Q[$:.unshift "\#{path}/#{dir}"] unless dir.include? 'racc' end end diff --git a/gem_common.rb b/gem_common.rb index d5a6128b4..e1fd9e086 100644 --- a/gem_common.rb +++ b/gem_common.rb @@ -13,6 +13,7 @@ def self.base_dependencies spec spec.add_dependency "sexp_processor", "~> 4.7" spec.add_dependency "ruby2ruby", "~>2.4.0" spec.add_dependency "safe_yaml", ">= 1.0" + spec.add_dependency "racc" end def self.extended_dependencies spec