<< Back to previous view

[TNS-46] Add project.clj for easier development Created: 13/Sep/16  Updated: 13/Sep/16

Status: Open
Project: tools.namespace
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Juho Teperi Assignee: Stuart Sierra
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File TNS-46.patch    
Patch: Code

 Description   

Tools.namespace doesn't currently have have a Leiningen configuration which would make it easy to start a repl and start developing tools.namespace.

Attached patch adds simple project.clj file with deps and source-paths.






[TNS-43] ns-decl? treats (ns) as valid Created: 28/Mar/16  Updated: 01/Apr/16

Status: Open
Project: tools.namespace
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: James Laver Assignee: Stuart Sierra
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File ns-decl.patch    
Patch: Code

 Description   

If you try to declare an empty namespace with `(ns)`, you get an ArityException, but ns-decl? does not test for this.

The attached patch simply tests whether it is at least two items long.

I have previously signed the Clojure CA.



 Comments   
Comment by James Laver [ 28/Mar/16 6:45 AM ]

I'm wondering if it's worth updating my patch to also check that the namespace name is a symbol.

Comment by Stuart Sierra [ 01/Apr/16 9:33 AM ]

I feel like I need some more context here. What is the motivation for making a change in this case? Have you encountered real code in which (ns) causes a problem because tools.namespace accepts it as a valid namespace declaration?





[TNS-41] Provide warning when AOT enabled for a project Created: 25/Dec/15  Updated: 25/Dec/15

Status: Open
Project: tools.namespace
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Zack Maril Assignee: Stuart Sierra
Resolution: Unresolved Votes: 0
Labels: None


 Description   

It would be nice if tools.namespace would throw an error when AOT was turned on. I recently turned on AOT for a project and unknowingly broke refresh without thinking. It was during a flurry of other changes and so it took me a while to figure that was the issue and track down that tools.namespace doesn't work with AOT. Is it possible to detect AOT inside of the clojure runtime?






[TNS-39] Single classpath argument for c.t.n.move Created: 06/Nov/15  Updated: 06/Nov/15

Status: Open
Project: tools.namespace
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Stuart Sierra Assignee: Stuart Sierra
Resolution: Unresolved Votes: 0
Labels: None


 Description   

clojure.tools.namespace.move/move-ns requires that the caller provide both 1) the directory containing the file to be moved; and 2) the collection of directories containing all source files to be updated with the new name. This is redundant.

Instead, we can search for the file in all source directories, move it within the same root directory, then update all files in all directories.

In addition, with java.classpath in TNS-36, the set of directories to search can default to directories on the classpath. This will be much more convenient for REPL use.

This change can be made without breaking older arities of move-ns.






[TNS-24] Broken tracker after mis-named namespace Created: 07/Sep/14  Updated: 11/Sep/14

Status: Open
Project: tools.namespace
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Stuart Sierra Assignee: Stuart Sierra
Resolution: Unresolved Votes: 0
Labels: None


 Description   

A tools.namespace dependency tracker can get into an inconsistent state after attempting to load a file with a namespace declaration that does not match the file's name.

Steps to reproduce:

In a new Clojure project, create a file foo.clj on the classpath containing the namespace declaration (ns wrong-ns-declaration-for-foo)

Then at the REPL:

user=> (use 'clojure.tools.namespace.repl)
nil
user=> (refresh)
:reloading (wrong-ns-declaration-for-foo)
:error-while-loading wrong-ns-declaration-for-foo
#<FileNotFoundException java.io.FileNotFoundException: Could not locate wrong_ns_declaration_for_foo__init.class or wrong_ns_declaration_for_foo.clj on classpath: >

Edit the file foo.clj so that its namespace declaration is correct: (ns foo)

But at the REPL, refresh still doesn't work:

user=> (refresh)
:reloading (foo wrong-ns-declaration-for-foo)
:error-while-loading wrong-ns-declaration-for-foo
#<FileNotFoundException java.io.FileNotFoundException: Could not locate wrong_ns_declaration_for_foo__init.class or wrong_ns_declaration_for_foo.clj on classpath: >

Since tools.namespace 0.2.5, the workaround is to call clear:

user=> (clear)
{}
user=> (refresh)
:reloading (foo)
:ok


 Comments   
Comment by Andy Fingerhut [ 11/Sep/14 6:38 PM ]

Such files introduce problems for all kinds of tools, not just tools.namespace. I don't know all of the consequences, but two are listed here: https://github.com/jonase/eastwood#check-consistency-of-namespace-and-file-names

I have added warnings in Eastwood whenever it finds files like this, and doesn't do any linting checks on any files until such things are corrected.





[TNS-7] Stack overflow on refresh after circular dependency detected Created: 17/Apr/13  Updated: 17/Apr/13

Status: Open
Project: tools.namespace
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Stuart Sierra Assignee: Stuart Sierra
Resolution: Unresolved Votes: 1
Labels: None
Environment:

tools.namespace 0.2.3



 Description   
user> (refresh)
Exception Circular dependency between com.example.foo and com.example.bar  clojure.tools.namespace.dependency.MapDependencyGraph (dependency.clj:74)
user> (refresh)
StackOverflowError   clojure.lang.PersistentHashMap$BitmapIndexedNode.index (PersistentHashMap.java:576)
user> (clojure.repl/pst)
StackOverflowError 
	clojure.lang.PersistentHashMap$BitmapIndexedNode.index (PersistentHashMap.java:576)
	clojure.lang.PersistentHashMap$BitmapIndexedNode.find (PersistentHashMap.java:676)
	clojure.lang.PersistentHashMap$ArrayNode.find (PersistentHashMap.java:396)
	clojure.lang.PersistentHashMap.valAt (PersistentHashMap.java:152)
	clojure.lang.PersistentHashMap.valAt (PersistentHashMap.java:156)
	clojure.lang.RT.get (RT.java:645)
	clojure.tools.namespace.dependency/transitive (dependency.clj:52)
	clojure.tools.namespace.dependency/transitive/fn--7043 (dependency.clj:51)
	clojure.core.protocols/fn--6022 (protocols.clj:79)
	clojure.core.protocols/fn--5979/G--5974--5992 (protocols.clj:13)
	clojure.core/reduce (core.clj:6177)
	clojure.tools.namespace.dependency/transitive (dependency.clj:52)
nil





Generated at Thu Sep 29 20:33:08 CDT 2016 using JIRA 4.4#649-r158309.