Fork me on GitHub
#cider
<
2018-01-24
>
xiongtx00:01:03

@bozhidar I’m going to split orchard.complete/complete into two fns, one for clj and the other for cljs. For one thing, they take different parameters.

xiongtx00:01:54

Orchard also doesn’t know if the completion environment is clj or cljs; it relies on the client to tell it (by passing in cljs-env parameter). So TBH I’m not sure what value orchard.complete provides. The client might as well use compliment and cljs-tools directly.

richiardiandrea04:01:53

I think the latter is better. In particular for completions the REPL itself could provide specific implementations. Lumo, Planck or closh all provide their own completions.

richiardiandrea04:01:00

I think that orchard is really just a container of small utils and therefore I would do the split there and let client code decide how to hook it up.

xiongtx04:01:29

What do you mean by “latter”?

dpsutton05:01:54

i think he meant the latter of the two choices to let orchard.complete handle completitions or just let the client code directly ask compliment or cljs-tools. ie, just let cider ask compliment or cljs-tools rather than go through orchard

richiardiandrea05:01:28

Yes I meant let the tool call the right thing. This actually is valid not only for cider but for inf-clojure 😄 as well. There was a mini-debate to define whether the "platform" dispatch should be inside orchard or not. My 2c opinion is no ...but it is 2c of course.

bozhidar06:01:16

I don’t think wrapping compliment in orchard adds a lot of value as well, but in general I do believe that cljs-tooling should simple be merged with it. Even at this point you can say that cider-nrepl doesn’t really have completion code in itself.

bozhidar06:01:04

@U0C8489U6 I disagree with the “small utilities” part, though. The goal at the end of the day is to provide an API to provide CIDER-like functionality for any client, regardless of how they decide to wrap orchard. E.g. if this was on the classpath for inf-clojure it could just eval a ton of functions optimized for dev tools directly and provide many extra features easily. Right now this would be just a matter of injecting it transparently when inf-clojure is invoked inside of a project (and the REPL is a Clojure one). I do want to provide more cross-platform functionality in it, though.

richiardiandrea15:01:42

Agree with you, small utilities was wrongly worded 😉

benedek09:01:11

haha bug sorry for that. we should consume some of that cider together at some point

qqq10:01:44

what is triggering the cider warning face, and how do I disable it?

mgrbyte11:01:41

@qqq I'm guessing your're using flycheck? If so then it'll be clojure-mode/cider's integration with that. If so, you could look at the variable flycheck-enabled-checkers to see what it's currently set to

qqq11:01:07

@mgrbyte: I'm not using flycheck.

qqq11:01:26

Apparently, if I execute via C-x C-e, and the repl has a warning, then the expr gets the yellow squiggly line.

bozhidar11:01:58

Yeah, that’s true.

bozhidar11:01:23

If compilation produces warnings the line in questions gets highlighted.

bozhidar11:01:32

I not sure if this was something configurable or not.

bozhidar12:01:52

If you want you can simply unset the warnings face I guess.

bozhidar12:01:27

Generally highlighting errors and warnings seemed desirable for everyone, therefore the lack of configuration options for this.

benedek17:01:06

i am getting this error when trying to run cider-nrepl tests (clj) locally

Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
Exception in thread "main" java.io.FileNotFoundException: Could not locate orchard/apropos__init.class or orchard/apropos.clj on classpath., compiling:(cider/nrepl/middleware/apropos_test.clj:1:1)
	at clojure.lang.Compiler.load(Compiler.java:7239)
	at clojure.lang.RT.loadResourceScript(RT.java:371)

benedek17:01:22

same on travis

benedek17:01:36

perhaps cider-nrepl and orchard out of sync?

benedek17:01:08

or just orchard latest in not on clojars?

benedek17:01:12

nope, not that. cider-nrepl tests are referring to orchard namespaces. don’t think that will work when you are running lein with-profile +1.8,+plugin.mranderson/config,+test-clj test or similar as orchard stuff is inlined

benedek17:01:39

those tests referring to orchard namespaces should go to orchard i guess?

benedek17:01:59

i suppose you can’t really reach into depencies from tests if you use mranderson

bozhidar17:01:59

My bad. I generally run the tests without MrAnderson. I’ll fix it in a bit.

benedek17:01:05

no worries

bozhidar17:01:19

The test is not actually specific to orchard, it just rebinds one of the deps.

benedek17:01:05

the good news that after commenting out all orchard related tests and playing with mranderson a bit to inline a not “resolved” dep graph (so transient deps are duplicated all over the graph) the tests are passing

bozhidar17:01:34

Isn’t there just one of those?

benedek17:01:36

i have not checked how much bigger the uberjar gets or how slower cider-nrepl gets either

benedek17:01:47

have not checked that either 😉

bozhidar17:01:55

The bad news is that even if I remove the explicit ns in this test you mentioned it still fails, which puzzles me.

benedek17:01:56

also have not tested with refactor-nrepl

benedek17:01:13

there is a reference to orchard in the body of the ns too 😉

bozhidar17:01:26

But that’s normal.

bozhidar17:01:54

I keep referring to all sorts of libraries in test bodies - not sure how I’m supposed to avoid it if I need those functions in the tests.

benedek17:01:20

unfortunately you can’t refer anything from orchard anywhere

benedek17:01:37

it is just not there with mranderson becuase of the prefixing

bozhidar17:01:20

Isn’t it supposed to just be there with a changed namespace?

benedek17:01:20

modified:   test/clj/cider/nrepl/middleware/apropos_test.clj
	modified:   test/clj/cider/nrepl/middleware/classpath_test.clj
	modified:   test/clj/cider/nrepl/middleware/info_test.clj
	modified:   test/clj/cider/nrepl/middleware/inspect_test.clj
	modified:   test/clj/cider/nrepl/middleware/refresh_test.clj
	modified:   test/clj/cider/nrepl/middleware/track_state_test.clj
	modified:   test/clj/cider/nrepl/middleware/util/instrument_test.clj

benedek17:01:41

but mranderson does not rewrite the test namespaces

benedek17:01:53

above the list of offending test namespaces

benedek17:01:37

tbh you can argue that your tests should not know about your library’s dependencies and should only use the API of your lib

benedek17:01:55

but i understand you are redefing and the like

bozhidar17:01:16

Yeah, I get this, but this would mean just adding dummy API to stub. 🙂

benedek17:01:18

yeah, true. can’t you kinda move those tests or the gist of them to orhcard itself. have not really tried to understand them to be fair

xiongtx21:01:34

Seems to me that CIDER should only test the transport. Functionality should be tested in Orchard.

bozhidar17:01:18

It will require some work. It’s completely doable, but I just won’t have time for this soon.

benedek17:01:03

fair. i managed what i wanted: have a running test set which i can use to prove that mranderson changes are good

benedek17:01:14

so no rush on my side really

benedek17:01:01

and i will also have refactor-nrepl tests for the same thing. so i am good. no pressure

bozhidar17:01:35

Btw, why doesn’t MrAnderson rewrite the test namespaces as well?

dpsutton17:01:04

they aren't in a production build?

dpsutton17:01:29

no reason to shield from other people's code if they aren't ever going to touch other people's code?

benedek17:01:33

yeah why should it?

bozhidar17:01:08

Ah, yeah - silly me.

dpsutton17:01:44

ah, we should have a dir locals file that cranks CIDER up with the right profiles for testing when developing so the CIDER test runner can run them

dpsutton17:01:59

then we wouldn't have to worry about all of the people wondering why there don't seem to be any tests run with lein test

bozhidar18:01:17

Mine lein mojo is bad, but I guess it’s not hard to specify some default profile.

dpsutton18:01:09

((nil . ((cider-lein-global-options . "with-profile dev")
         )))
for my work project

dpsutton18:01:25

ah misread that

bozhidar18:01:39

I meant this should be fixed in project.clj.

bozhidar18:01:15

I’ve fixed 3/8 of the failing tests, but I have to wrap it for today and I’d love to solicit some help from all of you https://github.com/clojure-emacs/cider-nrepl/issues/489 Fixing those shouldn’t be hard/take long. Thanks in advance!

benedek19:01:12

just for the curios. here is cider-nrepl’s not resolved deps graph (without org.clojure/java.classpath as a first level dependency)

benedek19:01:19

{[cider/orchard
  "0.1.0-20180123.122522-8"
  :exclusions
  [[org.clojure/clojure]]]
 {[org.clojure/java.classpath
   "0.2.3"
   :exclusions
   [[org.clojure/clojure]]]
  nil,
  [org.clojure/tools.namespace
   "0.3.0-alpha4"
   :exclusions
   [[org.clojure/clojure]]]
  {[org.clojure/java.classpath "0.2.3"] nil,
   [org.clojure/tools.reader "0.10.0"] nil},
  [org.tcrawley/dynapath "1.0.0" :exclusions [[org.clojure/clojure]]]
  nil},
 [cljfmt
  "0.5.7"
  :exclusions
  [[org.clojure/clojure] [org.clojure/clojurescript]]]
 {[org.clojure/tools.reader "1.0.0-alpha4"] nil,
  [rewrite-clj "0.5.2"] nil,
  [rewrite-cljs "0.4.3"] nil},
 [cljs-tooling "0.2.0" :exclusions [[org.clojure/clojure]]] nil,
 [compliment "0.3.5" :exclusions [[org.clojure/clojure]]] nil,
 [fipp "0.6.12" :exclusions [[org.clojure/clojure]]]
 {[org.clojure/core.rrb-vector "0.0.11"] nil},
 [mvxcvi/puget "1.0.2" :exclusions [[org.clojure/clojure]]]
 {[fipp "0.6.10"] {[org.clojure/core.rrb-vector "0.0.11"] nil},
  [mvxcvi/arrangement "1.1.1"] nil},
 [org.clojure/tools.namespace
  "0.3.0-alpha4"
  :exclusions
  [[org.clojure/clojure]]]
 {[org.clojure/java.classpath "0.2.3"] nil,
  [org.clojure/tools.reader "0.10.0"] nil},
 [org.clojure/tools.reader "1.1.1" :exclusions [[org.clojure/clojure]]]
 nil,
 [org.clojure/tools.trace "0.7.9" :exclusions [[org.clojure/clojure]]]
 nil}

benedek19:01:43

whoops, pasted the wrong graph first. this should be the right one now

bozhidar20:01:42

@benedek what’s the difference in the final artefact in terms of size?

benedek21:01:21

have not checked yet

xiongtx21:01:39

@bozhidar @benedek I’m not sure why we can’t use Orchard in the tests. Why not run tests w/out the mranderson profile?

xiongtx21:01:42

But I do think that, as a long-term goal, CIDER should only test client functionality: https://clojurians.slack.com/archives/C0617A8PQ/p1516828054000552?thread_ts=1516815558.000036&amp;cid=C0617A8PQ

benedek22:01:40

u can run them w/o mranderson ofc. but running them w/ it makes sure that it will work as it is distributed to its users

xiongtx00:01:56

We’ve a sort of 🐔-and-🥚 problem here: many namespaces, e.g. info, have not been ported to Orchard. Their tests, therefore, include tests for things that should be moved into Orchard. We can’t very well remove Orchard dependency when some of the functionality is in Orchard and some in cider-nrepl. My vote is for running tests w/out mranderson, at least until the Orchard port is complete. I can’t think of any reason why this’d be a problem. @benedek What is a scenario in which not testing w/ mranderson could lead to tests passing on CI but the artifact not working for the user?

xiongtx00:01:39

Philosophically, there should be nothing we cannot use in the tests that we use in the src. mranderson’s impact should purely be on the distribution of the artifact--we apply it to prevent tooling deps from affecting user’s project deps. For mranderson to impact the way we develop and test the project is an anti-pattern.

benedek05:01:44

what you really test if you test w/ mranderson is that everything works fine with inlined deps. there are corner cases mranderson does not handle (well). re. antipattern: I hear you, you have a point there, on the other hand this forces you to only refer to your lib's API in your tests, makes stubbing more difficult these are essentially good things ;)

xiongtx09:01:38

I don't get the "making stubbing more difficult is good" part. Yes, cider-nrepl tests should only test cider-nrepl API--that doesn't mean the tests shouldn't be able to make use of functions in a dep.

xiongtx09:01:37

The other option would be to have mranderson rewrite the namespaces in test files. In any case, src and test should have access to the same deps.

xiongtx19:01:29

I’ve created https://github.com/clojure-emacs/cider-nrepl/pull/493 to remove mranderson from test profiles.

benedek11:01:27

fair. but extra care is needed at release time so no broken inlined version of the artifact gets shipped

zlrth21:01:45

what workarounds do people have for cider/emacs freezing when printing long-sequences of data? disabling font-lock-mode only goes so far for me. it takes ~20 very-long-feeling seconds to print 2 megabytes of data to the terminal. cider-interrupt doesn't seem to work for printing long strings. things like this? https://github.com/clojure-emacs/cider/issues/1934

zlrth21:01:49

it'd be pretty cool to have the repl output a link to an html file that has the large output. or a global variable for the maximum number of characters printed per eval

benedek22:01:00

there is such a global var for the REPL not cider specific I think

benedek22:01:02

search for print-length

zlrth22:01:42

oy! thanks @benedek. it says print-length sets the length of the number of items in a collection to be printed. if each of those items is large, the repl would still lock up. i wonder if there's a way to set it to a number of characters?