Share your thoughts in the 2024 State of Clojure Survey!

Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

https://github.com/MichaelBlume/reify-fail

`
(defprotocol Foo
(hello [this] "Says hello"))

(def bar
(reify Foo

(hello [this] "hello, world")))

(when-not (satisfies? Foo bar)
(throw (Exception. "bar doesn't satisfy Foo")))
`

Notes:

Project is AOT
Another namespace requires this namespace. That namespace is compiled first. Without that namespace the problem goes away.

12 Answers

0 votes
by

Comment made by: hiredman

what steps do you take after checking out the repo to reproduce this issue?

I cloned the repo and ran lein compile and didn't get any errors.

0 votes
by

Comment made by: michaelblume

I was reproducing the issue with lein check, but lein compile also fails for me, so I'm confused.

0 votes
by

Comment made by: michaelblume

I think it's important that the near-empty namespace compiles first, maybe there are platform differences in compilation order?

0 votes
by

Comment made by: michaelblume

test repo fails for me under Mac OS and Ubuntu, both with Java 8

0 votes
by

Comment made by: michaelblume

Under Ubuntu I have

$ lein -v
Leiningen 2.7.1 on Java 1.8.0_151 OpenJDK 64-Bit Server VM

0 votes
by
_Comment made by: jafingerhut_

On both of these OS’s: Ubuntu 16.04.3 Linux, macOS 10.12.6

With both of these versions of Leiningen: 2.7.1, 2.8.1

I believe all of my experiments were using a recent version of JDK 1.8

With any of these Clojure versions: 1.7.0 1.8.0 1.9.0

I get an error with both the commands 'lein check' and 'lein compile' with the project https://github.com/MichaelBlume/reify-fail, but only if I do '/bin/rm -fr target' first (or run it before the target directory has ever been created, e.g. immediately after running the ‘git clone’ command for the repository).

If I run the command twice, the first command creates many .class files in the target directory, and the second such command gives no error.
0 votes
by

Comment made by: hiredman

I am able to reproduce there error if I replace :aot :all with :aot (link: com.lendup.citadel.pipeline com.lendup.citadel.providers.mocky). I suspect lein could fix this by doing their stale ns check between compiling namespaces to avoid repeated compilation of transitive namespaces.

0 votes
by

Comment made by: hiredman

could be related to https://github.com/technomancy/leiningen/issues/2316

0 votes
by

Comment made by: ikitommi

related: https://github.com/technomancy/leiningen/issues/2508.

0 votes
by

Comment made by: bronsa

Is this a clojure or Lein issue then? Can we reproduce this using bare clj?

0 votes
by

Comment made by: alexmiller

I suspect you could reproduce it by compiling things in a certain order, but I have not tried to do so. But the resulting answer might be: compile things in the right order.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2303 (reported by michaelblume)
...