Build fails when moved to different machine

70 views
Skip to first unread message

craig

unread,
Jul 29, 2012, 8:09:15 AM7/29/12
to Clojure Maven Plugin

The build for my application is failing now that it has been moved to
a different machine. It appears the
clojure source is being built in a different order, and googling
indicates this may be a characteristic of
the clojure maven plugin.

I have tried using the compileDeclaredNamespaceOnly option (set to to
true),in conjunction with a
namespace list. This did not alter the outcome.

Is there a way to specify the compilation order?

Mark Derricutt

unread,
Jul 31, 2012, 6:56:19 AM7/31/12
to clojure-ma...@googlegroups.com
Hi Craig,

I can't say I've heard of any problems like this before, if you run your build with -X and dig through the debug and you should see a reference to a generated .clj file which is used to compile the source, does that indicate any compilation order that might be causing this?

The script basically adds a list of namespaces to compile and passes that over to clojure itself - have you changed clojure versions at all?

Mark

Romith JInawardana

unread,
Jul 31, 2012, 8:38:55 PM7/31/12
to clojure-ma...@googlegroups.com
Hi Craig,

         I and few of my colleagues also having same problem. When we run maven with -X we found that Clojure compile command get the namespaces list not in order as we defined in pom.xml. So AOT get mixed up and compilation failed.

        When I check the plugin code I found that Set is used for filtering name spaces (inside NamespaceDiscovery.java:71) ,

1.       Can we improve the plugin to detect AOT early?
2.       Quick Fix would be changing the Set to List I guess, any side effect do you see?

Romith JInawardana

unread,
Jul 31, 2012, 9:39:55 PM7/31/12
to clojure-ma...@googlegroups.com
Hi Craig,
      Seems my suggestion is not working.

     Is there any configuration for AOT?


On Tuesday, July 31, 2012 4:26:19 PM UTC+5:30, Mark Derricutt wrote:

Mark Derricutt

unread,
Jul 31, 2012, 11:50:45 PM7/31/12
to clojure-ma...@googlegroups.com
Nothing specific or AOT no.

Can you paste the error output you're getting to a gist or something? Or do you have a sample project which demonstrates the problem I could take a look at?

Mark

craig

unread,
Aug 4, 2012, 5:00:51 AM8/4/12
to Clojure Maven Plugin

Hi Mark,

The actual error reported as the build fails is a
ClassNotFoundException - for a class that is dynamically generated
(deftype).

I am using Clojure 1.3 on both machines. On both machines I purged the
m2 repos before attempting to build.

With the -X flag, DEBUG output includes a series of entries thus:

[DEBUG] Found namespace com.foo.bar
[DEBUG] Found namespace com.foo.baz
...

and the namespaces appear in different orders on the different
machines. I am not sure this is relevant
though, since soon thereafter the actual compile command is logged:

[DEBUG] Command line: java -cp ...

and the list of namespace args after 'clojure.lang.Compile' is
different from the order reported in the
'Found ..' debug statements, and different between machines (ie four
distinct namespace orders, across the two machines).
On one machine the args passed to clojure.lang.Compile are conjusive
to a successful build, and on the other, not so much...

Happy to provide more info.

Craig


..

On Jul 31, 8:56 pm, Mark Derricutt <m...@talios.com> wrote:
> Hi Craig,
>
> I can't say I've heard of any problems like this before, if you run your build with -X and dig through the debug and you should see a reference to a generated .clj file which is used to compile the source, does that indicate any compilation order that might be causing this?
>
> The script basically adds a list of namespaces to compile and passes that over to clojure itself - have you changed clojure versions at all?
>
> Mark
>

Romith JInawardana

unread,
Aug 7, 2012, 3:01:39 AM8/7/12
to clojure-ma...@googlegroups.com
Hi,

      [DEBUG] Command line: java -cp /home/romith/projects/test/core/target/classes/../generated-sources:/home/romith/projects/test/core/src/main/clojure:/home/romith/projects/test/core/target/classes::/home/romith/projects/test/core/target/classes:/home/romith/.m2/repository/midje/midje/1.4.0/midje-1.4.0.jar:/home/romith/.m2/repository/ordered/ordered/1.2.0/ordered-1.2.0.jar:/home/romith/.m2/repository/org/clojure/math.combinatorics/0.0.1/math.combinatorics-0.0.1.jar:/home/romith/.m2/repository/org/clojure/algo.monads/0.1.0/algo.monads-0.1.0.jar:/home/romith/.m2/repository/org/clojure/core.unify/0.5.2/core.unify-0.5.2.jar:/home/romith/.m2/repository/utilize/utilize/0.2.3/utilize-0.2.3.jar:/home/romith/.m2/repository/colorize/colorize/0.1.1/colorize-0.1.1.jar:/home/romith/.m2/repository/org/clojure/tools.macro/0.1.1/tools.macro-0.1.1.jar:/home/romith/.m2/repository/org/clojure/core.incubator/0.1.0/core.incubator-0.1.0.jar:/home/romith/.m2/repository/swiss-arrows/swiss-arrows/0.1.0/swiss-arrows-0.1.0.jar:/home/romith/.m2/repository/org/mongodb/mongo-java-driver/2.8.0/mongo-java-driver-2.8.0.jar:/home/romith/.m2/repository/org/clojure/clojure/1.4.0/clojure-1.4.0.jar:/home/romith/.m2/repository/org/clojure/data.json/0.1.2/data.json-0.1.2.jar:/home/romith/.m2/repository/org/clojure/tools.logging/0.2.3/tools.logging-0.2.3.jar:/home/romith/.m2/repository/org/clojars/hms/clj-http/0.1.4/clj-http-0.1.4.jar  -Dclojure.compile.path=/home/romith/projects/test/core/target/classes -Dclojure.compile.warn-on-reflection=true clojure.lang.Compile my.test.TestException my.test.exception.user


Above compilation works without issue.


       If i switch the last two arguments as

          ......clojure.lang.Compile my.test.exception.user my.test.TestException

     This will fail with exception saying ClassNotFound TestException

I edited to mojo to use only the given name spaces and in the given order (removed currently used Set in side mojo). Then it worked without any issue.

Not sure whether this is a issue of plugin or clojure compiler.
Reply all
Reply to author
Forward
0 new messages