Fork me on GitHub
#tools-deps
<
2023-10-17
>
stathissideris10:10:15

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

danielcompton18:10:13

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

Alex Miller (Clojure team)18:10:14

Named tools are installed by definition

Alex Miller (Clojure team)18:10:29

You can use a tool alias though

Alex Miller (Clojure team)18:10:31

Do you need -T or just -X?

Alex Miller (Clojure team)18:10:26

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

danielcompton18:10:52

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?

seancorfield19:10:54

@U051KLSJF 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

seancorfield19:10:37

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

danielcompton19:10:12

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

danielcompton19:10:28

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)19:10:24

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

danielcompton01:10:54

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