Skip to content
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

Bundle package broken after 1.7.14 #1973

Closed
etehtsea opened this Issue Sep 15, 2014 · 8 comments

Comments

Projects
None yet
3 participants
@etehtsea
Copy link
Contributor

etehtsea commented Sep 15, 2014

There is a bunch of new bundled gems in 1.7.14: descendants_tracker, thread_safe and other.
Theirs gemspecs placed in jruby-1.7.15/lib/ruby/gems/shared/specifications what breaks bundler.

Gemfile.lock

PATH
  remote: .
  specs:
    issue-repro (0.0.1)
      activesupport (~> 4.1.6)

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (4.1.6)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    i18n (0.6.11)
    json (1.8.1-java)
    minitest (5.3.3)
    rake (10.3.2)
    thread_safe (0.3.4-java)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)

PLATFORMS
  java

DEPENDENCIES
  bundler (~> 1.6)
  issue-repro!
  rake

bundle package --all

Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.11
Using json 1.8.1
Using minitest 5.3.3
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.1.6
Using bundler 1.7.3
Using issue-repro 0.0.1 from source at .
Updating files in vendor/cache
  * i18n-0.6.11.gem
  * json-1.8.1-java.gem
  * minitest-5.3.3.gem
Could not find thread_safe-0.3.4-java.gem for installation

This happens because bundler makes assumption that bundled gems's gemspecs are inside specifications/default directory.

 def builtin_gem?(spec)
  # Ruby 2.1, where all included gems have this summary
  return true if spec.summary =~ /is bundled with Ruby/
  # Ruby 2.0, where gemspecs are stored in specifications/default/
  spec.loaded_from && spec.loaded_from.include?("specifications/default/")
end
@mkristian

This comment has been minimized.

Copy link
Member

mkristian commented Sep 15, 2014

the gems are installed in jruby-1.7.15/lib/ruby/gems/shared/gems
and it is NOT a builtin_gem - call it pre-installed. the only thing which
is missing are the cached gems.

I tried to reproduce the issue with fresh jruby-1.7.15 install from a
tarball and latest bundler with thread_safe-0.3.4-java.gem as dependency.
and it installed OK.

are you using rbenv or rvm or chruby or ... ?

@mkristian

This comment has been minimized.

Copy link
Member

mkristian commented Sep 15, 2014

even bundle package --all worked with me

@etehtsea

This comment has been minimized.

Copy link
Contributor Author

etehtsea commented Sep 15, 2014

Absence of cached gems is exactly the reason of issue.

Here are gem and steps to reproduce: https://gist.github.com/etehtsea/1d0cadda39e683517d1c
Easy fix is to clear out all non-default gems after jruby install.

gem uninstall -aIx `gem list --no-versions |grep -vE 'rdoc|krypt|rake|jruby-openssl|jar-dependencies|ffi|json'`

P.S. But I don't understand - if this gems have no deps why they become pre-installed?

@mkristian

This comment has been minimized.

Copy link
Member

mkristian commented Sep 15, 2014

thanx for the gist - still works for me.

from your gist I see one thing which looks odd:

you execute all the code inside
/tmp/issue-repro

but bundler reports a warning like this

issue-repro at /private/tmp/issue-repro did not have a valid gemspec.

which is a different directory ! can this be the cause you are seeing a
different out come then me ?

@etehtsea

This comment has been minimized.

Copy link
Contributor Author

etehtsea commented Sep 15, 2014

@mkristian /tmp is a symlink on OS X
lrwxr-xr-x 1 root wheel 11 Oct 23 2013 /tmp -> private/tmp/

Did you check on fresh-installed JRuby? That's what matters.
I've sent an email to you with additional info (box credentials where I reproduced issue).

@mkristian

This comment has been minimized.

Copy link
Member

mkristian commented Sep 15, 2014

I was just looking for something which might be different. yes, I made a
fresh install from tar.gz and even updated my ruby-build to be able to
install it from there. both works for me and I found the reason on my
side: ~/.gem/jruby/1.9/cache/thread_safe-0.3.4-java.gem

my remote box of yours, does work once the gem file is in the cache folder.
so it is clear to either make default gems out of them all or have the
ruby/gems/shared/cache filled for all "pre-installed" gems.

thanx for your help ;)

@mkristian

This comment has been minimized.

Copy link
Member

mkristian commented Sep 17, 2014

thanx for reporting and helping reproduce it ;)

@etehtsea

This comment has been minimized.

Copy link
Contributor Author

etehtsea commented Sep 17, 2014

Thanks!

@enebo enebo added this to the JRuby 1.7.16 milestone Sep 25, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.