deps-new

amiorin 2025-05-01T11:12:31.808619Z

Thx for deps-new. It is a game changer for big-config. I'm planning to port deps-new to babashka. The synergy between the two libraries is that I'm using clojure for devops to generate configuration files instead of curating them manually. I have used this idea successfully with terreform and ansible. deps-new is usually invoked only one time but for devops I'm invoking it every terraform plan using big-config workflow facilities. The goal of using clojure for devops is to dry infracoding because I think that the DRY principle applies to both code and infracoding. Is there an interest in a babashka version of deps-new outside my use case?

amiorin 2025-05-01T11:13:52.929689Z

#bigconfig

borkdude 2025-05-01T11:14:25.861119Z

Hey @alberto.miorin. The #babashka-neil tool is already using deps-new via neil new template . What is there to port? Perhaps I haven't been watching deps-new updates, but older versions ran with bb for sure

borkdude 2025-05-01T11:18:12.903589Z

oh interesting, deps-new now uses tools-build: https://github.com/seancorfield/deps-new/blob/bbe04adacec62e5542dbc896c8f75770fa76e2be/src/org/corfield/new.clj#L11

borkdude 2025-05-01T11:20:11.238749Z

I guess that's fine since it seems to only use file related things (copying, deleting stuff). I'd say tools.build is a bit of a heavy dep to just do that, but it loads in bb. The problem I'm seeing now is:

user=> (require '[org.corfield.new])
clojure.lang.ExceptionInfo: Cyclic load dependency: org.corfield.new->[ org.corfield.new.impl ]->[ org.corfield.new.impl ] [at /private/tmp/deps-new/src/org/corfield/new/impl.clj:5:3]
user=>

borkdude 2025-05-01T11:21:12.492989Z

This is because of a self-requiring namespace. When I change this to :

[org.corfield.new.impl :as-alias impl]
then it works in bb again

borkdude 2025-05-01T11:21:47.388279Z

I guess that clause can be removed wholesale since it doesn't seem to be doing anything

borkdude 2025-05-01T11:26:38.468479Z

user=> (new/scratch {:name 'foo})
Creating project from org.corfield.new/scratch in foo
nil

amiorin 2025-05-01T11:52:20.752459Z

Thx @borkdude. I'll do some tests. My goal is to have the fast start-up time of babashka in big-config projects. Right now I have tested only babashka clojure that invokes big-config that invokes deps-new and it has the 4 secs tax of the JVM. My plan was to remove the deps on tools.* in deps-new.

borkdude 2025-05-01T11:53:21.528309Z

tools.build should be easy to eliminate, but as I've shown above it you don't even have to, it's just the self-requiring namespace that's currently not working in deps-new

seancorfield 2025-05-01T12:09:01.810739Z

deps-new has always wrapped tools.build for handling templates. That cyclic require sounds like a bug. Can one of you file a GH issue and I'll take a look?

borkdude 2025-05-01T12:10:16.041289Z

interesting, didn't know that

borkdude 2025-05-01T12:12:15.197619Z

https://github.com/seancorfield/deps-new/issues/61

borkdude 2025-05-01T13:14:18.668709Z

thanks for fixing. @alberto.miorin deps-new should now be usable again in bb

seancorfield 2025-05-01T13:15:01.969279Z

How does neil know to use the latest deps-new?

borkdude 2025-05-01T13:15:25.056229Z

it requires a manual update

borkdude 2025-05-01T13:15:30.846879Z

haven't updated in a while

seancorfield 2025-05-01T13:17:51.986879Z

Ah, OK.

2025-05-01T12:12:11.547849Z

2025-05-01T13:11:43.627129Z

2025-05-01T13:12:36.233909Z