This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-07
Channels
- # beginners (71)
- # boot (25)
- # cider (204)
- # clara (18)
- # cljs-dev (10)
- # cljsrn (64)
- # clojure (50)
- # clojure-dev (2)
- # clojure-dusseldorf (1)
- # clojure-india (5)
- # clojure-italy (1)
- # clojure-nl (21)
- # clojure-poland (65)
- # clojure-spec (41)
- # clojure-uk (10)
- # clojurescript (4)
- # core-async (5)
- # cursive (2)
- # datomic (17)
- # duct (8)
- # emacs (8)
- # fulcro (1)
- # graphql (21)
- # hoplon (2)
- # javascript (3)
- # lumo (25)
- # mount (5)
- # off-topic (5)
- # onyx (3)
- # portkey (6)
- # re-frame (15)
- # reagent (5)
- # rum (1)
- # shadow-cljs (198)
- # spacemacs (19)
- # specter (2)
@arrdem Seems something’s wrong with the content-type middleware - I did some tests before cutting 0.17 and I don’t get any responses from the middleware when evaluating some images.
│ └── cider
│ └── nrepl
│ └── test
│ ├── AnotherTestClass.class
│ ├── TestClass.class
│ └── YetAnotherTest.class
Tests are in the cider releaseIt's worth having a quick poke at https://github.com/clojure-emacs/cider-nrepl/pull/524 fixing this at the root perhaps.
Then I noticed one ticket where @stardiviner mentioned they don’t work for him and I decided to try those myself - same result.
I see that the artefact is not properly generated, but I don’t know why, and I think this has been like this for ages.
Nothing in project.clj seems off to me. Maybe @gonewest818 would have more insight into this.
sorry… I was completely offline handling a family matter last week and through the weekend. Looks like this got resolved though.
Seems this release is truly cursed. 😄 Makes me wonder I should cut it even somewhat broken just to be done with it…
It's because we're now using +
. I think leiningen's profiles have always been a little bit wonky around with-profile
and later tasks, because how can it get the right profile set?
Changing install to:
install: .source-deps
lein with-profile plugin.mranderson/config install
makes the generated pom.xml have the correct scoping for tools.nrepl> because how can it get the right profile set?
I don’t quite follow. Aren’t we supposed to be providing multiple profiles with +
normally? I can certainly issue the final release manually without the Clojure version profile, though.
There's two syntaxes that with-profile
takes. +profile
and profile
. The +
syntax is "in addition to defaults". Unless the task pipeline is run in reverse, I've never really understood what the defaults would be in cases like lein with-profile +blah do clean, deploy
Would it be the defaults of clean
or deploy
?
❯ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.17.0-NO-SNAPSHOT"} }}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'
nREPL server started on port 43749 on host 0:0:0:0:0:0:0:0 - nrepl://0:0:0:0:0:0:0:0:43749
Removed tools.nrepl from my ~/.clojure/deps.edn file.A lot of my problems with the content-types work have been around the pprint middleware which makes stupid assumptions about being the only thing which will transform the result of eval.
I suspect that a /real/ fix will involve reworking the pprint middleware and the cider-repl.el side so they always play nicely.
middleware ordering was definitely something which rendered my local testing unreliable :c
It’s not hard - the pprint middleware right now assumes that it needs to intercept the :value
produced by eval
and destroy it so that a REPL doesn’t see both the :value
response and the :pprint
output.
I’ve already got some logic in cider-repl.el to let it be smarter about whether to display the result of evaluation based on whether it’s seen pretty-printing or content-type results.
Which is why the content-type middleware doesn’t use the :value
key, it uses :body
or something else dumb to sidestep that.
Well, certainly the pprint
stuff will have to be adjusted at some point. I think the only reason why this is in its current state was to accommodate for the fucked up way in which response handling works right now. This huge single handler function that handles every type of response made sense before we used custom middlewares, but now it’s just making everything complex.
In practical terms the problem was that we needed to pretty-print results without discarding them, as traditional pretty-printing works (you don’t want to print a string and have a result that’s nil - you want to keep the result, just show it pretty).
looks like refactor nrepl is broken with the cider snapshots, something about util/cljs?
Only the snapshot of refactor-nrepl works with the snapshot of cider-nrepl right now.
For some reason they don’t do releases often these days - the last one was about a year ago.
I’m not involved in refactor-nrepl and that’s problematic as I might accidentally change something which I don’t even know they are using. Let’s just keep dreaming of 1.0 and the stability that will come with it. 😉
Also - refactor-nrepl still doesn’t defer middleware loading, so as soon as you add it to your deps the repls start 20 times slower.
I’m puzzled why this is happening as piggieback depends on tools.nrepl, so I would not have expected to have to declare the dep explicitly. Perhaps some leiningen bug?
Not to mention cider-nrepl
depends on tools.nrepl as well. All of this profile interactions feel like magic half the time.
hello, it looks like the latest cider doesn't find my tests anymore. When I run a test via cider-test-run-test
, it tells me: "No assertions (or no tests) were run.Did you forget to use ‘is’ in your tests?" Any ideas?
https://github.com/clojure-emacs/cider-nrepl/commit/cf9f3a0c98e239a6fb9ca2740ad665d129ecc17b
And the CI keeps failing… Guess it wasn’t meant to be… I’ll call it a day and revisit this release at some later point in time…
I shall fix my changes 🙂 I've spent about 4 hours enjoying some sunny reading, and it's a public holiday
I don't think there's any tests around the test op, I have a suspicion about what is up
Okay. I suspect cider-test-run-loaded-tests
is the one to run for now. Just going to test my hypothesis, I can have my fixes within the hour I suspect
It’s a public holiday here as well, but I’m actually both working and trying to ship this damn release. 😄
@bozhidar I was counting on nil
a bit too much in the test
op is all 🙂 A slight alteration to the generation of the var query will sort this 🙂
@dominicm Can you also try to run lein with-profile +1.9,+test-cljs test
? For me locally it hangs so it’s hard to test anything. I’m not sure whether moving tools.nrepl out of dev or updating piggieback broke this and the CI takes 1.5h…
@bozhidar sorry, do you know how https://github.com/clojure-emacs/cider/blob/35d72618ccf2841fb7d37dabaf03eb65795824d5/cider-test.el#L659 is encoded in the false
case?
I think it’s encoded as []
🙂 Unfortunately in Elisp there’s no boolean type and nil and an empty list are the same.
Makes sense, if you send an empty list, I treat it as an empty list in coercion. This is potentially difficult, I suppose it doesn't make much sense to send an empty :exactly
.
https://github.com/clojure-emacs/cider-nrepl/blob/59db6d9c3745de99a9d8806a5b1450d3f6cbfe30/src/cider/nrepl/middleware/test.clj#L317 I suspect this code path is always true
in the cider case then
Either way, quick fix is to put a seq
around the coercion to :exactly
. We can figure out how to fix cider.el later 😉
Looking at this bit of code it needs a lot of work, as all those whens can backfire.
In certain cases it’s fine - if you know you’re expecting a boolean, but not all the time.
I think I was generally writing code like if something is nil, false or [] else whatever, but I didn’t write all the code.
If you like, I can handle the []
case in the coercion for the load?
key, and that path can be fixed.
I'll have a look at the errors in the cljs test cases, then go shower and see what I come up with
If I revert 08e02870302d96ae2ebda0c4bca2735c3384ed75
(cider piggieback version bump) then the tests pass
Reverting cdd9450c7e034065085dc458c827a0d6307e775b
is also recommended, as it doesn't fix anything.
@bozhidar the issue seems to be that cider piggieback 0.3.1-2 doesn't support node cc/ @bhauman
Every message results in:
{:ex "class java.io.IOException", :id "4d36caef-b1a3-4dc8-89d6-6cfbe53369fc", :root-ex "class java.io.IOException", :session #{"b54a5b1f-78f5-4673-942d-1abe29cc17ab"}, :status #{"eval-error" "done"}, :err "java.io.IOException: Stream closed\n\tat java.io.BufferedWriter.ensureOpen(BufferedWriter.java:116)\n\tat java.io.BufferedWriter.write(BufferedWriter.java:221)\n\tat java.io.Writer.write(Writer.java:157)\n\tat cljs.repl.node$write.invokeStatic(node.clj:36)\n\tat cljs.repl.node$write.invoke(node.clj:35)\n\tat cljs.repl.node$node_eval.invokeStatic(node.clj:57)\n\tat cljs.repl.node$node_eval.invoke(node.clj:52)\n\tat cljs.repl.node.NodeEnv._evaluate(node.clj:211)\n\tat cljs.repl$evaluate_form.invokeStatic(repl.cljc:518)\n\tat cljs.repl$evaluate_form.invoke(repl.cljc:452)\n\tat cider.piggieback$eval_cljs.invokeStatic(piggieback.clj:124)\n\tat cider.piggieback$eval_cljs.invoke(piggieback.clj:123)\n\tat cider.piggieback$do_eval.invokeStatic(piggieback.clj:150)\n\tat cider.piggieback$do_eval.invoke(piggieback.clj:131)\n\tat cider.piggieback$evaluate.invokeStatic(piggieback.clj:173)\n\tat cider.piggieback$evaluate.invoke(piggieback.clj:171)\n\tat clojure.lang.Var.invoke(Var.java:381)\n\tat cider.piggieback$wrap_cljs_repl$fn__9356$fn__9358$fn__9359.invoke(piggieback.clj:202)\n\tat cider.piggieback$enqueue$fn__9336.invoke(piggieback.clj:106)\n\tat clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__1055.invoke(interruptible_eval.clj:190)\n\tat clojure.lang.AFn.run(AFn.java:22)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n"}
I’ll switch back to 0.3.0, so the tests would pass and we can fix this later. Guess some of the refactorings in 0.3.1 broke the node repl.
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicudata.60.1.dylib
Referenced from: /usr/local/bin/node
Reason: image not found
@nicola @r0man Would you mind testing the latest snapshot of cider-nrepl
before I make it the new stable? 🙂
@bozhidar Running all tests in a namespace seems to work fine now. But running a single tests case doesn't work for me.
(defun cider-test-run-test ()
"Run the test at point.
The test ns/var exist as text properties on report items and on highlighted
failed/erred test definitions. When not found, a test definition at point
is searched."
(interactive)
(let ((ns (get-text-property (point) 'ns))
(var (get-text-property (point) 'var)))
(if (and ns var)
;; we're in a `cider-test-report-mode' buffer
;; or on a highlighted failed/erred test definition
(progn
(cider-test-update-last-test ns var)
(cider-test-execute ns (list var)))
;; we're in a `clojure-mode' buffer
(let ((ns (clojure-find-ns))
(def (clojure-find-def)))
(if (and ns (member (car def) cider-test-defining-forms))
(progn
(cider-test-update-last-test ns (cdr def))
(cider-test-execute ns (cdr def)))
(message "No test at point"))))))
I can update cider-nrepl. Sorry, I've guessed how this op works to some degree. I can update the test op to union the namespace to the symbols automatically.
diff --git a/src/cider/nrepl/middleware/test.clj b/src/cider/nrepl/middleware/test.clj
index 46eeb72..ed57451 100644
--- a/src/cider/nrepl/middleware/test.clj
+++ b/src/cider/nrepl/middleware/test.clj
@@ -298,7 +298,7 @@
(merge msg {:var-query {:ns-query {:exactly [ns]}
:include-meta-key include
:exclude-meta-key exclude
- :exactly tests}})))
+ :exactly (map #(str ns "/" %) tests)}})))
(defn handle-test-all-op
[{:keys [load? include exclude] :as msg}]
This is the diff, it's really that simple.There's not much API surface to test & test-all, so I can't imagine there's anything else that could go wrong here (famous last words? 😁)
@bhauman Running cider-nrepl's test suite with lein with-profile +test-cljs,+1.9 test
i'm on emacs 27 and it works fine. you probably just need to have emacs 26 compiled bytecode
Seems version 0.2 is pretty old, so it’s more likely that something in Emacs broke it.
yeah my thinking is they just changed what the compiled code looks like. such that a defstruct under 25.x is not what a defstruct under 26.x expects
and i see this commit: Make cl-defstruct use records.
CommitDate: Tue Apr 4 08:23:46 2017 +0200. 056548283884d61b1b9637c3e56855ce3a17274d
I've run into it with recompiling emacs and I've solved it with just blowing away elc file
Well, we did it! Enjoy CIDER Andalucía! https://github.com/clojure-emacs/cider/releases/tag/v0.17.0

Thanks to all of your for your contributions, feedback and for just being there! You’re the heart and soul of CIDER! ❤️
Hopefully 0.17 won’t be very buggy and will be followed by smaller releases in the next few months.
I'm currently fixing the node repl problem with piggieback, had to prevent the initializing call to cljs.repl/repl to not tear down the node setup, and needed to bind out and err for initialization
Well it looks like piggieback is fixed, sorry to miss the release. @bozhidar @dominicm
I’ve spent most the working day trying to make heads or tails of this issue I’m experiencing, it’s nearly identical to this https://clojurians.slack.com/archives/C0617A8PQ/p1525088568000045 except that the resolution here didn’t work for me.
When attempting to start cljs-repl via cider-jack-in-clojurescript
I get the following error
error in process filter: cider-cljs-repl-form: Symbol's function definition is void: nil
error in process filter: Symbol's function definition is void: nil
Context: OSX, Spacemacs, Cider 0.17.0
.dir-locals.el
((nil
(cider-default-cljs-repl . figwheel+harmonium) ;; Was "Harmonium" tried also harmonium without figwheel+ and error persists
(cider-cljs-repl-types
("Harmonium" "(do (require 'figwheel-sidecar.repl-api)\n (figwheel-sidecar.repl-api/start-figwheel! \"login\" \"imageviewer\" \"harmonium\")\n (figwheel-sidecar.repl-api/cljs-repl))"))))