@mfikes if you have planck at hand, could you try evaluating (require 'clojure.tools.reader)
in the repl? Throws for me in lumo, but I have a hunch it's a bug upstream
@bfabry might need a fairly recent clojurescript, forgot to add
sorry should've given all
11326-storage:link_dataflow bfabry$ planck
Planck 2.5.0
ClojureScript 1.9.562
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Exit: Control+D or :cljs/quit or exit or quit
Results: Stored in vars *1, *2, *3, an exception in *e
cljs.user=> (require 'clojure.tools.reader)
nil
yes, I have my eyes on CLJS-2069
, which was fixed in 1.9.655
ah
@moxaj It is broken with Planck against ClojureScript master:
cljs.user=> (require 'clojure.tools.reader)
No such macros namespace: cljs.tools.reader, could not locate cljs/tools/reader.clj or cljs/tools/reader.cljc
cljs.user=> *clojurescript-version*
"1.9.820"
alright, thanks for checking, gonna log a jira
@moxaj Perhaps a minimal self-host repro can be trivially produced with https://clojurescript.org/community/reporting-bootstrap-issues
I was looking at one of your self host tickets
(require 'cljs.js)
(cljs.js/eval-str (cljs.js/empty-state)
"(ns cljs.user (:require [clojure.tools.reader]))"
nil
{:eval cljs.js/js-eval}
println)
I think this is good enough?
@moxaj Right, that is a more complicated regression where you actually need to handle code loading. I bet the single-form version on the site works for this, since it is just a require form.
Yes, if that repro’s. A slightly more minimal version is to replace the ns
with (require 'clojure.tools.reader)
that repros for me, in lumo at least
and lumo shouldn't interfere in that, so probably not lumo specific
You may need to add :context :expr
See https://clojurescript.org/community/reporting-bootstrap-issues
You want to ensure it repros with java -jar cljs.jar -m cljs.repl.nashorn
ideally
@mfikes I think I got it:
(require 'cljs.js)
(cljs.js/eval-str (cljs.js/empty-state)
"(require 'clojure.x)"
nil
{:eval cljs.js/js-eval
:load (fn [{:keys [name macros]} cb]
(cb (when (and (= name 'cljs.x)
(not macros))
{:lang :clj
:source "(ns cljs.x)"})))}
println)
with this, it repros in nashorn
hope i'm using load-fn
right, thinking of the (not macros)
part. I'd assume this should not trigger loading cljs.x
as a macros namespaces (but it tries to, hence the error)
Hmm @moxaj, what you are doing there is returning ‘cljs.x for ‘clojure.x
That’s not how cljs.js
actually works
It will first try loading 'clojure.x
and that is supposed to fail, and then cljs.js
will fall back to 'cljs.x
(and (= name 'cljs.x))
it'll fail at the first try
Oh, right 🙂
with verbose
, I see the exact same debug messages as with lumo
So, with that small repo, it should be possible to bisect now 🙂
on it!
Or, more importantly, we should be able to see whether your repro successfully worked in the past
Just download an older cljs.jar
and try it
yep, i'll try 1.9.562
it works
Interestingly, you can see a hint of how it derails in 1.9.660:
(cljs.js/eval-str (cljs.js/empty-state)
"(require 'clojure.x)"
nil
{:eval cljs.js/js-eval
:load (fn [{:keys [name macros]} cb]
(prn name macros)
(cb (when (and (= name 'cljs.x)
(not macros))
{:lang :clj
:source "(ns cljs.x)"})))}
println)
clojure.x nil
cljs.x true
{:error #error {:message No such macros namespace: cljs.x, could not locate cljs/x.clj or cljs/x.cljc, :data {:tag :cljs/analysis-error}}}
nil
It seems to jump to falling back to a macros namespace!
That aint right 🙂
that's what I see in lumo and 1.9.671 as well
But yes, @moxaj I think that’s a good minimal (REPL-driven) repro, very useful for bisecting on as well
that true
shouldn't be there
Yes, I bet in 1.9.562 it trys with a falsey value for macros
oh, if I wasn't on windows 😞. I don't see any windows equivalent for script/clean && script/bootstrap && rm -rf .cljs_node_repl && script/noderepljs
there's a repljs.bat
, but that's it
I'll follow https://github.com/clojure/clojurescript/wiki/Windows-Setup
There is script\bootstrap.ps1
, and yes, script\repljs.bat
. You can probably figure out the way to remove the .cljs_node_repl
tree, and the one last bit missing is a Windows version of script/clean
seems easy enough to port
Oh, just look at the contents of script/clean
@moxaj , you could probably write a bat file that does that
It is just deleting various trees
And files
Awesome. Great job!
I added a back-link as well https://dev.clojure.org/jira/browse/CLJS-2069?focusedCommentId=46481&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-46481
thanks!
wouldn't it be nice if the scripts were cljs scripts ran with planck/lumo 🙂 would be really meta
Right! Planck does that, especially for the scripts that drive its tests.
But, that would be a dep in ClojureScript that wouldn’t be desired, I would guess. It would make the script portable, on the other hand 🙂
there could be a small shell/powershell script which bootstraps planck/lumo, which then would bootstrap cljs
Hah!
I am intrigued with the implication of Alex Miller’s deps talk might be with respect to easily firing up Clojure-based scripts.
is that published online somewhere? really looking forward to watching it
oh, misread your sentence, you haven't seen it either
Right, I’m awaiting them to start flowing onto YouTube
@mfikes last year it took a couple months