Skip to content
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

RUBY_STATIC=1 builds still have a dynamic dependency on libruby.so #41

Closed
coder543 opened this issue Sep 26, 2018 · 4 comments
Closed

Comments

@coder543
Copy link

The build.rs script implies that it supports static builds, but the binary that is built is definitely not static with respect to Ruby. I have a fork of ruby-sys that I was using with ruru that allows for truly static builds: https://github.com/coder543/ruby-sys/commits/master

I don't remember exactly where I found the discussions that led to the fork I made, but this is unfortunate. I want to use rutie so I can use binary Ruby strings properly... but I also can't deploy ruby gems that depend on libruby.so.

using ldd ./target/release/whatever.so it's possible to see what dynamic dependencies the executable has.

@danielpclark
Copy link
Owner

Thanks for reporting this. I'll look into it soon.

@danielpclark
Copy link
Owner

danielpclark commented Oct 3, 2018

Alright. Ruby itself did away with having a static library file available by default here: https://bugs.ruby-lang.org/issues/12845 But I've found the RVM (Ruby Version Manager), which I use currently, keeps a copy of the libruby-static.a files under .rvm/src/ruby-#.#.#/.

What this means is that we'll need to implement support for all of the different ruby version managers out there and also default installs. As I have RVM I will go ahead and implement support for it under that but we'll need other people to create PRs for adding support for the different scenarios.

danielpclark added a commit that referenced this issue Oct 3, 2018
See tracking issue #41
@danielpclark
Copy link
Owner

danielpclark commented Oct 4, 2018

I was able to get static builds to work. 3 methods in this library currently don't work with it when statically linked and it seems statically linking things makes your code run slower. A few more things to do before I merge in the updates.

@danielpclark
Copy link
Owner

Alright, static builds now work with Rutie 0.4.1. Notes have been added to build.rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants