Giter Club home page Giter Club logo

Comments (1)

luislavena avatar luislavena commented on July 17, 2024

Hello @fxfactorial

I'm not a Bundler expert or understand fully your setup and what you're trying to achieve (or how this relates in any way with gem-compiler or your previous report #25), but going to try to answer.

I created an empty directory and setup, for testing, just unf_ext gem:

https://gist.github.com/luislavena/4c24c4881f071578441eb4876d064a01

With just Gemfile (no lockfile), I proceed to generate the lockfile without installing any gem:

$ ls
Gemfile

$ bundle lock
Fetching gem metadata from https://rubygems.org/.
Fetching version metadata from https://rubygems.org/
Resolving dependencies...
Writing lockfile to ~/code/_sandbox/gem-compiler-issue-26/Gemfile.lock

Inspecting the lockfile will show the contents from the gist linked above.

Now, installing the gems from the bundle:

 $ bundle install --path vendor/bundle
Fetching gem metadata from https://rubygems.org/.
Fetching version metadata from https://rubygems.org/
Using bundler 1.15.4
Fetching unf_ext 0.0.7.4
Installing unf_ext 0.0.7.4 with native extensions
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into ./vendor/bundle.

Notice Installing unf_ext 0.0.7.4 with native extensions, this means it installed the ruby platform gem (no platform in the gem) and then proceeded to compile.

Doing bundle package now will place unf_ext-0.0.7.4.gem in vendor/cache:

 $ bundle package
Using bundler 1.15.4
Using unf_ext 0.0.7.4
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Updating files in vendor/cache
  * unf_ext-0.0.7.4.gem

$ ls vendor/cache/
unf_ext-0.0.7.4.gem

Now, going to produce a native gem for my current platform (x86_64-linux) and place the precompiled version inside the cache, too:

$ gem compile vendor/cache/unf_ext-0.0.7.4.gem
Unpacking gem: 'unf_ext-0.0.7.4' in temporary directory...
Building native extensions.  This could take a while...
... lot of warnings due dependencies ...
  Successfully built RubyGem
  Name: unf_ext
  Version: 0.0.7.4
  File: unf_ext-0.0.7.4-x86_64-linux.gem

$ mv unf_ext-0.0.7.4-x86_64-linux.gem vendor/cache/

$ ls vendor/cache/
unf_ext-0.0.7.4.gem  unf_ext-0.0.7.4-x86_64-linux.gem

Next, going to remove the installed bundle (from vendor/bundle used during bundle install) and proceed to install using --local flag:

$ rm -rf vendor/bundle/

$ bundle install --local
Using bundler 1.15.4
Installing unf_ext 0.0.7.4 (x86_64-linux)
Updating files in vendor/cache
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into ./vendor/bundle.

Notice how this time the gem was not compiled but instead the pre-compiled binary was used instead.

From your report, seems you don't have the non-platform specific gem, or maybe you're just adding the platform specific (windows) to vendor/cache and not the non-precompiled one, not sure.

This is as far I can go on this since this relates more to Bundler and how it works than gem-compiler itself.

I will recommend you reach out to Bundler for support (see here)

Hope that helps.

Cheers.

from gem-compiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.