-
Notifications
You must be signed in to change notification settings - Fork 34
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
Circular dependency bug when user.clj exists #31
Comments
That probably can't be solved as Having a workaround might be the best that can be done. Maybe something to add to the documentation? |
@weavejester Just to make sure I understand what that workaround is doing for you:
|
@weavejester I use Sierra's reloaded pattern all the time, and I've run into the same issue and come to the same solution. |
@cemerick, I usually have options set up like: :profiles {:dev {:source-paths ["src" "dev"]}} And then place dev-specific source files in a Obviously this causes problems for cljx, so my solution is: :aliases {"cljx" ["with-profile" "cljx" "cljx"]}
:profiles {:dev {:source-paths ["src" "dev"]}
:cljx {}} I wonder if it would be possible to have I'm not sure whether that would solve it completely, but it would at least remove the need for an alias. |
Merging an empty profile means that e.g. This should work; prepend to your (require '[cljx.repl-middleware :as cljx])
(reset! @#'cljx/cljx-load-rules {:clj cljx.rules/clj-rules})
@@#'cljx/install-cljx-load It's so hairy-looking because those bits are currently intended solely for use by the nREPL middleware (thus the ns name), but they accomplish the same thing here: swapping in an enhanced I hadn't contemplated the need for this outside of the REPL integration, so something tidier would be needed; e.g. adding |
Oops, Github converted my hyperlink to a cross-reference, and I have no way to delete it. Thanks, the code in the preceding comment solves this for me. |
Unh, just ran into this also :/ Also, prepending the following doesn't seem to work, so I opted for the "profile without user.clj on source-path" -hack. (require '[cljx.repl-middleware :as cljx])
(reset! @#'cljx/cljx-load-rules {:clj cljx.rules/clj-rules})
@@#'cljx/install-cljx-load |
The user namespace is apparently magic in ways that mess up cljx. lynaghk/cljx#31
Another quick workaround is to comment the source path with user.clj in the project.clj before running cljx, then uncomment it for further compilation steps |
When
lein cljx once
orlein cljx auto
is executed, any code in theuser
namespace is automatically loaded. In the development profile, this namespace may be populated. For instance if a project is designed along the lines of Stuart Sierra's reloaded workflow, there may be a file "dev/user.clj" that is included in the development profile.If this is the case, running
lein cljx
can result in a circular dependency, if the user namespace depends on files that are generated by cljx.I'm currently working around this with the following:
The text was updated successfully, but these errors were encountered: