tools-deps

stathissideris 2023-10-17T10:52:15.306599Z

Since git deps are checked out before being used, could clj -X:deps prep also work on them?

Alex Miller (Clojure team) 2023-10-17T12:53:49.606149Z

Yes, it does

🙏 1
danielcompton 2023-10-17T18:54:13.413279Z

Perhaps a dumb question, but is it possible to run a tool without installing it first? I’m imagining something like this:

clojure -Ttools run nvd-clojure/nvd-clojure '{:mvn/version "3.4.0"}' nvd.task/check
This is for CI/scripting, where I’d prefer not to have a separate install step from running the tool

danielcompton 2023-10-20T01:45:54.303719Z

Yeah, that might be an option, I’ll take a look

Alex Miller (Clojure team) 2023-10-17T18:55:14.793199Z

Named tools are installed by definition

Alex Miller (Clojure team) 2023-10-17T18:55:29.719479Z

You can use a tool alias though

Alex Miller (Clojure team) 2023-10-17T18:56:31.189079Z

Do you need -T or just -X?

Alex Miller (Clojure team) 2023-10-17T18:57:26.043649Z

If you want to both install and run, that’s going to be two commands

danielcompton 2023-10-17T18:58:52.104679Z

I want to run https://github.com/namenu/deps-diff, without using the content of my deps.edn file in the classpath, so I think as -T?

seancorfield 2023-10-17T19:03:54.536959Z

@danielcompton There's no entry point to run that via -T or -X with paths to EDN files. It has a GH action that invokes the CLI twice to produce deps trees and then compares those as EDN: https://github.com/namenu/deps-diff/blob/main/action.yml#L64-L89

seancorfield 2023-10-17T19:04:37.123489Z

(I mean, yes, there's a -X entrypoint the action uses but you need to run two CLI commands first to prep the data)

danielcompton 2023-10-17T19:11:12.758049Z

Yup, I need to fork it to get it to run its own diff as a tool. Currently, it is running as clojure -Sdeps which means that everything in the deps.edn is also included in the classpath, which is causing issues in our case

danielcompton 2023-10-17T19:12:28.262839Z

The other issue with installing as a tool in a GitHub action is that the author of the GitHub action needs to pick a name that doesn’t collide with the names of tools that any consumers have installed. So I guess you should just pick a long unique name?

Alex Miller (Clojure team) 2023-10-17T19:25:24.975959Z

Can you use :deps in the alias to replace the deps?