Skip to content

Instantly share code, notes, and snippets.

@baroquebobcat
Created July 15, 2012 21:35
Show Gist options
  • Select an option

  • Save baroquebobcat/3118733 to your computer and use it in GitHub Desktop.

Select an option

Save baroquebobcat/3118733 to your computer and use it in GitHub Desktop.
Mirah Office Hours: July 15th 2012

Plans

didn't get to

  • REPL-ification
    • PEG parser pausing?
    • gemify?
    • make a calculator as a reduced case?
  • more android tutorials
  • Status of Dubious.
  • Code cleanup.

1.9 Mode

We should set up testing to do it in both modes. I don't think it'd be too hard.

Maven

http://maven.apache.org/plugins/maven-deploy-plugin/ could be handy.

Hmm I wonder what would happen if I did

rake jar
rm -rf dist/classes
mkdir dist/classes
unzip dist/mirah.jar -d dist/classes
mvn deploy

would I get a new 0.0.12-SNAPSHOT?

It seems mvn deploy runs the build. Maybe I should have used mvn deploy:deploy. Let's see.

Seems to work ok

mirah on maven.

Now to release version 0.0.11

$ rake clean clobber

First, I should check 0.0.12-SNAPSHOT to make sure it works. Checking against SavageGames.

to do that I need to update maven-mirah-plugin.

Hrm

Class 'mirah.impl.Map' not found. -> [Help 1]

hrm

$ rake jar:complete
$ java -cp dist/mirah-complete.jar org.mirah.MirahCommand run "puts 'a'"
Exception in thread "main" org.jruby.exceptions.RaiseException: (NameError) Class 'mirah.impl.Map' not found.

maybe some of the changes between 0.0.11 & 0.0.12 borked the jar.

$ git co 8a9a6443a63d40b21ba0395e7c1bb16ec9741a6f
$ rake clean clobber
$ rake dist
$ java -cp dist/mirah-complete.jar org.mirah.MirahCommand run "puts 'a'"
Exception in thread "main" org.jruby.exceptions.RaiseException: (NameError) Class 'mirah.impl.Map' not found.
	at Mirah::JVM::Types::TypeFactory.get_mirror(file:/Users/nick/hacking/mirah_hacking/mirah/dist/mirah-complete.jar!/mirah/jvm/types/factory.rb:277)

Nope. What about 0.0.10?

$ git co 0.0.10
$ rake clean clobber
$ rake dist
$ java -cp dist/mirah-complete.jar org.mirah.MirahCommand compile
...
Exception in thread "main" org.jruby.exceptions.RaiseException: (RuntimeError) nothing to parse? []
...

that looks better. What happened?

I'm guessing it's the bootstrap classloader.

Well, there's your problem, right there:

https://github.com/mirah/mirah/commit/97cee78023c0582bba4669a63f5db5a744087f14#L2R248

    def resource_loader
      @resource_loader ||= URLClassLoader.new(make_urls(classpath), bootstrap_loader)
    end
    
    def bootstrap_loader
      @bootstrap_loader ||= begin
        parent = if bootclasspath
                   Mirah::Util::IsolatedResourceLoader.new(make_urls(bootclasspath))
                 end
        bootstrap_jar = File.expand_path("#{__FILE__}/../../../../../javalib/mirah-bootstrap.jar")
        bootstrap_urls = [java.io.File.new(bootstrap_jar).to_uri.to_url].to_java(java.net.URL)
        URLClassLoader.new(bootstrap_urls, parent)
      end
    end

Fixed! https://github.com/mirah/mirah/commit/1e57c103ba29acc18721aa9601398f046876154d

now to push some working maven artifacts.

w00t. It works! The 0.0.12-SNAPSHOT artifacts are functional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment