This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-26
Channels
- # announcements (5)
- # architecture (79)
- # babashka (48)
- # beginners (148)
- # calva (57)
- # cider (31)
- # clara (2)
- # clj-kondo (4)
- # cljs-dev (6)
- # cljsrn (1)
- # clojure (10)
- # clojure-australia (4)
- # clojure-dev (5)
- # clojure-europe (13)
- # clojure-france (1)
- # clojure-nl (6)
- # clojure-provo (4)
- # clojure-uk (51)
- # clojurescript (38)
- # conjure (20)
- # core-logic (18)
- # cursive (28)
- # datomic (12)
- # duct (2)
- # emacs (16)
- # figwheel-main (3)
- # fulcro (43)
- # honeysql (17)
- # hoplon (3)
- # jobs (1)
- # meander (4)
- # mount (5)
- # off-topic (32)
- # pathom (6)
- # pedestal (5)
- # re-frame (1)
- # reagent (2)
- # reveal (8)
- # shadow-cljs (209)
- # spacemacs (5)
- # tools-deps (37)
- # xtdb (18)
Hi all. Quick question - I hope this is the right place to ask it! :))
Lets say I have a user
namespace in the same directory as my deps.edn
, containing a start
function. Why is this ⬇️ happening?
Clojure 1.10.1
user=> (start)
Syntax error compiling at (REPL:1:1).
Unable to resolve symbol: start in this context
user=> (require 'user)
Execution error (FileNotFoundException) at user/eval2 (REPL:1).
Could not locate user__init.class, user.clj or user.cljc on classpath.
@carnunmp you should probably put the user.clj
on your classpath, e.g. in src
?
I'm trying to ensure that the {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[\"cider.nrepl/cider-middleware\"]"]}
main opts for cider startup are run in case there are main opts in the aliases used. The documentation states that "If multiple maps with these keys are activated, only the last one will be used". My attempt to make nrepl.cmdline the "last" is the following:
/usr/local/bin/clojure -A:test -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.7"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[\"cider.nrepl/cider-middleware\"]"]}}}' -M:cider/nrepl
(where -A:test
includes a main runner for kaocha). My assumption was that putting -M:cider/nrepl
last in the string would ensure that it was last for the purposes of main arg combining but this doesn't seem to work. It still starts the kaocha runner instead of the nrepl server. Is there a way to achieve this? Have I misunderstood what last is in how the aliases are combined?
The -A are always pulled in last
Is there some reason you’re not doing both aliases in -M
-M:cider/nrepl:test
yes. this is CIDER's startup command which the user can add their own aliases to like a template
the template being clojure [optional user aliases] -Sdeps {...} -M:cider/nrepl
but it seems this is not a good template?
I do not think that is a good template - all of the aliases should be under -M imo
i suppose clojure -Sdeps {...} -M:[optional user aliases]:cider/nrepl
is a way to ensure cider/nrepl is the last alias?
and if so, are there any implications to tucking what someone thought would run under -A:foo
instead under -M:foo:cider/nrepl
besides the desired suppression of the possible main opts?
reading clj --help
exec-opts:
-Aaliases Use concatenated aliases to modify classpath
-X[aliases] Use concatenated aliases to modify classpath or supply exec fn/args
-M[aliases] Use concatenated aliases to modify classpath or supply main opts
-P Prepare deps - download libs, cache classpath, but don't exec
it seems perhaps the current invocation will be correct under a future version? Reading -A
and -M
to differ by the -M
allowing for main opts and therefore -A
to not propagate those keys?I do not think that is a good template - all of the aliases should be under -M imo
-A does currently provide :main-opts, but long-term, it will not
does :cider/nrepl have :main-opts?
I guess so
going back to your original question, why are you trying to use both cider and run test?
seems like you should be doing one or the other but not both
yes :cider/nrepl specifies the {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[\"cider.nrepl/cider-middleware\"]"]}
so that the nrepl server is correctly started up for CIDER.
This bug came up because someone had an alias which included kaocha, its main runner as main-opts, and extra test paths. Kaocha does have a useful repl mode, and the test paths are desirable as well. So it was hoped that the alias could be used and the main ignored in favor of CIDER's requirements.
So the hope was to structure the startup command in a way that we naturally eclipsed all other main args in favor of our own.
ah, ok. so the intent was to NOT get kaocha main when starting cider main (I was thinking it was the opposite). Indeed, once -A changes to not support :main-opts, what you had would have worked (but does not currently).
correct. sorry i was unclear in desired behavior. I've made the change with the note that we can go back at some point in the future. thanks for helping confirm i'm doing things the right way. much appreciated
well I was still half asleep when I first read it so prob me :)
i've already made the change for the template string to be -M[optional-args]:cider/nrepl
so thanks for your help. Its always appreciated and the clojure cli as well 🙂
Sorry, I'm not sure which is the best channel to ask this (I don't see an antq channel), but is anyone using antq to keep dependencies from a password protected maven repo up-to-date in deps.edn? Everything is setup correctly and works with tools.deps. Only antq seems to have a problem. For example, with Datomic dev-local:
| :file | :name | :version | :latest-version |
|----------+-----------------------+----------+-----------------|
| deps.edn | com.datomic/dev-local | 0.9.225 | Failed to fetch |
| pom.xml | com.datomic/dev-local | 0.9.225 | Failed to fetch |
Searching the antq github repo didn't turn up any relevant issues, nor do I see a verbose or debug option to get additional detailslink for antq?
seems like a bug in antq so I'd file an issue there
weirdly antq is using tools.deps.alpha for parts of its maven code, but not using it to read deps from deps.edn files
I think that's intentional, it's reading the literally written deps in order to make decisions based on those. It's not trying to resolve the location of those deps nor include system or user deps.
I get that, but even so it could be using more of tools.deps
I haven't checked the source, but there might also be a desire to use tools.reader to modify the deps.edn without losing comments and such. Not sure.
Just in case @UBL24PLE6 (the author of antq) is not browsing, this convo, I’ve roped them in!
Great! Thank you @alexmiller I'll file a bug