sass / sassc-ruby

Use libsass with Ruby!
MIT License
367 stars 156 forks source link

Installation via bundle fails with global gem cache enabled #215

Open captn3m0 opened 3 years ago

captn3m0 commented 3 years ago

I'm guessing this has something to do with bundler's implementation but reporting here as well.

Gemfile

source 'https://rubygems.org'
gem 'sassc'

~/.bundle/config

---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_GLOBAL_GEM_CACHE: "true"

bundle config output

bundle config
Settings are listed in order of priority. The top value will be used.
path
Set for the current user (/home/nemo/.bundle/config): "vendor/bundle"

global_gem_cache
Set for the current user (/home/nemo/.bundle/config): true

And finally, running a clean installation fails to install the .so file:

rm -rf vendor && bundle install --verbose && ls vendor/bundle/ruby/2.7.0/gems/sassc-2.4.0/ext/libsass.so
Running `bundle install --verbose` with bundler 2.1.4
Found no changes, using resolution from the lockfile
The definition is missing ["ffi-1.13.1", "sassc-2.4.0"]
HTTP GET https://index.rubygems.org/versions
HTTP 206 Partial Content https://index.rubygems.org/versions
Fetching gem metadata from https://rubygems.org/
Looking up gems ["ffi", "sassc"]
Looking up gems ["bundler", "sass", "rake"]
Looking up gems ["listen", "sass-listen"]
Looking up gems ["rb-fchange", "rb-fsevent", "rb-inotify", "rb-kqueue", "celluloid", "celluloid-io", "ruby_dep"]
Looking up gems ["timers", "facter", "celluloid-essentials", "celluloid-extras", "celluloid-fsm", "celluloid-pool", "celluloid-supervision", "dotenv", "nenv", "rspec-logsplit", "nio4r", "win32-api"]
Looking up gems ["celluloid-gems", "test-unit", "coveralls", "rubocop", "dotenv-deployment", "hitimes", "CFPropertyList", "sys-admin", "win32console", "win32-dir", "windows-api", "windows-pr", "win32-security", "hocon", "thor"]
Looking up gems ["colorize", "json", "rest-client", "simplecov", "multi_json", "term-ansicolor", "tins", "rainbow", "parser", "backports", "powerpack", "ruby-progressbar", "astrolabe", "unicode-display_width", "parallel", "jaro_winkler", "psych", "rexml", "rubocop-ast", "regexp_parser", "configuration", "mkrf", "libxml-ruby", "ffi-win32-extensions", "hoe", "power_assert"]
Looking up gems ["sync", "pattern-match", "mime-types", "rdoc", "netrc", "http-cookie", "http-accept", "simplecov-html", "docile", "lockfile", "strscan", "rubyforge", "RubyInline", "gemcutter", "sexp_processor", "ast", "slop", "jar-dependencies"]
Looking up gems ["json_pure", "ruby-maven", "ZenTest", "net-scp", "domain_name", "sqlite3", "mime-types-data"]
Looking up gems ["unf", "maven-tools", "ruby-maven-libs", "spruz", "net-ssh"]
Looking up gems ["virtus", "needle", "jruby-pageant", "bcrypt_pbkdf", "rbnacl", "rbnacl-libsodium", "unf_ext"]
Looking up gems ["descendants_tracker", "axiom-types", "coercible", "equalizer"]
Looking up gems ["thread_safe", "adamantium", "ice_nine"]
Looking up gems ["memoizable", "atomic"]
Using bundler 2.1.4
0:  bundler (2.1.4) from /usr/lib/ruby/gems/2.7.0/specifications/bundler-2.1.4.gemspec
Installing ffi 1.13.1 with native extensions
0:  ffi (1.13.1) from /home/nemo/tmp/sassc-test/vendor/bundle/ruby/2.7.0/specifications/ffi-1.13.1.gemspec
Installing sassc 2.4.0 with native extensions
0:  sassc (2.4.0) from /home/nemo/tmp/sassc-test/vendor/bundle/ruby/2.7.0/specifications/sassc-2.4.0.gemspec
Bundle complete! 1 Gemfile dependency, 3 gems now installed.
Bundled gems are installed into `./vendor/bundle`
ls: cannot access 'vendor/bundle/ruby/2.7.0/gems/sassc-2.4.0/ext/libsass.so': No such file or directory

Things I've tried:

  1. I've tried setting and unsetting the BUNDLE_FORCE_RUBY_PLATFORM configuration, but that doesn't help either.
  2. Deleting the sassc-2.4.0.gem file from the global bundle cache.
  3. Enabling other bundle configuration options (BUNDLE_DEFAULT_INSTALL_USES_PATH, BUNDLE_ALLOW_OFFLINE_INSTALL, BUNDLE_CACHE_ALL, BUNDLE_DISABLE_SHARED_GEMS etc) - nothing seems to work.

Only change that works is disabling BUNDLE_GLOBAL_GEM_CACHE - bundle decides to go for "Building native extensions" in that case as expected:

rm -rf vendor && bundle install --verbose && ls /home/nemo/tmp/sassc-test/vendor/bundle/ruby/2.7.0/gems/sassc-2.4.0/ext/libsass.so
Running `bundle install --verbose` with bundler 2.1.4
Found no changes, using resolution from the lockfile
The definition is missing ["ffi-1.13.1", "sassc-2.4.0"]
HTTP GET https://index.rubygems.org/versions
HTTP 206 Partial Content https://index.rubygems.org/versions
Fetching gem metadata from https://rubygems.org/
Looking up gems ["ffi", "sassc"]
Looking up gems ["bundler", "sass", "rake"]
Looking up gems ["listen", "sass-listen"]
Looking up gems ["rb-fchange", "rb-fsevent", "rb-inotify", "rb-kqueue", "celluloid", "celluloid-io", "ruby_dep"]
Looking up gems ["win32-api", "nio4r", "dotenv", "nenv", "rspec-logsplit", "timers", "facter", "celluloid-essentials", "celluloid-extras", "celluloid-fsm", "celluloid-pool", "celluloid-supervision"]
Looking up gems ["test-unit", "CFPropertyList", "sys-admin", "win32console", "win32-dir", "windows-api", "windows-pr", "win32-security", "hocon", "thor", "coveralls", "rubocop", "celluloid-gems", "dotenv-deployment", "hitimes"]
Looking up gems ["libxml-ruby", "term-ansicolor", "rainbow", "parser", "backports", "powerpack", "json", "ruby-progressbar", "astrolabe", "tins", "unicode-display_width", "parallel", "jaro_winkler", "psych", "rexml", "rubocop-ast", "regexp_parser", "hoe", "power_assert", "configuration", "mkrf", "ffi-win32-extensions", "colorize", "rest-client", "simplecov", "multi_json"]
Looking up gems ["pattern-match", "simplecov-html", "docile", "lockfile", "sexp_processor", "ast", "slop", "jar-dependencies", "strscan", "sync", "rubyforge", "RubyInline", "gemcutter", "mime-types", "rdoc", "netrc", "http-cookie", "http-accept"]
Looking up gems ["ZenTest", "net-scp", "json_pure", "domain_name", "sqlite3", "ruby-maven", "mime-types-data"]
Looking up gems ["net-ssh", "spruz", "maven-tools", "ruby-maven-libs", "unf"]
Looking up gems ["virtus", "unf_ext", "needle", "jruby-pageant", "bcrypt_pbkdf", "rbnacl", "rbnacl-libsodium"]
Looking up gems ["descendants_tracker", "axiom-types", "coercible", "equalizer"]
Looking up gems ["ice_nine", "thread_safe", "adamantium"]
Looking up gems ["atomic", "memoizable"]
Using bundler 2.1.4
3:  bundler (2.1.4) from /usr/lib/ruby/gems/2.7.0/specifications/bundler-2.1.4.gemspec
Fetching ffi 1.13.1
Installing ffi 1.13.1 with native extensions
Building native extensions. This could take a while...
5:  ffi (1.13.1) from /home/nemo/tmp/sassc-test/vendor/bundle/ruby/2.7.0/specifications/ffi-1.13.1.gemspec
Fetching sassc 2.4.0
Installing sassc 2.4.0 with native extensions
Building native extensions. This could take a while...
0:  sassc (2.4.0) from /home/nemo/tmp/sassc-test/vendor/bundle/ruby/2.7.0/specifications/sassc-2.4.0.gemspec
Bundle complete! 1 Gemfile dependency, 3 gems now installed.
Bundled gems are installed into `./vendor/bundle`
/home/nemo/tmp/sassc-test/vendor/bundle/ruby/2.7.0/gems/sassc-2.4.0/ext/libsass.so*
captn3m0 commented 3 years ago

System details:

ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
Bundler version 2.1.4
GNU/Linux 5.9.1-arch1-1 x86_64 

I was able to reproduce this in the ruby:2.7-slim docker image as well, after unsetting the $BUNDLE_APP_CONFIG variable. Can provide a docker image for the same if needed.