This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-13
Channels
- # announcements (10)
- # aws (1)
- # babashka (8)
- # babashka-circleci-builds (1)
- # beginners (67)
- # calva (4)
- # cljs-dev (42)
- # clojars (4)
- # clojure (213)
- # clojure-dev (4)
- # clojure-europe (18)
- # clojure-nl (1)
- # clojure-uk (8)
- # clojurescript (13)
- # conjure (6)
- # cursive (63)
- # data-science (5)
- # datomic (11)
- # events (1)
- # graalvm (2)
- # graalvm-mobile (1)
- # honeysql (4)
- # kaocha (3)
- # leiningen (19)
- # lsp (32)
- # malli (3)
- # meander (13)
- # news-and-articles (3)
- # off-topic (8)
- # polylith (5)
- # re-frame (47)
- # reitit (2)
- # shadow-cljs (28)
- # sql (3)
- # tools-build (4)
- # tools-deps (51)
- # uix (9)
- # xtdb (3)
For some tools.build
fun, I switched HoneySQL over to using that for all its CI needs: https://github.com/seancorfield/honeysql/blob/develop/build.clj -- CircleCI and GH Actions run this now. Multi-version Clojure testing, ClojureScript testing, Eastwood, Readme testing, JAR-building. Only the Clojars deploy is manual (and currently has to use -X
so :pom-file
can be provided -- the -M
version of deps-deploy
doesn't support that option).
(TIL: git rev-list --count HEAD
produces 1
when run in a GH Actions script???)
Ah, thanks @dpsutton -- yeah, I think you're right that it just clones the most recent commit and nothing else.
@seancorfield You can ask GitHub Actions to clone it all via fetch-depth: 0
, https://github.com/clj-commons/rewrite-clj/blob/bd3905d0dcc40a499dc080e1e0b8f665f9b39a16/.github/workflows/release.yml#L15-L18.
Is there a way to prevent build/wite-file
from doing a pr-str
on the :content
? In that way, it is different than spit
.
sure, pass it the string you want to write
btw, I've created #tools-build if anyone wants to have future discussion there
@alexmiller If t.d.a encounters two git deps with the same URL (and same SHA) but two different :deps/root
values, could that cause the "cannot compare versions" error?
This is the error (reformatted a bit):
Unable to compare versions for repro-lib/root:
{:local/root "/Users/sean/.gitlibs/libs/repro-lib/red/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root", :deps/manifest :deps, :deps/root "/Users/sean/.gitlibs/libs/repro-lib/red/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root"} and
{:local/root "/Users/sean/.gitlibs/libs/repro-lib/blue/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root", :deps/manifest :deps, :deps/root "/Users/sean/.gitlibs/libs/repro-lib/blue/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root"}
{:lib repro-lib/root, :coord-x {:local/root "/Users/sean/.gitlibs/libs/repro-lib/red/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root", :deps/manifest :deps, :deps/root "/Users/sean/.gitlibs/libs/repro-lib/red/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root"}, :coord-y {:local/root "/Users/sean/.gitlibs/libs/repro-lib/blue/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root", :deps/manifest :deps, :deps/root "/Users/sean/.gitlibs/libs/repro-lib/blue/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root"}}
Unable to compare versions for repro-lib/root:
{:local/root "/Users/sean/.gitlibs/libs/repro-lib/red/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root", :deps/manifest :deps, :deps/root "/Users/sean/.gitlibs/libs/repro-lib/red/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root"} and
{:local/root "/Users/sean/.gitlibs/libs/repro-lib/blue/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root", :deps/manifest :deps, :deps/root "/Users/sean/.gitlibs/libs/repro-lib/blue/a252586fe4831fe8a719571793cfe81f1f4f7e88/Root"}
This is the issue where this has come up https://github.com/polyfy/polylith/issues/108 and the repro case is explained/linked in that.
I initially wondered whether it might be a case-sensitivity issue -- the repo has Root, Blue, Red but the :local/root
and :git/url
deps both have blue and red instead. But then I noticed it is comparing across two different URLs (repro-lib/red and repro-lib/blue) with the same SHA and both have Root? (This might also be an issue with Polylith not respecting :exclusions
though).
whether it's a case problem will likely depend on your os - if you're using a case-sensitive file system, then probably an issue
those errors above (while in gitlibs dir) are local deps, which can never be compared, as they are just seen as arbitrary files with no known relationship
so prior questions about gitlibs are irrelevant as those are not at play here
Well, other than these being git deps -- and having :local/root
deps inside them?
but ... they're NOT git deps
:local/root == local dep
From the project's deps.edn: https://github.com/imrekoszo/MinimalBugRepro/blob/no-common-transitive-deps/deps.edn#L4-L9
Note that they are both git deps to the same repo but different :deps/root values.
there are like 3 repro projects, sorry
although my comment on your errors above stands - those are local deps
Those git deps point to subprojects that have deps like https://github.com/imrekoszo/ReproLibrary/blob/master/Red/deps.edn
and that root project has no deps
if you have 2 git deps, that both point to local deps within their git repo, then the idea that you're "in" a git dep is lost and there is no way to compare those two deps
as in the error above, you just have two pointers to the file system
we've talked about this general problem before here wrt monorepos and there is a ticket for it
OK, so this is related to :deps/root
? I'm just trying to understand exactly what combo causes this. It looks like have two "identical" git deps with different :deps/root
values is what is causing the transitive deps to end up being incomparable?
I think you have something like: <main> git dep A (+ sub path) local dep to ../foo git dep B (+ sub path) local dep to ../foo
I double-checked and was on the wrong branch above (Imre has simplified the repro quite a bit now), and get this error:
Unable to compare versions for repro-lib/green:
{:local/root "/Users/sean/.gitlibs/libs/repro-lib/red/4237c6492172dc6a4102ccfc34df6316ccd1734b/green", :deps/manifest :deps, :deps/root "/Users/sean/.gitlibs/libs/repro-lib/red/4237c6492172dc6a4102ccfc34df6316ccd1734b/green"} and
{:local/root "/Users/sean/.gitlibs/libs/repro-lib/blue/4237c6492172dc6a4102ccfc34df6316ccd1734b/green", :deps/manifest :deps, :deps/root "/Users/sean/.gitlibs/libs/repro-lib/blue/4237c6492172dc6a4102ccfc34df6316ccd1734b/green"}
so they are ultimately two paths to the "same" lib, but via different :dep/root
-- yes, exactly the above!So the paths to green
here are via red
in one path and blue
in the other -- hence uncomparable b/c they're no longer just "git deps".
comparisons are made based on two local coords there which (from tools.deps pov) point to arbitrary places in the filesystem, which cannot be compared
I think this is the same general problem as https://clojure.atlassian.net/browse/TDEPS-132
Yup, looks like it. Thank you for sticking with me on that -- we got there in the end š
I think the "A while ago we discussed the option of a ānearest git repositoryā on slack. I wanted to record that. But itās also lacking a problem statement. The idea was a new coordinate type which would search for its nearest repo. In the case of working within the repo, it would search upwards and find the .git folder. In the case of a git/url, it would do the same. This would solve the transitive dependency problem." idea in the comments is interesting but I have not spent a lot of time thinking about it.
you really want a local dep that retains the git context of its dependee
and then comparisons would basically need to use git coord comparison rather than local coord comparison
So git dep A + sub path X and git dep A + sub path Y both become (different) local deps, in essence?
depends what you mean by that notation :)
in any case, I'm not going to work on this today
@alexmiller I'm looking at how t.d.a handles :exclusions
. It's only documented for :mvn/version
coords but it looks like it actually works for all types of coords?
Thanks. Oh, and the problem above ultimately traced back to Polylith's test
tool not respecting :deps/root
-- @imre helped me track that down.
Is this something that needs to be fixed @seancorfield?
@U1G0HH87L I submitted a PR for the fix.
Your changes looks good! My approval of the PR didnāt trigger the CI build, so Iām looking into that.
Itās merged now!
Thank you! Woohoo! I'm a contributor now! š
I would have included tests if I could have figured out easily where to put them and how to trigger that code path š