<< Back to previous view

[CONTRIB-65] pprint depends on order of compilation Created: 31/Jan/10  Updated: 24/Aug/10  Resolved: 24/Aug/10

Status: Closed
Project: Clojure-Contrib
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect
Reporter: Anonymous Assignee: Stuart Sierra
Resolution: Completed Votes: 0
Labels: None


 Description   

pprint causes problems with the build process:

1. c.c.pprint.ColumnWriter
2. c.c.pprint.PrettyWriter
3. c.c.pprint

The first two are gen-class'd, and PrettyWriter extends the class
generated for ColumnWriter.

Unless they are compiled in exactly the order given above, the build
fails with a ClassNotFoundException.



 Comments   
Comment by Assembla Importer [ 24/Aug/10 3:08 PM ]

Converted from http://www.assembla.com/spaces/clojure/tickets/65

Comment by Assembla Importer [ 24/Aug/10 3:08 PM ]

stuart.sierra said: (In revision:3275810556b075ff9a3a0abc0d08b3a19ee46bae) pprint: Move gen-class expressions to separate file; refs #65

To avoid order-of-compilation issues,
this patch puts the gen-class expressions
for ColumnWriter and PrettyWriter in a
separate file, rather than in the ns
declarations.

Branch: master

Comment by Assembla Importer [ 24/Aug/10 3:08 PM ]

stuart.sierra said: (In revision:aa34fb9e52fa500c99bb45448bdfcd4020db5392) Reenable compiling of test namespaces in POM; refs #65

But disable tests of pprint, which fail currently

Branch: master

Comment by Assembla Importer [ 24/Aug/10 3:08 PM ]

stuart.sierra said: I think I have fixed this by placing the gen-class directives in a separate file; only that file will be AOT-compiled.

Comment by Assembla Importer [ 24/Aug/10 3:08 PM ]

tomfaulhaber said: What a mess! This seems like a big problem with gen-class if we have to jump through this many hoops to make it work once we have more than one class in a hierarchy.

Of course it worked fine back in ant-land where we had control over the compilation order.

Comment by Assembla Importer [ 24/Aug/10 3:08 PM ]

stuart.sierra said: It's not that bad. The Ant build script was messier. This is more flexible, because it only AOT-compiles things that need it, i.e. gen-class.

Comment by Assembla Importer [ 24/Aug/10 3:08 PM ]

cemerick said: I mentioned this elsewhere, but perhaps there's a reason why this isn't workable in this case: I believe if you require clojure.contrib.pprint.ColumnWriter in PrettyWriter's ns declaration (perhaps before the :gen-class form?), then the compiler will visit and gen CW before attempting to gen-class PW.

This would eliminate the need to explicitly specify which namespaces to compile.

Comment by Assembla Importer [ 24/Aug/10 3:08 PM ]

stuart.sierra said: Tried it. Didn't work.

Comment by Assembla Importer [ 24/Aug/10 3:08 PM ]

stu said: Updating tickets (#2, #3, #33, #38, #51, #52, #65, #67, #70)

Generated at Thu Apr 24 04:31:35 CDT 2014 using JIRA 4.4#649-r158309.