mirah/pindah

jruby 1.6.8 not supported?

Closed this issue · 11 comments

pindah works fine with 1.7.2, but with 1.6.8 I get:

$ rake debug --trace
(in /home/artagnon/src/chwall2)
rake aborted!
uninitialized constant Rake::DSL
org/jruby/RubyModule.java:2647:in `const_missing'
/home/artagnon/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2
503:in `const_missing'
/home/artagnon/.ruby/gems/pindah-0.1.3.dev/lib/pindah.rb:17:in `__singleton__'
/home/artagnon/.ruby/gems/pindah-0.1.3.dev/lib/pindah.rb:16:in `Pindah'
/home/artagnon/.ruby/gems/pindah-0.1.3.dev/lib/pindah.rb:15:in `(root)'
org/jruby/RubyKernel.java:1062:in `require'
/home/artagnon/.ruby/gems/pindah-0.1.3.dev/lib/pindah.rb:60:in `require'
/home/artagnon/src/chwall2/Rakefile:2:in `(root)'
org/jruby/RubyKernel.java:1087:in `load'
/home/artagnon/src/chwall2/Rakefile:2383:in `raw_load_rakefile'
/home/artagnon/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2
017:in `load_rakefile'
/home/artagnon/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2
068:in `standard_exception_handling'
/home/artagnon/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2
016:in `load_rakefile'
/home/artagnon/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2
000:in `run'
/home/artagnon/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2
068:in `standard_exception_handling'
/home/artagnon/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1
998:in `run'
/home/artagnon/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31:i
n `(root)'
org/jruby/RubyKernel.java:1087:in `load'
/home/artagnon/.rbenv/versions/jruby-1.6.8/bin/rake:23:in `(root)'

It definitely does -- I've been working with it every day for the past few weeks.

The trick will be figuring out the diffs between your setup and mine, and opening tickets for the ones that actually cause the breakage.

This particular issue is a rake incompatibility -- Google shows the problem is pretty common.

My current working setup is:

  • JRuby 1.6.8
  • JRuby is running in 1.8 mode
  • Java 6
  • Rake 0.9.2.2

Confirmed that master + mirah 0.0.12 builds the sample project on 1.6.8, so I'm going to close this issue.

However, you've raised a bunch of great points about the out-of-the-box usability of Pindah. I'm planning to spend some of my day looking at Java 7, JRuby 1.7.2, and mirah master to see if there's a magic combination that works & make sure we're tracking the right issues to get these things working happily together.

brendan@ishmael:~/code/tmp/pt$ ruby -v
jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_39) [linux-amd64-java]
brendan@ishmael:~/code/tmp/pt$ bundle
Using rake (10.0.3) 
Using bitescript (0.1.0) 
Using mirah (0.0.12) 
Using pindah (0.1.3.dev) from git://github.com/mirah/pindah.git (at master) 
Using bundler (1.2.1) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
brendan@ishmael:~/code/tmp/pt$ b rake debug

-set-mode-check:

-set-debug-files:

-check-env:
Android SDK Tools Revision 21.0.1
Installed at /opt/google/android-sdk

-setup:
Project Name: .
Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-build-setup:
Resolving Build Target for ....
Project Target:   Android 2.1
API level:        7
WARNING: No minSdkVersion value set. Application will install on all Android versions.
----------
Creating output directories if needed...
Created dir: /home/brendan/code/tmp/pt/bin/res
Created dir: /home/brendan/code/tmp/pt/gen
Created dir: /home/brendan/code/tmp/pt/bin/classes
Created dir: /home/brendan/code/tmp/pt/bin/dexedLibs
----------
Resolving Dependencies for ....
Library dependencies:
No Libraries

------------------
API<=15: Adding annotations.jar to the classpath.
----------
Building Libraries with 'debug'...
No sub-builds to iterate on

-pre-build:

-code-gen:
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
Handling aidl files...
No AIDL files to compile.
----------
Handling RenderScript files...
No RenderScript files to compile.
----------
Handling Resources...
Generating resource IDs...
----------
Handling BuildConfig class...
Generating BuildConfig class.

-pre-compile:

javac:
Compiling 2 source files to /home/brendan/code/tmp/pt/bin/classes

-compile:
compiling Mirah source in /home/brendan/code/tmp/pt/src/. to /home/brendan/code/tmp/pt/bin/classes
Parsing...
  ./org/example/hello/HelloActivity.mirah
Inferring types...
Compiling...
  ./org/example/hello/HelloActivity.mirah
Done!

-post-compile:

-obfuscate:

-dex:
input: /home/brendan/code/tmp/pt/bin/classes
input: /opt/google/android-sdk/tools/support/annotations.jar
Pre-Dexing /opt/google/android-sdk/tools/support/annotations.jar -> annotations-5a942117b0a083f6d9a40db54e93cc2a.jar
Converting compiled files and external libraries into /home/brendan/code/tmp/pt/bin/classes.dex...
Merged dex A (7 defs/2.0KiB) with dex B (2 defs/1.1KiB). Result is 9 defs/3.1KiB. Took 0.1s

-crunch:
Crunching PNG Files in source dir: /home/brendan/code/tmp/pt/res
To destination dir: /home/brendan/code/tmp/pt/bin/res
Processing image to cache: /home/brendan/code/tmp/pt/res/drawable-hdpi/ic_launcher.png => /home/brendan/code/tmp/pt/bin/res/drawable-hdpi/ic_launcher.png
  (processed image to cache entry /home/brendan/code/tmp/pt/bin/res/drawable-hdpi/ic_launcher.png: 0% size of source)
Processing image to cache: /home/brendan/code/tmp/pt/res/drawable-ldpi/ic_launcher.png => /home/brendan/code/tmp/pt/bin/res/drawable-ldpi/ic_launcher.png
  (processed image to cache entry /home/brendan/code/tmp/pt/bin/res/drawable-ldpi/ic_launcher.png: 0% size of source)
Processing image to cache: /home/brendan/code/tmp/pt/res/drawable-mdpi/ic_launcher.png => /home/brendan/code/tmp/pt/bin/res/drawable-mdpi/ic_launcher.png
  (processed image to cache entry /home/brendan/code/tmp/pt/bin/res/drawable-mdpi/ic_launcher.png: 0% size of source)
Crunched 3 PNG files to update cache

-package-resources:
Creating full resource package...
Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.

-package:
Current build type is different than previous build: forced apkbuilder run.
Creating .-debug-unaligned.apk and signing it with a debug key...

-post-package:

-do-debug:
Running zip align on final apk...
Debug Package: /home/brendan/code/tmp/pt/bin/.-debug.apk
Creating new property file: /home/brendan/code/tmp/pt/bin/build.prop
Updating property file: /home/brendan/code/tmp/pt/bin/build.prop
Updating property file: /home/brendan/code/tmp/pt/bin/build.prop
Updating property file: /home/brendan/code/tmp/pt/bin/build.prop

-post-build:

debug:

Okay, now I have a brand new Arch Linux install (so you can't complain about broken userland/ misconfiguration). I installed apache-ant 1.8.4-1 and jdk7-openjdk 7.u13_2.3.6-1 from pacman.

$ ruby --version
jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (OpenJDK 64-Bit Server VM 1.7.0_13) [linux-amd64-java]
$ gem list --local | grep mirah
mirah (0.0.12 java)
$ gem list --local | grep pindah
pindah (0.1.3.dev)

On a fresh pindah project, I get the exact output I've listed in the original issue from rake. What am I missing?

What's your rake version?
On Feb 14, 2013 3:53 AM, "Ramkumar Ramachandra" notifications@github.com
wrote:

Okay, now I have a brand new Arch Linux install (so you can't complain
about broken userland/ misconfiguration). I installed apache-ant 1.8.4-1and jdk7-openjdk
7.u13_2.3.6-1 from pacman.

$ ruby --version
jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (OpenJDK 64-Bit Server VM 1.7.0_13) [linux-amd64-java]
$ gem list --local | grep mirah
mirah (0.0.12 java)
$ gem list --local | grep pindah
pindah (0.1.3.dev)

On a fresh pindah project, I get the exact output I've listed in the
original issue from rake. What am I missing?


Reply to this email directly or view it on GitHubhttps://github.com//issues/39#issuecomment-13544331.

0.8.7.

So like I said above, this error is because of an old rake version - afaict.

Please try it with 0.9.2.2 or newer and let me know.

I'll double check that we're specifying the correct min version.
On Feb 14, 2013 4:44 AM, "Ramkumar Ramachandra" notifications@github.com
wrote:

0.8.7.


Reply to this email directly or view it on GitHubhttps://github.com//issues/39#issuecomment-13545890.

Huh? My rake version is set in an rbenv shim.

$ rbenv global jruby-1.7.2
$ rake --version
rake, version 10.0.2
$ rbenv global jruby-1.6.8
$ rake --version
rake, version 0.8.7
$ rbenv global 1.9.3-p385
$ rake --version
rake, version 0.9.2.2

You're asking me to use the rake bundled with jruby-1.7.2 with jruby-1.6.8?
Ugh.

No, I'm asking you to gem install rake (which should update your rbenv
version, pretty sure it just uses a gem).

Or you can do what I do: use bundler. That's not part of the default
project skeleton, so I'd like to figure it out without it.
On Feb 14, 2013 5:24 AM, "Ramkumar Ramachandra" notifications@github.com
wrote:

Huh? My rake version is set in an rbenv shim.

$ rbenv global jruby-1.7.2
$ rake --version
rake, version 10.0.2
$ rbenv global jruby-1.6.8
$ rake --version
rake, version 0.8.7
$ rbenv global 1.9.3-p385
$ rake --version
rake, version 0.9.2.2

You're asking me to use the rake bundled with jruby-1.7.2 with jruby-1.6.8?
Ugh.


Reply to this email directly or view it on GitHubhttps://github.com//issues/39#issuecomment-13547164.

Ok, here's the latest on JRuby 1.6.8 + mirah 0.0.12:

I repro your issue when using rake 0.8.7. Huzzah!

Pindah now specifies the correct minimum rake version, so installing
the Pindah gem will automatically depend on an appropriate version of rake.

# this is a clean installation of jruby-1.6.8 from rbenv
brendan@flask:~/code/pindah$ ruby -v
jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_37) [darwin-x86_64-java]

brendan@flask:~/code/pindah$ gem list --local | grep rake
rake (0.8.7)

# then...
brendan@flask:~/code/pindah$ gem install mirah -v '0.0.12'
brendan@flask:~/code/pindah$ gem build pindah.gemspec 
brendan@flask:~/code/pindah$ gem install pindah-0.1.3.dev.gem 

brendan@flask:~/code/pindah$ gem list --local | grep rake
rake (10.0.3, 0.8.7)

# and
brendan@flask:~/code/pindah$ rake -V
rake, version 10.0.3

Now building works just fine:

brendan@flask:~/code/tmp/hello_world$ rake debug --trace
** Invoke debug (first_time)
** Execute debug

-set-mode-check:

-set-debug-files:

-check-env:
Android SDK Tools Revision 21.0.1
Installed at /usr/local/Cellar/android-sdk/r21.0.1

[... It works now! Yay! ...]

Brendan Ribera wrote:

No, I'm asking you to gem install rake (which should update your rbenv
version, pretty sure it just uses a gem).

Works now! For the first time, I built a non-crashing mirah
application for my Android. Thanks :)
mirah master still doesn't work though.

Yay! Reproducibility is a big step! 👯