This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-02
Channels
- # announcements (21)
- # bangalore-clj (1)
- # beginners (122)
- # calva (29)
- # cider (9)
- # cljdoc (1)
- # cljs-dev (7)
- # cljsrn (1)
- # clojure (84)
- # clojure-dev (11)
- # clojure-europe (2)
- # clojure-houston (2)
- # clojure-italy (31)
- # clojure-nl (5)
- # clojure-uk (37)
- # clojuredesign-podcast (3)
- # clojurescript (14)
- # cursive (66)
- # data-science (5)
- # datavis (1)
- # datomic (6)
- # fulcro (16)
- # graphql (4)
- # jobs (2)
- # music (1)
- # off-topic (20)
- # pedestal (1)
- # re-frame (2)
- # reagent (2)
- # shadow-cljs (155)
- # spacemacs (5)
- # tools-deps (5)
- # vim (8)
- # yada (1)
@cfleming Just installed new dev version. Everything looks good.
Now that https://youtrack.jetbrains.com/issue/IDEA-91607 is closed, what would be the best way to move forward? Maybe a new issue with some Cursive-specific details?
Sure, similar to that issue, if you file issues for specific problems I’ll look at them. Depending on what they are, I may or may not be able to fix them though.
As I mentioned in the next to last comment on that issue - you've mentioned before that you have no control over the order of orderEntry
tags.
@cfleming Seems like they think otherwise: https://youtrack.jetbrains.com/issue/IDEA-221903#focus=streamItem-27-3681725.0-0
"So it looks like this problem is caused by code in Cursive plugin which adds entries to com.intellij.openapi.roots.ModifiableRootModel
in different order"
@U2FRKM4TW I actually don’t think that’s correct since I’m using their internal API to do that, but no matter because the new deps integration will be out shortly and I can control these things there. I’ve asked for some clarification on that issue.
@cfleming I have a large multi-module project. I tried updating to that dev build. IntelliJ did the usual restart thing and started loading. It's been stuck at about 75% loading for a solid 5 mins. When I mouse over the IntelliJ loading splash screen, the mouse is the spinner wheel. Will let it sit there for a while to see if it's just slow at resolving this big project.
Looks like it finished after ~15 mins. Perhaps this is caveat #2 where it refreshes every module?
Received this exception after refreshing deps. It'd be great if it could tell me which project this is coming from.
clj -Stree should tell you
that should exist though, so might be a clojars issue
Right but I'm working in a large multi-module repo (20+ libs). Cursive simply reported that error with no info about which project that came from.
Another thing with the Clojure Deps REPL. When using "Run with Deps", can Cursive use the .cpcache
files? It acts like it needs to calculate the classpath every time I open a REPL.
it should, but I don't know what Cursive does
I can’t easily use the .cpcache because I’d have to reproduce everything that the script does in Java/Clojure/Kotlin.
I did look at that, but I couldn’t find a Java implementation of the hashing command used (cksum).
And I can’t just invoke the script because I can’t get everything I need from the various script commands (I can’t remember off the top of my head what was missing).
Maybe. It’s still very brittle though, the script has a lot of non-trivial logic in it. If I reproduce it all, it’s very tied to a particular version of the script.
One thing I can do is just use a similar mechanism, but not try to use the same .cpcache
that deps does.
One thing though, that bit hasn’t changed in this version, it worked the same way in the previous integration (in fact, that code didn’t change at all).
Some sort of workaround would be a big win here. REPL restarts can take 30s or more due to the cp calculation. Sounds like the solution is either 1) add the necessary commands to the clj script 2) implement a Cursive specific cache
Part of it has to do with S3 being slow, I think. Alex made it a bit better with the most recent release.
I remember timing it and Cursive seemed to be about 3-5s slower than resolving via the CLI. This project just takes a while to calculate though. Having to calculate it each repl start even though nothing changed is painful.
cksum is not at all important, was just picked b/c it's fast, easy, and ubiquitous. you could totally hash it however you like and store it in cpcache anyways
Then the Cursive caching and the command line caching would stomp each other. I’ll just store the cached version for Cursive elsewhere.
You could use a known prefix or something to separate the cursive files in the cache dir
I would vote for shelling out too, just to minimize the differences in behaviour between cursive and the cli tools.
I just worked on some mobile app reverse engineering recently, so I had to deal with unknown protobuf structures as binary data, so I just wrapped xxd
and protoc --decode_raw
into functions:
(defn encode [data] (shell/run "xxd" "-g1" :in data))
(defn decode [data] (shell/run "xxd" "-r" "-g1" :in data :out-enc :bytes))
(defn protoc->raw [pb] (shell/run "protoc" "--decode_raw" :in pb))
where shell/run
is just a little error handling and direnv
support on top of clojure.java.shell/sh
:
(defn run
"Use `direnv exec` to ensure the `.envrc` & `shell.nix` environments are available"
[& args]
(let [cwd (.getCanonicalPath (io/file "."))
{:keys [out err exit] :as res} (apply sh "direnv" "exec" cwd args)]
(if-not (zero? exit)
(-> (str "Error running `" args "`\n" out err)
(ex-info res)
throw)
(if (string? out)
(str/trim-newline out)
out))))
it's so bad that direnv
support is missing from intellij...
makes it a lot harder to use nix under macos 😞
IntelliJ (and specifically Cursive) does support https://github.com/ashald/EnvFile, is that useful?
It’s a similar idea, but not as extensive. Nor does it work with all direnv setups, if I’m reading it correctly.
Yeah. I looked at EnvFile when Cursive added support for it. EnvFile doesn't quite check all the boxes that direnv does.
http://repo.clojars.org/conormcd/clj-honeycomb/1.0.6.536/ seems to exist and I can download it
Yep. Just some feedback from Colin 🙂 Yeah, not sure what's going on with that artifact. Could be a bug in this dev build.
but clojars has had some weirdness this weekend
Can I create my own stubs?
@kenny I think there must be something else going on there, I have users using 80+ module projects with lein and (although it’s not especially pleasant) it does work ok.