-
Notifications
You must be signed in to change notification settings - Fork 138
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
Gem fails to initialize when mounted in a read-only filesystem #189
Comments
Hm. Not sure if this is possible. Because the line that crashed is https://github.com/ffi/ffi/blob/master/lib/ffi/tools/const_generator.rb#L110 and But in https://github.com/ffi/ffi/blob/master/lib/ffi/tools/const_generator.rb#L108 they already use Dir.tmpdir for the binary so I think you could open a FFI-Pullrequest to use it for Tempfile.open too |
The line that opens the file uses fcg = FFI::ConstGenerator.new(ENV['TMPDIR'] || '/tmp') do |gen| …I believe that would solve this issue. |
Hi, I had a similar issue because FFI was attempting to execute a file in the tmp Any chance to TL;DR what that binary does? edit TL;DR: gets the value of |
@ben I don't think so¹ but feel free to try it out. After all this is Ruby and you can change all the code you want. ¹The prefix of a tempfile only influences the filename as you can see in the docs I linked. |
Should be solved in the next version. See #185 |
I'm running a Rails app in Kubernetes, and the root filesystem is mounted as read-only. On startup using 0.13.0, I get an exception with this as the first few lines of the stacktrace:
Looks like between 0.12.0 and 0.13.0 there was a change that introduced the use of
FFI::ConstGenerator
, whose default initializer sets it up to write to the current directory.Could ethon initialize the ConstGenerator to use
ENV['TMPDIR'] || '/tmp'
instead of the default?The text was updated successfully, but these errors were encountered: