tools-deps

magra 2025-04-01T09:20:23.973959Z

FreeBSD keeps installed ports and packages in unix system resource directories like e.g. /usr/local/openjdk21. Deps.edn warns that these paths are deprecated when I include e.g. javafx. Will this be kept as a warning or are there plans to actually refuse use of unix system resources?

Alex Miller (Clojure team) 2025-04-01T11:36:47.963769Z

Can you share the error and your deps.edn?

magra 2025-04-02T08:00:29.641309Z

The warning is WARNING: Use of :paths external to the project has been deprecated, please remove: I believe from here: https://github.com/clojure/tools.deps/blob/6014860529dcd0f5b31907c67c307b2555ee80d1/src/main/clojure/clojure/tools/deps.clj#L563 The warning does not reliably appear on every start, but at least when I think it is gone 😉

{:paths ["src/main" "resources" "classes"]
 :deps  {org.clojure/clojure               {:mvn/version "1.12.0"}
         nrepl/nrepl                       {:mvn/version "1.3.1"}
         cider/cider-nrepl                 {:mvn/version "0.53.2"}
         nrepl/bencode                     {:mvn/version "1.2.0"}
         com.fulcrologic/fulcro            {:mvn/version "3.8.3"}
         com.fulcrologic/fulcro-websockets {:mvn/version "3.4.0"}
         com.fulcrologic/guardrails        {:mvn/version "1.2.9"}
         com.taoensso/sente                {:mvn/version "1.20.0"}
         com.taoensso/timbre               {:mvn/version "6.6.1"}
         com.taoensso/tufte                {:mvn/version "2.6.3"}}
:aliases
{... many aliases ...

 :flow-storm-ui
  
  {:extra-deps  {com.github.flow-storm/flow-storm-dbg {:mvn/version "4.3.0"}}
   :jvm-opts    ["-Dflowstorm.fileEditorCommand=emacsclient -n +<<LINE>>:0 <<FILE>>"
                 "-Dflowstorm.jarEditorCommand=emacsclient --eval '(let ((b (cider-find-file \"jar:file:<<JAR>>!/<<FILE>>\"))) (with-current-buffer b (switch-to-buffer b) (goto-char (point-min)) (forward-line (1- <<LINE>>))))'"]
   :extra-paths ["/usr/local/openjfx14/lib/javafx.base.jar"
                 "/usr/local/openjfx14/lib/javafx.graphics.jar"
                 "/usr/local/openjfx14/lib/javafx.controls.jar"
                 "/usr/local/openjfx14/lib/javafx.web.jar"]}
  ... more aliases ...}}
Should I refer to unix system recources somewhere else or in a different way?

magra 2025-04-02T08:14:49.355629Z

I sometimes start via shadow-cljs, sometimes via clj and have not payed enough attention to reliably tell when it shows up and when it does not. I saw it twice yesterday but so far not today.

2025-04-01T20:40:52.352439Z

Is there some way to use an alias in another one? I swear I read about something similar to this where the :test alias can reuse the deps from :some-feature.

{
 :aliases {:some-feature {:extra-deps {,,,}}
           :test [:some-feature {:extra-deps {,,,}}]}
 }

seancorfield 2025-04-01T20:59:07.860669Z

:paths is the only thing that can use aliases-as-data I believe. Tools and programs running from the CLI can programmatically get the basis and manipulate data from aliases as needed (after the classpath etc has been setup by the CLI).

seancorfield 2025-04-01T21:00:18.325059Z

You can always provide multiple aliases on the command line (or programmatically inside your tool/program using tools.deps as a library).

2025-04-01T21:48:18.124939Z

right, yeah I'll add the aliases to bb.edn. At least I wasn't totally imagining it. Maybe it would be good to mention that in the docs here? https://clojure.org/reference/deps_edn#aliases

seancorfield 2025-04-01T23:27:51.096839Z

https://clojure.org/reference/deps_edn#paths talks about it (and is the only entry in deps.edn that mentions using aliases as data within the CLI): Paths are declared in a top level key :paths and are a collection of string paths or alias names. Alias names refer to a collection of paths defined in an alias (this can be done for reuse). And the aliases section says: Aliases give a name to a data structure that can be used either by the Clojure CLI itself or other consumers of deps.edn. At the top of that page it says: Tools can access alias data via the basis at runtime, or programatically via tools.deps. If you have a specific suggestion for improvements, you could write up an http://ask.clojure.org question about it.