-
Notifications
You must be signed in to change notification settings - Fork 51
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
can't reify muuntaja.format.core/Decode in lein uberjar #90
Comments
This is a Clojure AOT feature. We only AOT the entry point into our apps, which dymanically loads all the things. But slower to start thou. All our libs are deployed as source code to avoid these problems. The case of failure is that for some reason, there are two versions of the Decode protocol in the final classpath, a other AOTd, and another not - and the reification fails. I would ask on Clojurians Slack how to debug this, if you would like full AOT. |
A minimal repro would help. |
One thing to try: |
Here a minimal thing to reproduce: Create a small app using muuntaja
Here I import the muuntaja namespaces and implement the decoder/encoder. Also I add
Modify the dockerfile
And here goes the error.
|
My temporary workaround is: Instead of
I simply inline the call in the wrap- function, so it's not executed at compile time.
|
Hi. I can reproduce this. I think this is a Leiningen / Clojure bug: the namespaces are not compiled in right order (Leiningen) and double-compile fails currently (https://dev.clojure.org/jira/browse/CLJ-1741). A workaround is to define the aot-oder manually: :aot [protocol-bug.env protocol-bug.layout protocol-bug.middleware.formats protocol-bug.nrepl protocol-bug.middleware protocol-bug.core protocol-bug.handler protocol-bug.routes.home protocol-bug.config] , which is really bad. Will try to resolve this. |
locally, I get a working order:
On docker, its: Compiling protocol-bug.env
Compiling protocol-bug.core
Compiling protocol-bug.nrepl
Compiling protocol-bug.routes.home
Compiling protocol-bug.layout
Compiling protocol-bug.config
Compiling protocol-bug.middleware.formats
Compiling protocol-bug.handler
Compiling protocol-bug.middleware |
Tested this with 2.9.1, it now fails on all environments. Asked to reopen the Leiningen issue. Bad, bad, bad. |
I have tried to create a custom encoder/decoder for xml. When I run
lein uberjar
from the docker imageclojure
I get a compile error:The decoder looks like this:
What's weird is that it works on my local machine (sounds familiar ;). This only occurs in the docker image. I can't see what should make a difference.
Essentially this expression turns out to be false inside the container when
lein uberjar
executes.For other protocols it works:
This occurs when I aot-compile the whole application. What is not clear to me:
muuntaja.format.core
I use this dockerfile
Then execute
docker build .
The text was updated successfully, but these errors were encountered: