-
-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support --disable-static
option on TruffleRuby
#2191
Comments
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.
|
Closing this issue in favor of the work at #2193 |
* 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>
See for more context.
TruffleRuby, by default, sets the
--use-system-libraries
option (via these lines in mkmf.rb). Because of how Nokogiri'sextconf.rb
is currently implemented, this setting takes precedence over other options like--disable-static
which would allow users to compile the packaged, patched versions of libxml2/libxslt and use them as shared libraries (instead of the system libraries).I've proposed, in https://github.com/Shopify/oracle-truffleruby-collab/issues/11, to change Nokogiri's extconf.rb to essentially follow this logic:
Essentially, this means that the environment variable
NOKOGIRI_USE_SYSTEM_LIBRARIES
would be presumed to be the default behavior on TruffleRuby; but allow it to be overridden.The text was updated successfully, but these errors were encountered: