-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Problem with native extension compilation when using a git source #41
Comments
It seems to be standard to use the
many gems use the |
Normally this is all handled by RubyGems, a gem's extconf.rb should not manually copy the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! I've got a bit of a weird issue. When I install this gem on Heroku via rubygems it works fine.
However when I install it via a git dependency it compiles the shared object to a location that causes problems.
Reproduction
Put this in the Gemfile:
When I install this on Heroku the shared object file ends up in:
This is a problem because this entire
/app/vendor/ruby-3.1.3
directory is replaced on every deploy.First deploy
So what happens is that on the first deploy Ruby is downloaded to
/app/vendor/ruby-3.1.3
and then gems are installed whereseven_zip_ruby
creates/app/vendor/ruby-3.1.3/lib/ruby/site_ruby/3.1.0/x86_64-linux/seven_zip_ruby/7z.so
and the deploy is fine. No problems.Second deploy
The next deploy, Ruby is downloaded to
/app/vendor/ruby-3.1.3
which overw-writes the shared object file. However Bundler sees that the gem is already installed so it won't try to recompile it. The release is successful but then at runtime the library cannot be loaded:Thoughts
I don't know why this only happens when using a git source via bundler and only with this gem. This line is likely the reason that the gem is installed in that location
seven_zip_ruby/ext/seven_zip_ruby/extconf.rb
Line 7 in fc29679
I also don't know why we are getting different locations when using a rubygems source versus git source.
FWIW when I install via
gem "seven_zip_ruby"
(without git) the shared objects end up in these directories:I think the directory that the gem installs to needs to be updated in
extconf.rb
but unfortunately I don't know what that directory should be. If anyone in the community knows. I would appreciate a comment.The text was updated successfully, but these errors were encountered: