Skip to content
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

Lein check crashes ungracefully when a file has malformed lisp in it. #2133

Closed
phillord opened this issue Apr 24, 2016 · 3 comments
Closed

Comments

@phillord
Copy link

To reproduce create a new project with lein new, replace the entire contents
of core.clj (including namespace) with a single character "{", type lein check
-- this error results.

java.lang.RuntimeException: EOF while reading
 at clojure.lang.Util.runtimeException (Util.java:221)
    clojure.lang.LispReader.readDelimitedList (LispReader.java:1204)
    clojure.lang.LispReader$MapReader.invoke (LispReader.java:1158)
    clojure.lang.LispReader.read (LispReader.java:263)
    clojure.lang.LispReader.read (LispReader.java:196)
   clojure.lang.LispReader.read (LispReader.java:185)

This happens with both the current release and trunk. It's possible to get a
variety of other errors from the lisp reader depending on the exact contents
of the file. In no case is there anything informative about the cause of the
error, which can make it hard to track down for a project with lots of
namespaces.

The crash stems from here:

     nses (b/namespaces-on-classpath :classpath source-files
                                     :ignore-unreadable? false)

If ":ignore-unreadable?" is changed to true the problem goes away, although
this also stops lein check from checking syntax which it is supposed to be
doing. Unfortunately, bultitude doesn't have a
":tell-me-if-its-unreadable-but-dont-crash" option, so I suspect the fix is
needed there.

@hypirion
Copy link
Collaborator

Yeah, I agree that this is terrible UX. Happy to get this fixed or improved in some way, because this can easily be confusing.

@TimoFreiberg
Copy link

We can do something about this: TimoFreiberg/bultitude#5
I've never done anything in leiningen, so if anyone can tell me how a nice bultitude API would look for leiningen it would help me a lot :)

@technomancy
Copy link
Owner

I think this should be fixed with the new bultitude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants