tools-deps

mkvlr 2023-03-24T09:57:57.363549Z

given :main-opts in my :test alias and none in my :dev alias, is there a way for me to start with clojure.main so I can do clj -M:dev:test -e ,,,? clj -M:test:dev will run :main-opts from :test which I don’t want.

borkdude 2023-03-24T11:01:34.817779Z

The hack I use for this is:

clj -Scp $(clj -Spath -A:dev:test) -M -e ...

borkdude 2023-03-24T11:02:50.605709Z

Optimally you should be able to:

clj -A:dev:test -M -e 
but currently -A: still runs :main-opts which I hope will be removed sooner than later

seancorfield 2023-03-24T12:36:33.657909Z

Use -r to start a REPL: clj -A:dev:test -r

borkdude 2023-03-24T12:39:36.715259Z

@seancorfield -A:dev:test will still kick off the :main-opts of the :test alias, no?

borkdude 2023-03-24T12:39:53.493539Z

and shouldn't this be -M -r?

seancorfield 2023-03-24T13:02:46.289269Z

Hmm, I shouldn't offer advice at 6 am without coffee. I use -r on some projects but I think maybe I have an empty :main-opts in an alias and use that to override previous :main-opts

seancorfield 2023-03-24T13:03:48.586569Z

Ah, you can hack around it by doing clj -X:dev:test -M -r

👍 1
seancorfield 2023-03-24T13:04:11.846549Z

I will now either go back to bed for a few hours or make a

borkdude 2023-03-24T13:26:56.234589Z

ah nice, the -X is good :)

borkdude 2023-03-24T13:27:04.656979Z

thanks for the hack!

borkdude 2023-03-28T12:23:38.920029Z

Unfortunately the -X hack didn't work, I'm getting:

Unqualified function can't be resolved: -M

borkdude 2023-03-28T12:24:36.440199Z

@alexmiller When can we get -A with ignorance of :main-opts? 🙏

Alex Miller (Clojure team) 2023-03-28T12:45:47.486839Z

After add-libs :)

Alex Miller (Clojure team) 2023-03-28T12:46:53.877409Z

Can’t you just split into two aliases as a workaround? Seems like you’re making this so hard

borkdude 2023-03-28T12:47:40.699119Z

yes, that has been the workaround, but it's a workaround that keeps coming up ;)

borkdude 2023-03-28T12:47:56.137879Z

but good to hear it's coming

borkdude 2023-07-12T10:46:35.219989Z

Still hoping this will happen soon. See discussion in https://app.slack.com/client/T03RZGPFR/C02FBBU61A9/thread/C02FBBU61A9-1689157272.648009 cc @mkvlr @teodorlu

➕ 1
Alejandro 2023-03-24T17:13:02.075979Z

Why are the resources and target dirs included in :paths ["src" "resources" "target"] in the documentation of figwheel? Isn't this option for listing source code directories? https://figwheel.org/docs/create_a_build.html

seancorfield 2023-03-24T17:48:12.959239Z

Did you mean to ask that in the #figwheel-main channel?

Alejandro 2023-03-24T17:52:36.966719Z

Oh, yeah. But anyway, it's deps.edn.

seancorfield 2023-03-24T17:58:57.368229Z

Sure, but only Figwheel users (or possibly only the Figwheel maintainers) will know the answer to this.

seancorfield 2023-03-24T17:59:28.257119Z

:paths just puts folders on the classpath so they're available when running code.

seancorfield 2023-03-24T17:59:58.725409Z

(so, no, it's not just source code directories -- it's anything you want on the classpath)

seancorfield 2023-03-24T18:00:36.826009Z

Having target on the classpath sounds a bit odd to me but I guess it depends what Figwheel puts into that folder.

seancorfield 2023-03-24T18:01:24.131269Z

If you've been using Leiningen (or Boot) previously, maybe this old blog post of mine will shed some light? https://corfield.org/blog/2018/04/18/all-the-paths/

Alejandro 2023-03-24T18:18:23.139459Z

Yeah, this explains a lot, thanks.

borkdude 2023-03-24T19:42:22.040999Z

I don't think this is the reason figwheel chose this, but having the target/classes directory in paths is somewhat necessary for libraries that support deps/prep-lib

borkdude 2023-03-24T19:42:49.585779Z

example: https://github.com/http-kit/http-kit/blob/master/deps.edn