Closed maxirmx closed 9 months ago
IMHO you cannot just include some precompiled files to your gem and expect that Ruby build system would not recompile them.
However, there are two approaches that work:
1) it is possible to have rakefile to "look around" and reuse binary files if rake logic decides that metioned binary files are suitable
Example: seven_zip_ruby (https://rubygems.org/gems/seven-zip)
This approach works but I would call it very tricky
2) it is possible to implement canonical Ruby extension approach and have binary packages for some or all target environments
Example (if you need it at all) https://rubygems.org/gems/emf2svg
I would be happy to suggest a PR but do not want to suggest radical changes to the make system of your gem without prior discussion Thank you
Actually it used to work fine in past. Anyway I just released ffi-compiler
v2.3.0
so now it won't recompile. If you want to force rebuild (instead of using prebuilt) then pass --build-all
flag like this gem install libmspack -- --build-all
. You can see implementation here davispuh/ffi-compiler@592f1ba64125cabccb8d2059bdd178ecba86c611 and it's quite simple.
Regarding those other approaches:
Thank you. It still recompiles but it is good. Otherwise x86_64-linux library would be used in musl environment and it probably won't work there.
It shouldn't recompile but it's expected to still see Building native extensions. This could take a while...
since ffi-compiler
is invoked unconditionally.
I wonder how your libmspack-0.11.0/ext
dir looks like
This issue has been spinned off from https://github.com/metanorma/ruby-libmspack/issues/2
Let's see what happens when I do fresh installation of libmspack gem My environment is Ubuntu-20.04; rbenv; Ruby 3.1.4
There is
Building native extensions. This could take a while...
message above, it means that some build task is executed.Now, let's inspect what jhappens during build.
You can see full rebuild