Skip to content

Commit

Permalink
feat: remove C source code from the precompile gem
Browse files Browse the repository at this point in the history
to reduce the size of the gem file. This probably will annoy people
who use local rdocs (because we also have to remove the C files from
the set of extra_rdoc_files), but let's wait and see whether people
complain.

Closes #2077.
  • Loading branch information
flavorjones committed Dec 22, 2020
1 parent b1e28f7 commit 30676cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions rakelib/cross-ruby.rake
Expand Up @@ -298,7 +298,7 @@ if java?
jruby_home = RbConfig::CONFIG['prefix']
jars = ["#{jruby_home}/lib/jruby.jar"] + FileList['lib/*.jar']

ext.gem_spec.files.reject! { |f| f =~ %r{^ext/nokogiri/} }
ext.gem_spec.files.reject! { |path| File.fnmatch?("ext/nokogiri/**", path) }

ext.ext_dir = 'ext/java'
ext.lib_dir = 'lib/nokogiri'
Expand Down Expand Up @@ -349,7 +349,9 @@ else
Nokogiri is built with the packaged libraries: #{libs}.
EOS

spec.files.reject! { |path| File.fnmatch?('ports/*', path) }
spec.extra_rdoc_files.reject! { |path| File.fnmatch?("ext/nokogiri/**", path) }
spec.files.reject! { |path| File.fnmatch?("ext/nokogiri/**", path) }
spec.files.reject! { |path| File.fnmatch?("ports/*", path) }
spec.dependencies.reject! { |dep| dep.name=='mini_portile2' }

# when pre-compiling a native gem, package all the C headers in lib/nokogiri/include:
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-gem-file-contents
Expand Up @@ -152,7 +152,7 @@ describe File.basename(gemfile) do
end

it "does not contain ext/nokogiri" do
skip "until we fix https://github.com/sparklemotion/nokogiri/issues/2077"
# https://github.com/sparklemotion/nokogiri/issues/2077
assert_empty(gemfile_contents.grep(%r{^ext/nokogiri/}))
end

Expand Down

0 comments on commit 30676cc

Please sign in to comment.