mirah / pindah

Tools for building Android applications with Mirah
Apache License 2.0
228 stars 27 forks source link

Compile exception: API 4.2 #37

Closed artagnon closed 11 years ago

artagnon commented 11 years ago

When I try to compile the template application:

-set-mode-check:

-set-debug-files:

-check-env:
Android SDK Tools Revision 21.0.1
Installed at /home/artagnon/.android/sdk

-setup:
Project Name: chwall2
Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-build-setup:
Resolving Build Target for chwall2...
Project Target:   Android 4.2
API level:        17
WARNING: No minSdkVersion value set. Application will install on all Android versions.
----------
Creating output directories if needed...
----------
Resolving Dependencies for chwall2...
Library dependencies:
No Libraries
----------
Building Libraries with 'debug'...
No sub-builds to iterate on

-pre-build:

-code-gen:
No changes in the AndroidManifest files.
Handling aidl files...
No AIDL files to compile.
----------
Handling RenderScript files...
No RenderScript files to compile.
----------
Handling Resources...
No changed resources. R.java and Manifest.java untouched.
----------
Handling BuildConfig class...
Generating BuildConfig class.

-pre-compile:

javac:
Compiling 2 source files to /home/artagnon/src/chwall2/bin/classes

-compile:
compiling Mirah source in /home/artagnon/src/chwall2/src/. to /home/artagnon/src/chwall2/b
in/classes
Exception in thread "Thread-4" java.lang.ExceptionInInitializerError
        at org.mirah.ant.Compile$__xform_tmp_13.run(compile.mirah:66)
        at java.lang.Thread.run(Thread.java:722)
Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `start_wi
th?' for #<Java::OrgJrubyAstJava_signature::ArrayTypeNode:0x53d8a2b3>
        at RUBY.as_java_type(/home/artagnon/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/jr
uby/compiler/java_signature.rb:20)
        at RUBY.parameters(/home/artagnon/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/jrub
y/compiler/java_signature.rb:48)
        at RUBY.each(file:/home/artagnon/.rbenv/versions/jruby-1.7.2/lib/jruby.jar!/jruby/
java/java_ext/java.util.rb:7)
        at org.jruby.RubyEnumerable.map(org/jruby/RubyEnumerable.java:718)
        at RUBY.parameters(/home/artagnon/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/jrub
y/compiler/java_signature.rb:48)
        at RUBY.types(/home/artagnon/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/jruby/com
piler/java_signature.rb:54)
        at RUBY.java_signature(/home/artagnon/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/
jruby/core_ext/class.rb:44)
        at RUBY.MirahCommand(src/org/mirah/mirah_command.rb:25)
        at RUBY.(root)(src/org/mirah/mirah_command.rb:22)
        at org.mirah.ant.Compile$__xform_tmp_13.run(compile.mirah:66)
abscondment commented 11 years ago

Have you tried this with Mirah 0.0.12 and the latest Pindah from Git?

This currently works for me under the following configurations:

I want to resolve #28 & ship this latest version of Pindah, but I want to make sure folks can work with it too. Let me know.

artagnon commented 11 years ago

Brendan Ribera wrote:

Have you tried this with Mirah 0.0.12 and the latest Pindah from Git?

Sorry about the delay. I just got myself a brand new Arch Linux install.

This currently works for me under the following configurations:

Java 6/7, JRuby 1.6.8, Mirah 0.0.12, Pindah from master

Nope. I've left a comment on #39.

Java 6/7, JRuby 1.7.2, Mirah built from local master, Pindah from master (Mirah build is finicky right now)

Nope, doesn't work. What am I missing?

$ rake -T --trace
rake aborted!
cannot load Java class org.mirah.macros.Macro
org/jruby/javasupport/JavaClass.java:1227:in `for_name'
org/jruby/javasupport/JavaUtilities.java:34:in `get_proxy_class'
file:/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/jruby.jar!/jruby/java/core_ext/object.rb:26:in

java_import' org/jruby/RubyArray.java:2361:inmap' file:/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/jruby.jar!/jruby/java/core_ext/object.rb:22:in java_import' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform/ast_ext.rb:5:in AST' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform/ast_ext.rb:2:in Mirah' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform/ast_ext.rb:1:in (root)' org/jruby/RubyKernel.java:1027:in require' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:36:in require' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform.rb:1:in (root)' org/jruby/RubyKernel.java:1027:inrequire' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:36:in require' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform.rb:21:in (root)' org/jruby/RubyKernel.java:1027:in require' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:36:in require' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah.rb:1:in (root)' org/jruby/RubyKernel.java:1027:inrequire' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:60:in require' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:55:in require' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah.rb:26:in (root)' org/jruby/RubyKernel.java:1046:inload' /home/artagnon/.ruby/gems/pindah-0.1.3.dev/lib/pindah.rb:1:in (root)' /home/artagnon/.ruby/gems/pindah-0.1.3.dev/lib/pindah.rb:14:in(root)' /home/artagnon/src/chwall/Rakefile:1:in (root)' /home/artagnon/src/chwall/Rakefile:2:in(root)' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/rake_module.rb:1:in (root)' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in load_rakefile' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/application.rb:581:in raw_load_rakefile' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/application.rb:87:in load_rakefile' /home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/application.rb:158:in standard_exception_handling' org/jruby/RubyKernel.java:1046:inload' /home/artagnon/.rbenv/versions/jruby-1.7.2/bin/rake:23:in `(root)'

abscondment commented 11 years ago

How did you build/install Mirah from master? On Feb 14, 2013 4:06 AM, "Ramkumar Ramachandra" notifications@github.com wrote:

Brendan Ribera wrote:

Have you tried this with Mirah 0.0.12 and the latest Pindah from Git?

Sorry about the delay. I just got myself a brand new Arch Linux install.

This currently works for me under the following configurations:

Java 6/7, JRuby 1.6.8, Mirah 0.0.12, Pindah from master

Nope. I've left a comment on #39.

Java 6/7, JRuby 1.7.2, Mirah built from local master, Pindah from master (Mirah build is finicky right now)

Nope, doesn't work. What am I missing?

$ rake -T --trace rake aborted! cannot load Java class org.mirah.macros.Macro org/jruby/javasupport/JavaClass.java:1227:in for_name' org/jruby/javasupport/JavaUtilities.java:34:inget_proxy_class'

file:/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/jruby.jar!/jruby/java/core_ext/object.rb:26:in java_import' org/jruby/RubyArray.java:2361:inmap'

file:/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/jruby.jar!/jruby/java/core_ext/object.rb:22:in `java_import'

/home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform/ast_ext.rb:5:in `AST'

/home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform/ast_ext.rb:2:in `Mirah'

/home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform/ast_ext.rb:1:in (root)' org/jruby/RubyKernel.java:1027:inrequire'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:36:in require' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform.rb:1:in (root)' org/jruby/RubyKernel.java:1027:in `require'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:36:in require' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah/transform.rb:21:in (root)' org/jruby/RubyKernel.java:1027:in `require'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:36:in require' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah.rb:1:in(root)' org/jruby/RubyKernel.java:1027:in `require'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:60:in `require'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:55:in require' /home/artagnon/.ruby/gems/mirah-0.1.0.pre-java/lib/mirah.rb:26:in(root)' org/jruby/RubyKernel.java:1046:in load' /home/artagnon/.ruby/gems/pindah-0.1.3.dev/lib/pindah.rb:1:in(root)' /home/artagnon/.ruby/gems/pindah-0.1.3.dev/lib/pindah.rb:14:in (root)' /home/artagnon/src/chwall/Rakefile:1:in(root)' /home/artagnon/src/chwall/Rakefile:2:in `(root)'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/rake_module.rb:1:in `(root)'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in `load_rakefile'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/application.rb:581:in `raw_load_rakefile'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/application.rb:87:in `load_rakefile'

/home/artagnon/dotfiles/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/rake-10.0.2/lib/rake/application.rb:158:in standard_exception_handling' org/jruby/RubyKernel.java:1046:inload' /home/artagnon/.rbenv/versions/jruby-1.7.2/bin/rake:23:in `(root)'

— Reply to this email directly or view it on GitHubhttps://github.com/mirah/pindah/issues/37#issuecomment-13544692.

artagnon commented 11 years ago

Like this:

~/src/mirah$ gem build mirah.gemspec
~/src/mirah$ gem install mirah-0.1.0.pre-java.gem
abscondment commented 11 years ago

I have good news and bad news.

Bad news: mirah master is currently pretty broken. See mirah/mirah#190 mirah/mirah#201 mirah/mirah#202 for some particularly bad bugs that have developed since 0.0.12. And master is the only thing I can get to work with JRuby 1.7+.

Good news: here's how you can make it to work and work around the bugs.

Please reopen if you follow the steps in the gist and it still doesn't work for you.

(And, yes, doing this is a big pain. Right now I use JRuby 1.6.8 and Mirah 0.0.12 for real projects. But when the bugs are fixed and Mirah 0.1.0 is released, it'll be a good option.)