--disable-static option on TruffleRuby
See for more context.
TruffleRuby, by default, sets the
I've proposed, in https://github.com/Shopify/oracle-truffleruby-collab/issues/11, to change Nokogiri's extconf.rb to essentially follow this logic:
static_p = enable_config("static", true) # defaults to true, overridden to false by `--disable-static` if defined?(::TruffleRuby) if static_p # use system libraries - sane default to make installation easy else # use packaged libraries, built as shared objects - use the patched packaged versions, which might be hard for some systems to compile end end
Essentially, this means that the environment variable
The text was updated successfully, but these errors were encountered:
I've made a small change locally to allow overriding
With that, it's possible to install nokogiri in all 3 variants. I'm using the latest TruffleRuby nightly build.
Current default, using system libraries:
Compiling the vendored libxml2/libxslt as shared libraries:
Compiling the vendored libxml2/libxslt as static libraries (the default on CRuby):
The latter 2 include the libxml2 patches from nokogiri since they use the vendored version.
Running on Sulong might actually fix #1882, but the drawback is then libxml2/libxslt need to warm up on Sulong, which is slower than native code, and for large C libraries like those it's probably a better experience to run them natively when possible, and the flexibility from Sulong is not needed.
I think this is something that is probably best to solve on TruffleRuby or Sulong's side, where one could specify that some library dependencies should be run natively and not on Sulong, even if they have bitcode.
Regarding defaults, it seems
Between shared libraries and system libraries it's less clear.
* 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 <firstname.lastname@example.org>