This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-05
Channels
- # announcements (23)
- # babashka (23)
- # beginners (48)
- # calva (41)
- # clj-kondo (41)
- # cljs-dev (75)
- # cljsrn (5)
- # clojure (85)
- # clojure-europe (46)
- # clojure-nl (2)
- # clojure-spec (70)
- # clojure-uk (4)
- # clojurescript (52)
- # core-async (2)
- # cursive (16)
- # datahike (2)
- # datomic (4)
- # emacs (15)
- # figwheel-main (2)
- # fulcro (5)
- # gratitude (5)
- # helix (14)
- # introduce-yourself (2)
- # jackdaw (13)
- # keyboards (2)
- # lsp (8)
- # luminus (5)
- # malli (3)
- # meander (12)
- # nextjournal (52)
- # off-topic (19)
- # other-languages (1)
- # overtone (3)
- # pathom (4)
- # podcasts-discuss (1)
- # re-frame (6)
- # reitit (1)
- # releases (2)
- # ring (3)
- # sci (22)
- # shadow-cljs (3)
- # specter (1)
- # testing (3)
- # tools-deps (100)
- # uncomplicate (2)
I want to include a local/root dependency, passing in an alias (so that it includes some extra-paths defined in that project). I recall this being a feature that was talked about but not yet implemented, but I can't find the ticket/ask clojure question/discussion ... Is this done? Can someone point me in the right direction? Or am I barking up the wrong tree?
Has not been done
I’ve often wondered about having something like that. I guess it might want to be constrained somehow, so a published deps.edn file can state which of its aliases are to be exported?
I would love to have aero like tag literals. stuff like #include #merge #env #join #profile #ref etc, seems that it could solve 99% of these kind of uses cases where some sort of composition is required
Personally I think it makes sense for deps.edn to always be fully resolved, and not require interpretation. Though arguably some of the features like :paths
accepting aliases, are implementing a constrained version of #ref
You can of course already use aero to generate deps.edn
.
Indeed this is something I was meaning to ask with regards your deps-modules tool… why not just use aero?
the stuff you generate/modify should be a normal deps.edn file, what you see is what you get
it's difficult enough to push deps usage when everything works fine (to some extent) with lein
wysiwyg bit is actually a counter argument to aero style tags 🙂 but if it was part of tools-deps it'd be ok
one thing for sure, if we have to tell devs who are happy with lein that they have to juggle with tons of aliases to get stuff going they ll be resisting the change
(personally I just want to speed up dev when you juggle with tons of repos (esp. with deep deps trees), the fact a commit is immediately available from repo a to repo b is the big sell, no need to wait ci/build/deploy from other prs)
Yeah — generating deps.edn from templates certainly isn’t without its problems… Though arguably tools.build substantially reduces the need to do that
if we had #include/#refs the version pinning problem solved by deps-modules would be solved
include the version file in some internal key in your deps.edn files then #ref to the values you need for coords
I think there’s a risk it muddies the water around what subset of deps.edn is available in a local project and at deployment. #include
seems dependent on the context.
What impact does putting a provided-scope dependency in the pom for a project and not the deps.edn in order to list an optional dependency? The provided scope dependency in this case would be to allow cljdoc to document my project.
In particular I'm curious if having a provided dependency in the clojars release will pull in a dependency for anyone depending on my project with tools-deps (or leiningen).
#include is quite static. If you want to do conditional includes you can use stuff like profiles (in theory), or use aliases 🙂
This has been discussed before btw, you can find some conversation if you search this channel with "interpretation" or so. It was decided against then.
the risk is to end up in a situation where you're half way to have "deps.clj" where it's all clojure code anyway, then you can launch a rocket in space and merge your deps
In particular I'm curious if having a provided dependency in the clojars release will pull in a dependency for anyone depending on my project with tools-deps (or leiningen).
@suskeyhose you can also provide a dependency scope in deps.edn afaik
no, you cannot
I was looking in the docs and I didn't see that, so I figured I'd have to put it in the template pom.
provided scope in a clojars dep should not pull in a dep with any tool
Basically I have a project which requires a namespace from a library I don't depend on so that I can optionally extend that library to work with mine. cljdoc chokes on this because it's trying to analyze the namespace with a require for something not on the classpath, but if I specify a provided-scope dependency in the pom then it will include it on the classpath to allow analysis.
I can't do this with an alias because cljdoc is dependent entirely on the maven release and ignores the deps.edn
that's far from ideal when part of the usecase here is that the user shouldn't need to know if the other library is in their transitive dependencies
What I'm doing is in the library farolero I'm extending flow's mechanism to not catch the unwinding mechanism. That's something that should be transparent because someone using farolero shouldn't need to know if a library they're using is using flow internally
In clip I manually maintain the pom.xml with provided dependencies so that cljdoc will work.
Hello when I'm trying to run "clj" from the CLI I get this: Error: Could not find or load main class clojure.main Caused by: java.lang.ClassNotFoundException: clojure.main
platform? version?
do you have a deps.edn in the current directory or not?
hi alex
im on windows
yes I havea deps.edn in the directory
if you run from a directory without a deps.edn, does it work?
you mean with lein?
no, if you run clj
from a different dir
in all other directories it says the same thing
is this a new install?
no I think this is quite old
where do I find the latest installer?
well, probably best to start with a new install
thank you alex that worked!
if anyone has feedback today on https://clojurians.slack.com/archives/C6QH853H8/p1636065875105900, please let me know!
Oh, forgot to say…
I’ve been using it all day, and it works fine so far :thumbsup:
The -X:deps list
feature happened to be exactly what I was wanting to check something
Me too! :)
be gentle, kind friends
no, I'm agreeing we should "use less force"
make deps, not war
is there a way to specify a git SHA for a :local/root
dep?
not as a local dep
it might be possible to use a git local url and a git sha as a git dep
but I have not tried it
if it doesn't work, feel free to file a bug at https://ask.clojure.org
from a quick perusal of code and a couple tests, I think this won't work right now, but could easily be made to work
yeah one thing I ran into fairly quickly was the requirement that paths be relative rather than absolute (inherited from clojure.tools.gitlibs
based on the stacktrace)
I can file a full report if you like
that's really a subset of the problem - the code that translates git urls to cache dirs and libs doesn't handle either raw paths or relative urls
but yeah, that would be great
will do ✔️
it seems like the URL issue is complected with the SHA issue; I will file separate issues for each
what's the sha issue?
https://ask.clojure.org/index.php/11250/using-a-git-sha-for-a-local-git-dependency https://ask.clojure.org/index.php/11251/allow-absolute-paths-for-file-based-git-urls
yeah, I don't expect to support shas for :local deps
if you want to treat something as a git dep, it will need to be a git dep
ah, I see - so really the SHA issue takes care of itself if the URL issue is fixed. Feel free to close the first one then.
git also supports local file support right?
git clone /srv/git/project.git
is that something that can be used in that scenario?https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols (see Local Protocol)
doesn't work
well, doesn't work with absolute paths or relative .. paths (although it might work in some cases, it's doing unholy things to the gitlibs dir)
all just a matter of fixing the url -> cache-path function, which is a bit of a hack anyways
trying to decide how far I want to go to unhack it :)