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

remove problematic ahead-of-time compilation #46

Merged
merged 3 commits into from
Jan 13, 2017
Merged

Conversation

sibyl229
Copy link
Contributor

Hi @a8wright @mgrbyte @azurebrd I think avoiding Ahead-of-time compilation might be a fix for the mount problem #44, along with the problem that the server doesn't always update when rest/fields/gene.clj is modified.

Please run lein clean before starting the server for the first time with this change. This hopefully remove the product of previous compilation. It seems to work for me consistently. Please let me know whether this solution works for you guys. Thanks!

I don't have a full explanation for the fix. I don't understand the details about lein's compilation process myself. But based on the two issues #44 and the reloading problem, it appears that we get different compilation results based on timestamps of the source file. So the experiment has been to simplify compilation settings in the project.clj file, in particular avoid things that might cause a "stateful" compilation.

* related to mount issue #44, and
* auto-reloading of fields functions
@adamjohnwright
Copy link
Member

Thanks @sibyl229 I am going to try this out in the morning

@mgrbyte
Copy link
Contributor

mgrbyte commented Jan 13, 2017

@sibyl229 nice find!
More detail on the aot compilation process here.

@@ -30,7 +30,6 @@
[lein-pprint "1.1.1"]
[lein-ring "0.9.7"]]
:main datomic-rest-api.get-handler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we still need to specify skip-aot for the :main namespace, e.g:

:main ^:skip-aot  datomic-to-catalyst.get-handler

Additionally, I think we want to preserve aot for uberjar builds.
This can be done by adding:

:uberjar {:aot :all}

to the :profiles map.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgrbyte this makes sense to me. Our configuration was consistently working with the aot. It was just the runtime that was having troubles.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a8wright yep. I've submitted a PR upstream to the mount repo that should fix the underlying issue (as per ref above)

@adamjohnwright adamjohnwright merged commit 2486664 into develop Jan 13, 2017
@adamjohnwright adamjohnwright deleted the feature/no-aot branch January 13, 2017 14:19
sibyl229 pushed a commit that referenced this pull request Jan 13, 2017
* the :skip-aot doesn't seem to take effect
* tested creating a jar, it still works with this change
@sibyl229
Copy link
Contributor Author

sibyl229 commented Jan 13, 2017

Thanks @mgrbyte @a8wright for catching the uberjar issue! The
clojure {:uberjar {:aot :all}} option you set should be sufficient to resolve the uberjar issue (without requiring :aot [datomic-rest-api.get-handler], based on project.clj doc on :aot.

It appears that the :skip-aot doesn't take effect for me, and I had to remove the :aot [datomic-rest-api.get-handler] in d95b31a to avoid the mount issue. project.clj doc on :main hinted about this @a8wright and I tested creating the uberjar after the change, and it appears to work. Just letting you know here about the change. Please let me know if this breaks anything.

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

Successfully merging this pull request may close these issues.

3 participants