Skip to content

Commit 03eb8d8

Browse files
committed
[GR-30240] Default to --disable-static when installing nokogiri
* nokogiri 1.11.2 defaults to --disable-static, so this is noop on recent nokogiri. * Fixes a compilation issue on older macOS for older nokogiri releases. * About 2x faster to build than without --disable-static for older nokogiri releases on macOS. (cherry picked from commit cf1e33e)
1 parent 63167f1 commit 03eb8d8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/patches/rubygems/ext/builder.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require 'rubygems/ext/builder'
2+
3+
# nokogiri 1.11.2 defaults to --disable-static, so this is noop on recent nokogiri.
4+
# This fixes a compilation issue on older macOS for older nokogiri releases (GR-30240).
5+
# About 2x faster to build than without --disable-static for older nokogiri releases on macOS.
6+
# Also gives more flexibility to control what is run natively and on Sulong.
7+
module Truffle::NokogiriDefaultBuildsArgs
8+
def initialize(*args)
9+
super
10+
11+
if @spec.name == 'nokogiri' and @build_args.empty?
12+
@build_args = ['--disable-static']
13+
end
14+
end
15+
end
16+
17+
class Gem::Ext::Builder
18+
prepend Truffle::NokogiriDefaultBuildsArgs
19+
end

0 commit comments

Comments
 (0)