This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-09
Channels
- # announcements (4)
- # aws (3)
- # babashka (86)
- # babashka-sci-dev (31)
- # beginners (171)
- # biff (15)
- # calva (3)
- # clerk (47)
- # cljdoc (11)
- # clojure (59)
- # clojure-dev (11)
- # clojure-europe (122)
- # clojure-losangeles (1)
- # clojure-nl (2)
- # clojure-norway (4)
- # clojure-uk (2)
- # clojurescript (40)
- # cursive (5)
- # data-science (3)
- # datahike (1)
- # datomic (5)
- # fulcro (9)
- # graalvm (8)
- # hyperfiddle (17)
- # introduce-yourself (1)
- # java (28)
- # jobs (1)
- # malli (11)
- # membrane (9)
- # missionary (1)
- # nbb (1)
- # off-topic (5)
- # other-languages (1)
- # pedestal (1)
- # re-frame (4)
- # reagent (16)
- # releases (3)
- # remote-jobs (3)
- # shadow-cljs (83)
- # spacemacs (1)
- # sql (5)
- # tools-deps (28)
- # xtdb (15)
What would be the most straightforward way to run with a custom version of tools.deps
? I’ve tried using replace-deps
with my local root like so: :aliases {:deps {:replace-deps {org.clojure/tools.deps {:local/root "_____/tools.deps"}}}
. I’ve seen other mentions of replacing deps this way elsewhere in this channel (https://clojurians.slack.com/archives/C6QH853H8/p1607026303165100).
However, although I’ve added printlns and file I/O in a number of places in my copy of tools.deps
to verify my custom version is working, I don’t observe any of my expected output.
I was hoping that running with one of the following would execute using my custom version:
clj -Stree
clj -A:deps -Stree
Is what I am attempting possible?@U08TWB99B Your question can mean several things. Do you want the clojure CLI itself to use your fork, or do you want your build.clj
to use your tools deps fork
the clojure CLI uses a pre-built uberjar containing tools.deps. It doesn't use a version that is described in your deps.edn
. But you should see that custom version in clj -Stree
e.g. if you would do:
clj
(require '[clojure.tools.deps])
it should end up using your forkTo avoid confusion, I would recommend using a different alias for testing, since :deps
is a built-in alias in the "root" deps.edn
(which is inside tools.deps
).
@U04V15CAJ But would that happen before dependencies are resolved? In particular, what I’m trying to do is add some sort of offline mode for git dependency resolution. My work VPN is causing me serious headaches accessing off-VPN git libs, and they change so infrequently that I would be okay running with cached versions for periods of time.
So, if tools.deps
is bundled in the uberjar, I’m thinking I’ll need to build that. I have tried poking around to figure out where that is built, but I haven’t figured that out yet, either.
if it helps, here is a re-implementation of the bash portion of the CLI: https://github.com/borkdude/deps.clj but it still downloads the uberjar from http://clojure.org
with clj -T:build release
the uber jar ends up in target/clojure-tools-<version>.jar
but this is not a sustainable path to an environment, really only suitable to testing something
depending on your scenario, you may be able to solve this with the existing git support
which supports local file path git repos
but it depends how much git stuff you are depending on and whether those have transitive git deps too
well you can rewrite git urls in git itself
look up insteadOf
you should be able to set git config that rewrites your external git urls to local git urls. because tools.deps (really tools.gitlibs) uses git, it will also use that
just as a meta observation - start with the actual problem here :)
"My work VPN is causing me serious headaches accessing off-VPN git libs, and they change so infrequently that I would be okay running with cached versions for periods of time." is a good problem statement :)
and just fyi, there are also tools that do this sort of thing at an enterprise level (just like they do with maven repos), and I would very much like to support those well eventually, not just for performance but for enterprise control/threat containment