datamapper / do

DataObjects
147 stars 73 forks source link

Cannot build do_postgres anymore with jruby 1.7.0 and latest bundler: #44

Closed beoran closed 12 years ago

beoran commented 12 years ago

When I do jruby -S rake --trace install I get

rake aborted!
Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it.
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:30:in `initialize'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:14:in `install_tasks'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/do_postgres-0.10.10/Rakefile:5:in `(root)'
org/jruby/RubyKernel.java:1045:in `load'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/rake_module.rb:1:in `(root)'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `load_rakefile'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `run'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/opt/arch/jruby/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
org/jruby/RubyKernel.java:1045:in `load'
/opt/arch/jruby/jruby-1.7.0/bin/rake:23:in `(root)'

Using a plain gem install command on the gem tries to compile the native extension, so that's no solution. What to do?

dbussink commented 12 years ago

The regular gem install command does not compile the native extension:

rvm use jruby-1.7.0
gem install do_postgres
Fetching: data_objects-0.10.10.gem (100%)
Fetching: do_jdbc-0.10.10-java.gem (100%)
Fetching: do_postgres-0.10.10-java.gem (100%)
Successfully installed data_objects-0.10.10
Successfully installed do_jdbc-0.10.10-java
Successfully installed do_postgres-0.10.10-java
3 gems installed
postmodern commented 12 years ago

It seems like the Rakefile is broken under JRuby. The build and install tasks fail for me as well.

dbussink commented 12 years ago

Yeah, using it under JRuby is not supported atm, since the build process works differently anyway. It's setup in such a way that you never need to build the gems yourself for JRuby, since we provide java versions of the gems.

beoran commented 12 years ago

Where can I find these java versions then? Sorry to be confused but I couldn't find them yet.

dbussink commented 12 years ago

If you gem install under JRuby or use Bundler, it will pickup the java versions automatically.

beoran commented 12 years ago

Ah, but I have to download the gems because I'm behind some crazy restrictive firewall and a wonky connection. I guess they're somewhere on rubygems.org? OK, nevermind , I found them. It would still be nice if the build command worked also on Jruby, tough, so Ill leave this issue open for that, but feel free to close it if you think it's not essential.

dbussink commented 12 years ago

Well, the build process is much more involved, I'd probably remove the JRuby specifics in the task. The build process needs to build regular extension gems and it cross compiles binaries for both Windows and Java. That whole process is automated so releasing is just a single command.

This uses rake-compiler's cross compilation capabilities which are tricky to combine with JRuby if you also provide a C extension last time I tried.

Closing this since I don't think this is essential, maybe I'll just remove it so it's clear that it doesn't work.