Skip to content

Commit

Permalink
feat(build): default to --disable-static on TruffleRuby
Browse files Browse the repository at this point in the history
* Shared libraries are more flexible and compile faster, see
  sparklemotion#2191 (comment)
* Static libraries can still be chosen (e.g., for testing) with:
  gem install nokogiri -- --use-system-libraries=false --enable-static

Co-authored-by: Benoit Daloze <eregontp@gmail.com>
  • Loading branch information
flavorjones and eregon committed Mar 9, 2021
1 parent 98bf3a0 commit 4a3836e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -20,6 +20,7 @@ Nokogiri follows [Semantic Versioning](https://semver.org/), please see the [REA
* Reduce the number of object allocations needed when parsing an HTML::DocumentFragment. [[#2087](https://github.com/sparklemotion/nokogiri/issues/2087)] (Thanks, [@ashmaroli](https://github.com/ashmaroli)!)
* [JRuby] Update the algorithm used to calculate `Node#line` to be wrong less-often. The underlying parser, Xerces, does not track line numbers, and so we've always used a hacky solution for this method. [[#1223](https://github.com/sparklemotion/nokogiri/issues/1223)]
* Introduce `--enable-system-libraries` and `--disable-system-libraries` flags to `extconf.rb`. These flags provide the same functionality as `--use-system-libraries` and the `NOKOGIRI_USE_SYSTEM_LIBRARIES` environment variable, but are more idiomatic. [[#2193](https://github.com/sparklemotion/nokogiri/issues/2193)] (Thanks, [@eregon](https://github.com/eregon)!)
* [TruffleRuby] `--disable-static` is used by default on TruffleRuby, when `--disable-system-libraries` is set, which is more flexible and compiles faster, see [#2191](https://github.com/sparklemotion/nokogiri/issues/2191#issuecomment-780724627). [[#2193](https://github.com/sparklemotion/nokogiri/issues/2193)] (Thanks, [@eregon](https://github.com/eregon)!)


## 1.11.1 / 2021-01-06
Expand Down
7 changes: 6 additions & 1 deletion ext/nokogiri/extconf.rb
Expand Up @@ -154,7 +154,8 @@ def config_clean?
end

def config_static?
enable_config("static", true)
default_static = !truffle?
enable_config("static", default_static)
end

def config_cross_build?
Expand Down Expand Up @@ -191,6 +192,10 @@ def nix?
!(windows? || solaris? || darwin?)
end

def truffle?
::RUBY_ENGINE == 'truffleruby'
end

def concat_flags(*args)
args.compact.join(" ")
end
Expand Down

0 comments on commit 4a3836e

Please sign in to comment.