deps-new

Daniel Miladinov 2023-10-15T14:34:22.011209Z

I want to start a new library project and I googled around and found deps-new. Following the README, I ran the first line, and got this:

$ clojure -Ttools install-latest :lib io.github.seancorfield/deps-new :as new
Execution error (ExceptionInfo) at clojure.tools.deps.extensions.git/eval1534$fn (git.clj:144).
No known ancestor relationship between git versions for io.github.seancorfield/deps-new
   at a0c510000e18f92abf82d918b0a207ee073b6e71
   at c899135de0089059a2770efe79c5022ad874741a

Full report at:
/var/folders/9q/j3dlhz0n6kd_nwk3_bvg_yc00000gn/T/clojure-8838877447435868170.edn
Here are the contents of /var/folders/9q/j3/var/folders/9q/j3dlhz0n6kd_nwk3_bvg_yc00000gn/T/clojure-8838877447435868170.edn:
{:clojure.main/message
 "Execution error (ExceptionInfo) at clojure.tools.deps.extensions.git/eval1534$fn (git.clj:144).\nNo known ancestor relationship between git versions for io.github.seancorfield/deps-new\n   at a0c510000e18f92abf82d918b0a207ee073b6e71\n   at c899135de0089059a2770efe79c5022ad874741a\n",
 :clojure.main/triage
 {:clojure.error/class clojure.lang.ExceptionInfo,
  :clojure.error/line 144,
  :clojure.error/cause
  "No known ancestor relationship between git versions for io.github.seancorfield/deps-new\n   at a0c510000e18f92abf82d918b0a207ee073b6e71\n   at c899135de0089059a2770efe79c5022ad874741a",
  :clojure.error/symbol clojure.tools.deps.extensions.git/eval1534$fn,
  :clojure.error/source "git.clj",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.ExceptionInfo,
    :message
    "No known ancestor relationship between git versions for io.github.seancorfield/deps-new\n   at a0c510000e18f92abf82d918b0a207ee073b6e71\n   at c899135de0089059a2770efe79c5022ad874741a",
    :data
    {:x
     {:git/tag "v1.2.381",
      :git/sha "a0c510000e18f92abf82d918b0a207ee073b6e71",
      :git/url ""},
     :y
     {:git/tag "v0.5.3",
      :git/sha "c899135de0089059a2770efe79c5022ad874741a",
      :git/url ""}},
    :at
    [clojure.tools.deps.extensions.git$eval1534$fn__1535
     invoke
     "git.clj"
     144]}],
  :trace
  [[clojure.tools.deps.extensions.git$eval1534$fn__1535
    invoke
    "git.clj"
    144]
   [clojure.lang.MultiFn invoke "MultiFn.java" 244]
   [clojure.tools.tools.api$install_1 invokeStatic "api.clj" 81]
   [clojure.tools.tools.api$install_1 invoke "api.clj" 74]
   [clojure.tools.tools.api$install_latest invokeStatic "api.clj" 121]
   [clojure.tools.tools.api$install_latest invoke "api.clj" 90]
   [clojure.lang.Var invoke "Var.java" 384]
   [clojure.run.exec$exec invokeStatic "exec.clj" 89]
   [clojure.run.exec$exec invoke "exec.clj" 78]
   [clojure.run.exec$_main$fn__220 invoke "exec.clj" 228]
   [clojure.run.exec$_main invokeStatic "exec.clj" 224]
   [clojure.run.exec$_main doInvoke "exec.clj" 192]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.core$apply invokeStatic "core.clj" 667]
   [clojure.main$main_opt invokeStatic "main.clj" 514]
   [clojure.main$main_opt invoke "main.clj" 510]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause
  "No known ancestor relationship between git versions for io.github.seancorfield/deps-new\n   at a0c510000e18f92abf82d918b0a207ee073b6e71\n   at c899135de0089059a2770efe79c5022ad874741a",
  :data
  {:x
   {:git/tag "v1.2.381",
    :git/sha "a0c510000e18f92abf82d918b0a207ee073b6e71",
    :git/url ""},
   :y
   {:git/tag "v0.5.3",
    :git/sha "c899135de0089059a2770efe79c5022ad874741a",
    :git/url ""}}}}

seancorfield 2023-10-29T17:52:58.157399Z

I've added a note to the deps-new README about this, saying if you get this error on installation, use clojure -Ttools remove :tool new to remove the old (`clj-new`) tool and then you can install-latest on deps-new.

Daniel Miladinov 2023-10-15T14:35:06.397619Z

My clojure version: $ clojure --version Clojure CLI version 1.11.1.1413

Daniel Miladinov 2023-10-15T14:35:35.080849Z

My java version: $ java --version openjdk 21 2023-09-19 OpenJDK Runtime Environment (build 21+35-2513) OpenJDK 64-Bit Server VM (build 21+35-2513, mixed mode, sharing)

Daniel Miladinov 2023-10-15T14:46:47.203149Z

I’d appreciate any help you could give, whenever you’re able to give it πŸ™‚

Daniel Miladinov 2023-10-15T14:46:52.770969Z

Thank you in advance! πŸ™‚

Bob B 2023-10-15T16:09:20.194529Z

speculating... is it possible that clj-new is already installed as new?

Daniel Miladinov 2023-10-15T17:42:31.416909Z

Interesting theory... I'm not at my computer right now, but how could I test that idea?

Bob B 2023-10-15T17:50:02.374279Z

I think check ~/.clojure/tools for a new.edn file, and if it's there, it should contain coords to what is currently installed as new

seancorfield 2023-10-15T17:53:59.091649Z

See https://ask.clojure.org/index.php/13368/install-latest-already-another-results-cryptic-error-message - the core team plan to fix install-latest

Bob B 2023-10-15T17:57:00.319159Z

is it sufficient to rename the edn file to rename the 'tool installation'? I don't see any other correlations...

seancorfield 2023-10-15T17:57:21.671439Z

I believe that will work, yes

seancorfield 2023-10-15T17:57:53.202869Z

I know you can create those tools files manually:grin:

Daniel Miladinov 2023-10-15T22:04:13.155209Z

Removing the old file and re-installing also did the trick, thank you!

~ $ cd ~/.clojure/
~/.clojure $ cd tools
~/.clojure/tools $
~/.clojure/tools $ ls -la
total 24
drwxr-xr-x  5 dmiladinov  staff  160 Oct 15 10:27 .
drwxr-xr-x  5 dmiladinov  staff  160 Feb 18  2023 ..
-rw-r--r--  1 dmiladinov  staff  184 Oct 15 10:27 clj-new.edn
-rw-r--r--  1 dmiladinov  staff  184 Apr 30 14:29 new.edn
-rw-------  1 dmiladinov  staff  126 Oct 15 10:25 tools.edn
~/.clojure/tools $ cat new.edn
{:lib com.github.seancorfield/clj-new,
 :coord
 {:git/tag "v1.2.381",
  :git/sha "a0c510000e18f92abf82d918b0a207ee073b6e71",
  :git/url ""}}
~/.clojure/tools $ rm new.edn
~/.clojure/tools $ clojure -Ttools inclojure -Ttools install-latest :lib io.github.seancorfield/deps-new :as new
Checking out:  at c899135de0089059a2770efe79c5022ad874741a
new: Installed io.github.seancorfield/deps-new v0.5.3 {:git/tag "v0.5.3", :git/sha "c899135"}
~/.clojure/tools $

πŸ‘ 1
πŸ‘πŸ» 1