This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-03
Channels
- # announcements (55)
- # babashka (14)
- # beginners (49)
- # biff (9)
- # calva (73)
- # cider (14)
- # clerk (8)
- # clj-kondo (6)
- # clojure (92)
- # clojure-dev (4)
- # clojure-europe (18)
- # clojure-norway (62)
- # clojure-uk (5)
- # clojuredesign-podcast (4)
- # clojurescript (34)
- # cursive (40)
- # data-science (4)
- # datomic (5)
- # dev-tooling (1)
- # eastwood (6)
- # emacs (107)
- # figwheel-main (9)
- # fulcro (13)
- # gratitude (9)
- # hyperfiddle (5)
- # introduce-yourself (2)
- # off-topic (45)
- # overtone (23)
- # portal (5)
- # releases (3)
- # shadow-cljs (6)
- # specter (1)
- # squint (32)
- # timbre (4)
- # vscode (2)
I don't know if this is a Cursive thing or an IntelliJ thing, but I have my editor split left-right with the REPL on the right and sometimes when I resize the partition to assign more width to the REPL, the left editor half in resizing looses its position, the current line moves somewhere else. It's a minor annoyance but it would be nice if it resized and kept the same position.
I have a problem when using IntelliJ on a deps.edn multi-project. The repo is public: https://github.com/pedestal/pedestal Essentially, I have the sub-modules cross-wired to each other using the last published version:
io.pedestal/pedestal.log {:mvn/version "0.6.0"}
io.pedestal/pedestal.metrics {:mvn/version "0.6.0"}
io.pedestal/pedestal.interceptor {:mvn/version "0.6.0"}
io.pedestal/pedestal.route {:mvn/version "0.6.0"}
but of course, when I'm developing, I need the "live" versions, so:
:aliases
{:local
{:override-deps {io.pedestal/pedestal.log {:local/root "../log"}
io.pedestal/pedestal.metrics {:local/root "../metrics"}
io.pedestal/pedestal.interceptor {:local/root "../interceptor"}
io.pedestal/pedestal.route {:local/root "../route"}}}
That works fine for the command line, but I think Cursive is evaluating the links from the wrong location (the project root, not the sub-module), so I when I enable my :local
alias I get errors:
The following errors were found during project resolve: /Users/howard.lewisship/workspaces/github/pedestal/aws/deps.edn: Local lib io.pedestal/pedestal.log not found: ../log /Users/howard.lewisship/workspaces/github/pedestal/interceptor/deps.edn: Local lib io.pedestal/pedestal.log not found: ../log
Which modules do you have added? I’ve added aws, interceptor, jetty, log, pedestal, route, service and service-tools. I’m seeing errors like:
The following errors were found during project resolve: /Users/colin/dev/pedestal/jetty/deps.edn: The following libs must be prepared before use: [io.pedestal/pedestal.service] /Users/colin/dev/pedestal/service-tools/deps.edn: The following libs must be prepared before use: [io.pedestal/pedestal.service]
You need to do a prep in the service module first; it has a Java class that the prep compiles.
I'm about to go OOTO and may be spottily reachable as I'm flying to Sao Paolo this weekend.
I’m doing for dir in aws interceptor jetty log route service service-tools; echo $dir; cd $dir; clj -X:deps:local prep; cd ..; end
(in fish shell), and I’m not seeing any target dirs created.
Ok, I had another quick go. I managed to build manually: clj -T:build compile-java
in service. And once I do that, I can sync the whole project, even with the local alias selected. And when I select and deselect the local alias, I see the deps correctly changing from library deps to module deps. Which version of Cursive are you using?
You're right about the build target; it's likely broken on CI and I do deploy builds locally.
I looks like I can make it work by using full paths, i.e., :local/root "/Users/workspaces/github/pedestal/log
, but that doesn't work on CI or on other dev's computers.
I think this is actually a tools.deps bug that I was working on last week https://clojure.atlassian.net/browse/TDEPS-256
I'm almost done with it, still testing some things, may have a chance to get it integrated later today
really depends which api paths you're going through
if your current directory is the project directory, that should be fine (the CLI basically requires this). I'm guessing the Java current directory is at the project root when Cursive is doing whatever creates the basis in this case (not in the subdir)
Ok, let me know if this does look like a Cursive bug in the end. Under Cursive the CWD will be the IntelliJ CWD, and Cursive handles this using *the-dir*
.
do you ever call tools.deps/create-basis and pass :project ?
Now I delegate everything to deps.clj. So I call deps.clj, and when that needs to call deps it passes me the args for make-classpath2 and I just call that directly. The only bit that I’ve vendored into Cursive from that is -main, to avoid it calling System/exit:
; Code from clojure.tools.deps.alpha.script.make-classpath2/-main, to avoid System/exit
(let [{:keys [options errors]} (make-classpath/parse-opts args)]
(if (seq errors)
; TODO error handling
(run! println errors)
(make-classpath/run options)))
(catch Throwable t
(throw (RuntimeException. (str :cursive.deps.project/resolve-exception
":"
(.getMessage t))))))))))))
and you're setting the-dir to the project directory around that?
if so, then I don't think the error I mentioned above is relevant
there have been problems like this resolved long ago, so I'm assuming recent versions of CLI, tools.deps etc
Yes, I only support the last couple of versions of deps.clj because borkdude made some changes to support the integration.
Example: from the interceptor
sub-dir:
> clj -Spath | sed 's/:/\n/g'
src
/Users/howard.lewisship/.m2/repository/io/pedestal/pedestal.log/0.6.0/pedestal.log-0.6.0.jar
/Users/howard.lewisship/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.async/1.6.673/core.async-1.6.673.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.match/1.0.1/core.match-1.0.1.jar
/Users/howard.lewisship/.m2/repository/io/dropwizard/metrics/metrics-core/4.2.18/metrics-core-4.2.18.jar
/Users/howard.lewisship/.m2/repository/io/dropwizard/metrics/metrics-jmx/4.2.18/metrics-jmx-4.2.18.jar
/Users/howard.lewisship/.m2/repository/io/opentracing/opentracing-api/0.33.0/opentracing-api-0.33.0.jar
/Users/howard.lewisship/.m2/repository/io/opentracing/opentracing-util/0.33.0/opentracing-util-0.33.0.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar
/Users/howard.lewisship/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar
/Users/howard.lewisship/.m2/repository/org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2.jar
/Users/howard.lewisship/.m2/repository/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar
/Users/howard.lewisship/.m2/repository/io/opentracing/opentracing-noop/0.33.0/opentracing-noop-0.33.0.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.memoize/1.0.253/core.memoize-1.0.253.jar
/Users/howard.lewisship/.m2/repository/org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar
/Users/howard.lewisship/.m2/repository/org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.jar
/Users/howard.lewisship/.m2/repository/org/ow2/asm/asm/9.2/asm-9.2.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.cache/1.0.225/core.cache-1.0.225.jar
/Users/howard.lewisship/.m2/repository/org/clojure/data.priority-map/1.1.0/data.priority-map-1.1.0.jar
> clj -Spath -X:local | sed 's/:/\n/g'
src
/Users/howard.lewisship/workspaces/github/pedestal/log/src
/Users/howard.lewisship/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.async/1.6.673/core.async-1.6.673.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.match/1.0.1/core.match-1.0.1.jar
/Users/howard.lewisship/.m2/repository/io/dropwizard/metrics/metrics-core/4.2.19/metrics-core-4.2.19.jar
/Users/howard.lewisship/.m2/repository/io/dropwizard/metrics/metrics-jmx/4.2.19/metrics-jmx-4.2.19.jar
/Users/howard.lewisship/.m2/repository/io/opentracing/opentracing-api/0.33.0/opentracing-api-0.33.0.jar
/Users/howard.lewisship/.m2/repository/io/opentracing/opentracing-util/0.33.0/opentracing-util-0.33.0.jar
/Users/howard.lewisship/.m2/repository/org/slf4j/slf4j-api/2.0.7/slf4j-api-2.0.7.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar
/Users/howard.lewisship/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar
/Users/howard.lewisship/.m2/repository/org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2.jar
/Users/howard.lewisship/.m2/repository/io/opentracing/opentracing-noop/0.33.0/opentracing-noop-0.33.0.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.memoize/1.0.253/core.memoize-1.0.253.jar
/Users/howard.lewisship/.m2/repository/org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar
/Users/howard.lewisship/.m2/repository/org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.jar
/Users/howard.lewisship/.m2/repository/org/ow2/asm/asm/9.2/asm-9.2.jar
/Users/howard.lewisship/.m2/repository/org/clojure/core.cache/1.0.225/core.cache-1.0.225.jar
/Users/howard.lewisship/.m2/repository/org/clojure/data.priority-map/1.1.0/data.priority-map-1.1.0.jar
deps.edn:
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/core.async {:mvn/version "1.6.673"}
io.pedestal/pedestal.log {:mvn/version "0.6.0"}
;; Error interceptor tooling
org.clojure/core.match {:mvn/version "1.0.1"
:exclusions [org.clojure/clojurescript]}}
:aliases
{:local
{:override-deps {io.pedestal/pedestal.log {:local/root "../log"}}}}}