-
Notifications
You must be signed in to change notification settings - Fork 108
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 an undeclared ns cycle #240
base: master
Are you sure you want to change the base?
Conversation
Sorry, I'll remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change could go for me (modulo the griffinbank
removal).
Can I also ask you for a comparison between the behaviour you had before and the one you have now? (on the PR description - the native-image invocation).
Zach did some funky stuff like mid-file requires to avoid some circular dependency design issues (and just because it was the dawn of Clojure, before people realized this was more trouble than it was worth). I always meant to fix it, but never got around to it, so thanks for tackling this! So, a few notes:
|
Some context: We are compiling our project using Bazel + https://github.com/griffinbank/rules_clojure. This makes AOT incremental, per-ns, rather than the compiling the whole project in a single pass using lein or tools.build. This means each The tradeoff is that With the patch in place, our project AOT compiles just fine (and our code that uses caesium passes). We're using Why it broke: if you start compiling from With the patch in place, I can annotate the AOT manifold.stream.core jar to have a runtime dependency on manifold.stream.graph. Without it,
Good catch. I don't know, but I see a few options:
I've made the same change in those two other places, and verified there are no other calls to
Good idea. The project.clj already has |
2fd9b44
to
18e9569
Compare
Go ahead and add the notice about the clj version to the Readme somewhere and leave CHANGES untouched. Not enough people read the changelog, and this is a breaking change. I'm still a little concerned that it passed the tests when you removed the ns, but before you added the requiring-resolve. Have you tried this with a standard lein built setup? Most people aren't using Basel. |
If we've just been luck so far, we shouldn't rely on it. One way to check is to fire up a new REPL, load just that namespace first, and exercise that code. That minimizes any chance of something requiring it for us. If the tests are incomplete, can you add a test that fails before, and succeeds after, your change? |
I figured this out. If we start from
m.stream.core used to call m.stream.graph in the middle of the file, and no longer does until I've updated the README now. I believe that addresses all comments. |
18e9569
to
b6241a1
Compare
@@ -2,7 +2,6 @@ | |||
{:no-doc true} | |||
(:require | |||
[clj-commons.primitive-math :as p] | |||
[manifold.stream.graph :as g] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, this is a little suspicious.
It looks like it can be safely removed, but it used to be the case that some namespaces were required to force initialization of necessary data structures that were indirectly needed. Yet another reason indirect requires are a bad idea.
Removing this looks ok afaict, tho.
@arohner Thanks for digging into this. I'm glad it works, but it's never ideal to rely on indirect requires if we're directly invoking from a namespace we depend on. That's always a time bomb waiting to happen. Instead, can you add manifold.stream.graph directly in the requires without breaking anything? If so, we should be able to skip the requiring-resolve. That's really designed for optional, conditional, and REPL requires. If the requiring-resolve should succeed 100% of the time in normal code, it should be replaced with a plain require. Also, please remove the reference to the version number in the README. We'll add it when we cut a release. And given the breaking change, we may want to bump it up to 0.5.x or even 1.0.0. |
@@ -1,3 +1,9 @@ | |||
### 0.4.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this from 0.4.4 to "Unreleased changes"
This resolves an issue AOT'ing when using https://github.com/griffinbank/rules_clojure