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
load statements aren't handled #61
Comments
From what I can tell this happens because Guess we could run our own pass over the file to look for |
👋 @expez give above (branch |
also require/use/import etc is taken care of. what was missing is checking file path like references what load is using |
gentle bump @expez |
Got an error:
|
I added some debug info and here's the ns form of the file it choked on: (ns ^{:author "Alex Taggart", :doc "Support for testing whether logging calls are made.
Usage example:
(require '[clojure.tools.logging :as log]
'[clojure.tools.logging.test :refer [logged? with-log])
(with-log
(log/info "Hello World!")
(log/error (Exception. "Did a thing") "Error: oops")
(logged? 'user :info #"Hello") ; true
(logged? 'user :error [Throwable #"thing"] #"Error:") ; true
(logged? 'user :debug "Hi")) ; false", :mranderson/inlined true} clojure.tools.logging.test
(:import [clojure.lang Fn Keyword Namespace Symbol]
java.util.Set
java.util.regex.Pattern)
(:require [clojure.tools.logging :refer [*logger-factory*]]
[clojure.tools.logging.impl :as impl])) This ns form is unreadable because the strings in the code example have lost their escape characters. Here's the original as a reference: (ns ^{:author "Alex Taggart"
:doc
"Support for testing whether logging calls are made.
Usage example:
(require '[clojure.tools.logging :as log]
'[clojure.tools.logging.test :refer [logged? with-log])
(with-log
(log/info \"Hello World!\")
(log/error (Exception. \"Did a thing\") \"Error: oops\")
(logged? 'user :info #\"Hello\") ; true
(logged? 'user :error [Throwable #\"thing\"] #\"Error:\") ; true
(logged? 'user :debug \"Hi\")) ; false"}
clojure.tools.logging.test
(:import [clojure.lang Fn Keyword Namespace Symbol]
java.util.Set
java.util.regex.Pattern)
(:require [clojure.tools.logging :refer [*logger-factory*]]
[clojure.tools.logging.impl :as impl])) |
hm.. I though rewrite-clj handled such strings but maybe not.. will check check this. that said this seems to be a different issue from the original,right? does this mean the load statements are now fine? |
It doesn't get to the load statements because it fails pretty quickly. |
bit confused here. how did you get to the original failure with the load statements then? you don't get this problem with the version of mranderson you used before reporting the original? |
Here's a bit more of the printout. As you can see it crashes before it reaches |
how did you get to |
|
To repro the only dep you need is this one, from
It will cause this branch to fail.
|
thx for the repro snippet. haha that is good in a way ;) |
Here's an even better repro by modifying the new test you created for this branch: (def tool-deps-alpha-example
"(ns
^{:author \"Alex Taggart\"
:doc
\"Support for testing whether logging calls are made.
Usage example:
(require '[clojure.tools.logging :as log]
'[clojure.tools.logging.test :refer [logged? with-log])
(with-log
(log/info \"Hello World!\")
(log/error (Exception. \"Did a thing\") \"Error: oops\")
(logged? 'user :info #\"Hello\") ; true
(logged? 'user :error [Throwable #\"thing\"] #\"Error:\") ; true
(logged? 'user :debug \"Hi\")) ; false\"}
clojure.tools.deps.alpha)
(load \"/clojure/tools/deps/alpha/extensions/maven\")") |
can't really reproduce this with above as dblquotes inside the doc string should be double escaped. not even sure that is possible so just put the above example in a file and that is processed without a problem -- see latest commit on the maybe offending file is in tools logging btw: https://github.com/clojure/tools.logging/blob/master/src/main/clojure/clojure/tools/logging/test.clj will have an other go and see if mranderson can inline tools logging |
mranderson does not seem to have a problem with tools logging. added it to
and after digging out the inlined file the ns macro looks like this:
so can't really repro the problem unfortunately. the load stmt thing is fixed too. let me know if i can be any help tho |
I recently tried to inline
tools.deps.alpha
to get hotload-dependencies working again for cljr, but mranderson failed to consider these load statements in the middle of the file.The text was updated successfully, but these errors were encountered: