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

weird compilation issues when using aot w/use of defstate macro #73

Open
mgrbyte opened this issue Jan 13, 2017 · 0 comments
Open

weird compilation issues when using aot w/use of defstate macro #73

mgrbyte opened this issue Jan 13, 2017 · 0 comments

Comments

@mgrbyte
Copy link

mgrbyte commented Jan 13, 2017

Hi,
We're using mount to handle a single connection to a datomic database in our app, and
recently ran into an issue.
To fully describe what's happening here:

  • we have two git branches (develop and feature/add-feature)
  • On develop, db.clj resides at src/datomic_to_catalyst/utils/db.clj (ns: datomic-to-catalyst.utils.db)
  • On the feature branch, we moved the db.clj module up a level.

Switching between the two branches and issueing any lein repl/run/ring command will cause re-compilation to be attempted, which triggers the error linked to above.
In order to work around the error, the following steps "work around" the issue:

  1. switch git branch
  2. run lein .... (ClassDefNotFound error is thrown pointing at mount/core/DeferrableState | defstate macro)
  3. touch -m <path to db.clj>
  4. run lein (works again)

Repeating steps 0 .. 3 (on a different branch where db.clj is re-located) re-produces the error consistently.

Investigating further, my colleague found that disabling aot compilation also works-around this issue.

I found this which seems to indicate that this could be the cause of the issue here.

Specifically, the following passage was an "ah-ha!" moment:

set-logger! is a macro that makes use of the ns var. ns contains the current namespace and, due to what I’m assuming to be special semantics regarding this particular var, it shouldn’t be unquoted within a macro - which is why it was failing in AOT mode.

(Our project.clj is currently using aot compilation)

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

1 participant