HelloWorld errors in Clojure due to org.ow2.asm/asm version

80 views
Skip to first unread message

John Shaffer

unread,
Aug 25, 2023, 1:31:09 PM8/25/23
to rama-user
I was seeing type-related errors when implementing the HelloWorld module in a Clojure project. The cause is that Rama depends on org.ow2.asm/asm 4.2, and many Clojure libraries pull in version 9.2. Explicitly requiring version 4.2 makes Rama work, but likely breaks the libraries in hard-to-predict ways.

@Jabuk on Clojurians noticed a core.async -> tools.analyzer.jvm -> asm 9.2 dependency chain. As core.async is a very common dependency of Clojure libs, this makes it difficult to use Rama from Clojure.

The work-arounds are either to experiment with Rama in a fresh Clojure project without libs, or to explicitly add asm version 4.2 and be aware that some lib features will break. This set of dependencies works for me to get Rama working, even with a lot of Clojure libs:
org.ow2.asm/asm {:mvn/version "4.2"} org.ow2.asm/asm-analysis {:mvn/version "4.2"} org.ow2.asm/asm-commons {:mvn/version "4.2"} org.ow2.asm/asm-tree {:mvn/version "4.2"} org.ow2.asm/asm-util {:mvn/version "4.2"}


Nathan Marz

unread,
Aug 25, 2023, 3:44:20 PM8/25/23
to rama...@googlegroups.com
Looks like we'll have to shade more of Rama's dependencies to avoid these conflicts. Shading can be tricky depending on how dynamic a library is. I opened a ticket internally as we do care about usage from Clojure being smooth. Your workaround is the best option for now.

--
You received this message because you are subscribed to the Google Groups "rama-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rama-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rama-user/0418d387-bbd6-4abd-8103-d307006e0768n%40googlegroups.com.

John Shaffer

unread,
Aug 25, 2023, 3:49:03 PM8/25/23
to rama-user
Thank you, Nathan.

I typoed @Jakub as @Jabuk earlier, sorry Jakub!

NPException

unread,
Aug 26, 2023, 4:07:18 AM8/26/23
to rama-user

@Nathan I'm curious if you have seen the recently uploaded talk by Brian Goetz about an upcoming classfile API in Java: https://www.youtube.com/watch?v=pcg-E_qyMOI
It looks to be shaping up as a good replacement for ASM, and I was wondering if it was worth considering for you at RPL, or if it's not feasible out of the gate because it would make using older JDKs with Rama impossible. But assuming that Rama might mostly be used in greenfield projects, requiring a newer JDK  might not be a bad tradeoff?

Nathan Marz

unread,
Aug 26, 2023, 5:09:09 PM8/26/23
to rama...@googlegroups.com
That's interesting (and about time). But we definitely want Rama to work on all JVMs back to Java 8, since that version is still widely used. We also have so much other stuff to work on that replacing how we do bytecode generation is not high priority. Shading ASM should be pretty straightforward.

Reply all
Reply to author
Forward
0 new messages