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

boot.pod/with-eval-in -> Method code too large! #339

Closed
podviaznikov opened this issue Nov 8, 2015 · 13 comments
Closed

boot.pod/with-eval-in -> Method code too large! #339

podviaznikov opened this issue Nov 8, 2015 · 13 comments

Comments

@podviaznikov
Copy link

I'm getting

clojure.lang.ExceptionInfo: java.lang.RuntimeException: Method code too large!, compiling:(NO_SOURCE_PATH:0:0)

When calling (boot.pod/with-eval-in (boot.pod/make-pod) ...) with moderate size function.

More details hashobject/perun#49.

What would be the best way to fix this?

@micha
Copy link
Contributor

micha commented Nov 8, 2015

@podviaznikov hi! i was just starting to work on this!

@micha
Copy link
Contributor

micha commented Nov 8, 2015

I'm going to try using input streams instead of strings to pass the information from pod to pod.

@podviaznikov
Copy link
Author

@micha thanks! good to hear

@nicorikken
Copy link

+1

micha added a commit that referenced this issue Nov 12, 2015
Test case:

    #!/usr/bin/env boot
    (require '[boot.pod :as pod])
    (def p (pod/make-pod))
    (def x (into [] (range 0 1000000)))
    (prn (pod/with-eval-in p (count ~x)))

This fails with "RuntimeException: Class file too large!"

    #!/usr/bin/env boot
    (require '[boot.pod :as pod])
    (def p (pod/make-pod))
    (def x (into [] (range 0 1000000)))
    (prn (pod/with-eval-in p (count ~(pod/send! x))))

This works, no problem.
@micha
Copy link
Contributor

micha commented Nov 12, 2015

@podviaznikov Can you please try with latest master branch? See commit message for how to do it. Is this solution acceptable?

@podviaznikov
Copy link
Author

@micha how can I run boot#master locally?

@podviaznikov
Copy link
Author

I see, there are instructions for that https://github.com/boot-clj/boot#hacking-boot

@podviaznikov
Copy link
Author

Hmm,

I'm still getting:

clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Method code too large!, compiling:(NO_SOURCE_PATH:0:0)
             java.lang.RuntimeException: Method code too large!
    clojure.asm.MethodWriter.getSize                 MethodWriter.java: 1872
 clojure.asm.ClassWriter.toByteArray                  ClassWriter.java:  775
                                 ...
                   clojure.core/eval                          core.clj: 3081
                   boot.pod/eval-in*                           pod.clj:  224
                                 ...
                   boot.pod/eval-in*                           pod.clj:  227
              io.perun/render-in-pod                         perun.clj:  376

Not sure if I updated boot correctly, but it seems that I'm.

boot -V
#http://boot-clj.com
#Wed Nov 11 20:38:38 PST 2015
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.5.0-SNAPSHOT

@micha
Copy link
Contributor

micha commented Nov 12, 2015

@podviaznikov and you're using the new boot.pod/send! function to wrap the large data?

@podviaznikov
Copy link
Author

@micha no, I didn't. Missed that part. Trying now

@podviaznikov
Copy link
Author

It works now!

@micha
Copy link
Contributor

micha commented Nov 12, 2015

Great! I'll close this ticket. I think there might be a more clever way to do this so that you don't need to explicitly call the send! function, but I don't quite have it yet.

@micha micha closed this as completed Nov 12, 2015
@podviaznikov
Copy link
Author

Yeah, that works for me. That is why I didn't try to use send! at the first place. Didn't expect that to be change of the interface. Thank you again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants