Fork me on GitHub
#tools-deps
<
2021-11-04
>
mike_ananev08:11:48

@seancorfield Hello. I'm trying to install clj-new on Linux (CentOS) and get the following error:

➜  ~ clojure -Ttools install com.github.seancorfield/clj-new '{:git/tag "v1.2.362"}' :as clj-new
Checking out:  at 3523d8be5ccef13961e49d2abc55a2ed4f18fc69
Error building classpath. Unable to checkout 39663a017d45d05a704113c9c147c7886e66d345
git: 'worktree' is not a git command. See 'git --help'.

lispyclouds08:11:04

@U097654L8 What is your version of Git? worktree is a command introduced in Git 2.5+

mike_ananev08:11:00

Oh, thanks. I think this is the error cause. ➜ ~ git --version git version 1.8.3.1

lispyclouds08:11:34

yep, clojure cli tooling shells out to the system git for cloning repos, hence dependent on that version

dharrigan09:11:59

That's quite an ancient version of git

dharrigan09:11:21

Released sometime in 2012...

mike_ananev10:11:57

yeah, but CentOS 7 from cloud provider is my constraint.

Alex Miller (Clojure team)13:11:02

We require at least git 2.5

Andrés Rodríguez13:11:43

@U097654L8 As a suggestion: you could use Nix to get yourself more recent tooling or alternatively, use a more modern distro inside of a Docker container.

mike_ananev08:11:27

Did not understand how to fix it?

mike_ananev08:11:10

➜ ~ clj --version Clojure CLI version 1.10.3.998

mpenet12:11:49

we've been toying with this lib (https://github.com/exoscale/deps-modules) at work, attempting to replace setups involving lein sub in some of our repos, maybe that's of interest here

mpenet12:11:20

it just handles version (and other attributes) propagation in "sub-modules"

mpenet12:11:45

for the rest tools.deps (and some tools/extensions) seems to do pretty much everything we need I think now

borkdude12:11:51

@mpenet We've done a similar thing with one base/deps.edn which has all the pinned versions and then merging that into each subrepo deps.template.edn just using clojure.edn but using rewrite-clj surely works too

borkdude12:11:28

fwiw, I have an "abstraction" on top of rewrite-clj which lets you manipulate EDN using normal functions like assoc etc: https://github.com/borkdude/rewrite-edn

mpenet12:11:30

similar yes, in theory if you fiddle a bit with the options you can do the same

mpenet12:11:55

I saw about rewrite-edn (after the fact), but we're using like 10 lines of rewrite-clj, good enough this way

borkdude12:11:13

also this deps.edn logic is all compatible with bb as well, so we execute it any time we touch something, since the startup time is neglectible

mpenet12:11:36

yeah we want to avoid to force devs to install anything new

mpenet12:11:00

the move from lein -> tools.deps is not always welcomed (it's a lot of change), so we want to limit friction

borkdude12:11:38

yeah of course, but you can have both with the same code

mpenet12:11:42

same reason why we went with write-in-place vs injecting deps.edn files or alias merging

👍 1
borkdude12:11:14

what I like about this approach is that it's "what you see is what you get"

mpenet12:11:25

but I suspect that tool could be ported to bb easily in any case

borkdude12:11:33

instead of some tool which calculates things at runtime

mpenet12:11:34

it's very little code

mpenet12:11:14

then you can just do a pedantic style check in CI that fails the run if stuff is not in sync

mpenet12:11:21

and everybody is happy

mpenet12:11:42

yeah I had your gist in memory

mpenet12:11:51

I think I might have starred it

mpenet12:11:03

but I think keeping comments in particular is really important

borkdude12:11:26

the comments in "our" case is in deps.template.edn

mpenet12:11:34

we often have comments indicating typically "this is here because some conflict there bla bla"

mpenet12:11:52

yeah, I went with templates in modules originally

mpenet12:11:08

then I asked myself, since we rewrite why just not write in the end file

mpenet12:11:26

it's probably visible from the options supported

borkdude12:11:42

I agree that the rewrite-clj / rewrite-edn approach is nicer. I went with this in neil as well: neil add dep foo/bar adds it to your deps.edn

mpenet12:11:44

:output-deps-edn-file "deps.edn" :input-deps-edn-file "deps.edn"

mpenet12:11:02

rewrite-clj is really awesome

mpenet12:11:11

been using it on other things, quite like it

pyr12:11:25

@borkdude do I get it right that neil is more or less your take on what I tried to do with joker + klein?

borkdude12:11:12

it's a little bit different. neil just adds things to an existing Clojure project, but doesn't "wrap" or hide any features or tries to make things "easy", it's not a project / task runner. bb already has a task runner which fulfills that part: https://book.babashka.org/#tasks All neil does right now is add common "facets" to existing projects, like a test runner, tools.build, etc.

borkdude12:11:54

I just had to do this manually too often, this is why I wrote this tool

pyr12:11:07

ack makes sense

pyr12:11:08

but as @mpenet points out we're taking the slow road to introduce changes to our tooling, right now we're still in lein land

FiVo13:11:00

I am having trouble loading a native library with cli and java.library.path.

1
FiVo13:11:21

I am trying

$ clj -J-Djava.library.path=/usr/share/
Clojure 1.10.3
user=> (require '[zeromq.zmq])
Execution error (UnsatisfiedLinkError) at java.lang.ClassLoader/loadLibrary (ClassLoader.java:2670).
no jzmq in java.library.path: [/usr/share/]

FiVo13:11:48

and dpkg returns

$ dpkg -L libzmq-java
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libzmq-java
/usr/share/doc/libzmq-java/AUTHORS
/usr/share/doc/libzmq-java/README.md
/usr/share/doc/libzmq-java/copyright
/usr/share/java
/usr/share/java/zmq-3.1.0.jar
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libzmq-java
/usr/share/maven-repo
/usr/share/maven-repo/org
/usr/share/maven-repo/org/zeromq
/usr/share/maven-repo/org/zeromq/jzmq
/usr/share/maven-repo/org/zeromq/jzmq/3.1.0
/usr/share/maven-repo/org/zeromq/jzmq/3.1.0/jzmq-3.1.0.pom
/usr/share/maven-repo/org/zeromq/jzmq/debian
/usr/share/maven-repo/org/zeromq/jzmq/debian/jzmq-debian.pom
/usr/share/doc/libzmq-java/changelog.Debian.gz
/usr/share/java/jzmq-3.1.0.jar
/usr/share/java/jzmq.jar
/usr/share/java/zmq.jar
/usr/share/maven-repo/org/zeromq/jzmq/3.1.0/jzmq-3.1.0.jar
/usr/share/maven-repo/org/zeromq/jzmq/debian/jzmq-debian.jar

FiVo13:11:50

nevermind was giving it the wrong path

lispers-anonymous13:11:11

I have a coworker who uses a PAT to authenticate with github over https. Looking at https://clojure.atlassian.net/browse/TDEPS-33 it seems like deps.edn would support this type of authentication now. Is that correct? Is there anything special that would need to be done to allow using git coordinates for private repos with https/PAT auth?

Alex Miller (Clojure team)14:11:54

Clojure CLI shells out to git. If it works that way, it probably works with the Clojure CLI.

lispers-anonymous14:11:19

I'll pass along that they probably need to update to the latest clojure cli as well. If it doesn't, switching to ssh is not an issue. Thanks for the info

Alex Miller (Clojure team)22:11:35

Clojure CLI prerelease 1.10.3.1020 is now available: • Updates to latest tools.deps.alpha (which updates transitive dep versions) • Modification to prior manifest changes to consider classpath stale if manifest file is missing (local or git dir was deleted) • Includes alpha version of a new clj -X:deps list - similar to tree but list only the libs on the final classpath (in sorted order), takes all the modifiers from create-basis

1
👍 2