Fork me on GitHub
#tools-deps
<
2021-03-12
>
seancorfield00:03:14

@souenzzo That wouldn't work for code that expects to read files (from the current directory).

seancorfield00:03:48

(and it's only stuff like src/`test`/`resources` that are relative in path?)

souenzzo00:03:57

@seancorfield i understand that limitation, but I still think that this transformation is useful

souenzzo00:03:42

currently all deps looks canonical, only the :paths items (src resources) are "relative"

seancorfield00:03:47

Here's a trick to add the :paths to the path as canonical versions:

clojure -Sdeps '{:deps {my/app {:local/root "."}}}' -Spath

seancorfield00:03:10

You'll still get src etc but you'll also get them as full paths.

souenzzo00:03:31

clojure -Sdeps '{:deps {my/app {:local/root "."}}}' -Spath | tr ':' '\n'
src
resources
service
😞

seancorfield00:03:31

It's not quite what you want but it seems like a good workaround...?

Alex Miller (Clojure team)00:03:58

If you want to file a question on ask.Clojure I can track it there

✔️ 3
seancorfield00:03:41

@souenzzo what version of the CLI are you using? That's not what I see when I run that.

seancorfield00:03:08

Hmm,

seanc@DESKTOP-30ICA76:~/oss/honeysql$ clojure -Spath | tr : '\n'
src
/home/seanc/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar
/home/seanc/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar
/home/seanc/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar
seanc@DESKTOP-30ICA76:~/oss/honeysql$ clojure -Sdeps '{:deps {my/lib {:local/root "."}}}' -Spath | tr : '\n'
src
/home/seanc/oss/honeysql/src
/home/seanc/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar
/home/seanc/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar
/home/seanc/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar

souenzzo00:03:14

Ok It's only duped. I will work with that local/root hack

dnolen04:03:42

can confirm the pre-release fixed up my issues on M1 hardware

Alex Miller (Clojure team)15:03:32

anyone else here with feedback on the CLI prereleases that shell out to git?

raspasov15:03:04

1.10.2.805? Seems to work on my machine…

raspasov15:03:23

Oh wait… there’s a new one.

raspasov15:03:50

I’ll try.

flowthing15:03:44

I've used it pretty lightly (macOS Big Sur) -- no problems so far.

raspasov15:03:47

Got it: % clj --version                  Clojure CLI version 1.10.3.810

raspasov16:03:26

Nuked rm -rf ~/.gitlibs after installing 1.10.3.810 Seems to be downloading everything correctly when building projects. (macOS Big Sur)

seancorfield16:03:33

Worked fine in my basic tests, but I don’t have too many git deps. Vendored 1.10.3.810 into the repo at work and everything still works in our dev/test/build pipeline (only one git dep there though, on Cognitect’s test-runner).

dnolen19:03:12

@alexmiller hrm in work project if I change the sha it says it can't resolve

dnolen19:03:29

as in it worked the very first I tried it - but bumping a sha results in

dnolen19:03:50

Checking out: [email protected]:vouch-opensource/krell.git at 54944e3ef361d9d5e3ac6b6f63dd84713ef9db07
Error building classpath. Unable to checkout 54944e3ef361d9d5e3ac6b6f63dd84713ef9db07
fatal: invalid reference: 54944e3ef361d9d5e3ac6b6f63dd84713ef9db07

dnolen19:03:07

fwiw, it doesn't matter if it's an https or git style url

dnolen19:03:30

deleting ~/.gitlibs allows me to proceed

Alex Miller (Clojure team)19:03:39

what version are you using?

Alex Miller (Clojure team)19:03:32

1.10.2.801 was definitely broken when using multiple shas from the same repo, but that was fixed in 1.10.2.805 and latest 1.10.3.810

Alex Miller (Clojure team)19:03:06

but what that sounds like as I think about it more is a missed fetch - trying to resolve using a new sha that has been created since the initial clone

Alex Miller (Clojure team)19:03:17

I'll see if I can repro

dnolen20:03:35

1.10.3.810

dnolen20:03:53

yes this is fetching a new sha after the initial clone

Alex Miller (Clojure team)20:03:14

@dnolen bug found, and fixed, new release in the works, thx

Alex Miller (Clojure team)21:03:51

Clojure CLI prerelease 1.10.3.814 is now available: • fix issue with detecting when git fetch is needed for git deps

borkdude22:03:19

tools.gitlibs is now so "pure Clojure" because of the shelling out, that it can be run with babashka from source :)

$ bb -cp src/main/clojure -e "(require '[clojure.tools.gitlibs :as gl]) (gl/procure \"\" 'org.clojure/tools.gitlibs \"11fc77496f013871c8af3514bbba03de0af28061\")"
Cloning: 
Checking out:  at 11fc77496f013871c8af3514bbba03de0af28061
"/Users/borkdude/.gitlibs/libs/org.clojure/tools.gitlibs/11fc77496f013871c8af3514bbba03de0af28061"
(second time: 37ms)

👍 10
clojure-spin 6