tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
seancorfield 2021-03-12T00:03:14.267500Z

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

seancorfield 2021-03-12T00:04:48.269400Z

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

souenzzo 2021-03-12T00:04:57.269500Z

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

souenzzo 2021-03-12T00:05:42.270400Z

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

seancorfield 2021-03-12T00:07:47.271300Z

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

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

seancorfield 2021-03-12T00:08:10.271800Z

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

souenzzo 2021-03-12T00:08:31.272800Z

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

seancorfield 2021-03-12T00:08:31.272900Z

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

alexmiller 2021-03-12T00:08:58.273700Z

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

āœ”ļø 1
seancorfield 2021-03-12T00:09:41.274500Z

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

souenzzo 2021-03-12T00:10:09.274800Z

1.10.2.796

seancorfield 2021-03-12T00:12:08.275100Z

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

souenzzo 2021-03-12T00:16:14.276Z

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

dnolen 2021-03-12T04:05:42.276600Z

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

alexmiller 2021-03-12T13:17:44.277700Z

Thanks! Good to know

alexmiller 2021-03-12T15:28:32.278300Z

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

raspasov 2021-03-12T15:47:04.278400Z

1.10.2.805? Seems to work on my machineā€¦

raspasov 2021-03-12T15:47:23.278600Z

Oh waitā€¦ thereā€™s a new one.

alexmiller 2021-03-12T15:47:36.278800Z

latest is 1.10.3.810

raspasov 2021-03-12T15:47:50.279Z

Iā€™ll try.

alexmiller 2021-03-12T15:49:03.279200Z

thx!

flowthing 2021-03-12T15:56:44.279800Z

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

raspasov 2021-03-12T15:57:47.280Z

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

raspasov 2021-03-12T16:00:26.280200Z

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

alexmiller 2021-03-12T16:14:24.280800Z

:thumbsup: thx

seancorfield 2021-03-12T16:58:33.281Z

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).

dnolen 2021-03-12T19:28:12.281600Z

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

dnolen 2021-03-12T19:28:29.282100Z

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

dnolen 2021-03-12T19:28:50.282400Z

Checking out: git@github.com:vouch-opensource/krell.git at 54944e3ef361d9d5e3ac6b6f63dd84713ef9db07
Error building classpath. Unable to checkout 54944e3ef361d9d5e3ac6b6f63dd84713ef9db07
fatal: invalid reference: 54944e3ef361d9d5e3ac6b6f63dd84713ef9db07

dnolen 2021-03-12T19:29:07.282800Z

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

dnolen 2021-03-12T19:29:30.283100Z

deleting ~/.gitlibs allows me to proceed

alexmiller 2021-03-12T19:50:39.283300Z

what version are you using?

alexmiller 2021-03-12T19:52:32.284400Z

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

alexmiller 2021-03-12T19:54:06.285200Z

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

alexmiller 2021-03-12T19:54:17.285400Z

I'll see if I can repro

dnolen 2021-03-12T20:17:35.285900Z

1.10.3.810

dnolen 2021-03-12T20:17:53.286300Z

yes this is fetching a new sha after the initial clone

alexmiller 2021-03-12T20:49:14.286700Z

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

dnolen 2021-03-12T20:49:33.286900Z

thanks!

alexmiller 2021-03-12T21:35:51.287900Z

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

alexmiller 2021-03-12T21:35:56.288100Z

@dnolen ^^

borkdude 2021-03-12T22:13:19.288900Z

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 \"<https://github.com/clojure/tools.gitlibs.git>\" 'org.clojure/tools.gitlibs \"11fc77496f013871c8af3514bbba03de0af28061\")"
Cloning: <https://github.com/clojure/tools.gitlibs.git>
Checking out: <https://github.com/clojure/tools.gitlibs.git> at 11fc77496f013871c8af3514bbba03de0af28061
"/Users/borkdude/.gitlibs/libs/org.clojure/tools.gitlibs/11fc77496f013871c8af3514bbba03de0af28061"
(second time: 37ms)

šŸ‘ 3
2
alexmiller 2021-03-12T22:18:16.289600Z

šŸ¤˜