Fork me on GitHub
#tools-deps
<
2019-01-03
>
Chris07:01:17

Is it necessary to reinstall from http://clojure.org to upgrade to these releases?

Alex Miller (Clojure team)13:01:52

Yes? How else would you get them?

borkdude14:01:29

some packages have an upgrade command (but this would still get the updates from http://clojure.org)

Chris18:01:16

Yes, I was wondering if there was an update command or it even automatically upgraded the tools deps lib.

geraldodev11:01:07

I tried the last tools.deps and I have a fulcro depified project that has nubank/workspaces {:mvn/version "1.0.2" :exclusions [com.cognitect/transit-java]} With the new version it does not loads transit-java. The problem is that it is excluded from workspace but its a dependency of transit-clj (of fulcro) and shadow-cljs . It looks like the exclusion is for good (affect other packages). clj -Stree does not show transit-java. When I revert to 1.9.0.397 the error is gone

Alex Miller (Clojure team)13:01:18

Can you be more explicit with a repro to make sure I understand?

Alex Miller (Clojure team)14:01:28

in particular, would love to have your full deps.edn

geraldodev16:01:51

My deps.edn, good_tree.txt was produced with linux-install-1.9.0.397.sh bad_tree.txt was produced with linux-install-1.10.0.408.sh. Look that there are no transit-java with the latter version. It was supposed to be there because it is a dependency of fulcro and shadow-cljs

geraldodev16:01:29

The only deps missing is a variation of sean corfield's ~/.clojure/deps.edn, but I think it does not play any role on this problem

Alex Miller (Clojure team)16:01:33

what is the command you’re running to get the trees?

Alex Miller (Clojure team)16:01:42

just clj -Stree ? or using any aliases?

geraldodev16:01:33

clj -Stree on the project directory

geraldodev16:01:19

The resolution appears to be different on the most recent version

Alex Miller (Clojure team)16:01:22

thx, I will take a look

geraldodev16:01:39

np, thnx for your work on tools.deps

Alex Miller (Clojure team)17:01:23

@geraldodev that’s an interesting case. there are basically multiple dependency paths to transit-clj 0.8.313 (all same version). The path in which it is first found and selected (nubank/workspaces -> com.cognitect/transit-clj) happens to exclude its transitive dep, com.cognitect/transit-java.

geraldodev17:01:37

I checked the version. It was strange to me because it is the same like you saw

Alex Miller (Clojure team)17:01:35

tree:
  A (excl C) -> B -> C
  D -> B -> C
selected:
  A, D, B

Alex Miller (Clojure team)17:01:19

whereas if B happened to be encountered via D first, C would be included

Alex Miller (Clojure team)17:01:15

I know why what you’re seeing happened to change, but I think this problem likely existed on the prior version too, but via some other arbitrary ordering

Alex Miller (Clojure team)17:01:06

I will need to think about this a bit

geraldodev17:01:16

But you are ble to get transit-java on prior version

Alex Miller (Clojure team)17:01:35

you happened to get transit-java on prior version

geraldodev17:01:13

via arbitrary ordering. I get it. It's a coincidence...

Alex Miller (Clojure team)17:01:15

but I don’t actually think you’re guaranteed that - it’s probably a result of the order the deps are being encountered

Alex Miller (Clojure team)17:01:34

I’m not certain of that, but that’s my suspicion

Alex Miller (Clojure team)17:01:21

I think what this dependency tree is saying is not self-consistent

Alex Miller (Clojure team)17:01:29

that is, if you treated the deps as logical propositions, there is no solution that satisfies both excluding C under A and including it under D in that simple version above

Alex Miller (Clojure team)17:01:01

given that it’s the same B in both cases

Alex Miller (Clojure team)17:01:29

for example, if you run this same example in Maven, you get a match of the “bad” tree (no transit-java included at all)

timgilbert17:01:33

Wouldn't you want it to be like:

tree:
  A1 (excl C1) -> B1 -> C1
  D2 -> B2 -> C2
selected:
  A1, D2, (resolve-duplicate #{B1 B2}), C2
?

Alex Miller (Clojure team)17:01:52

in this particular case, the versions of B and C in both branches are identical

Alex Miller (Clojure team)17:01:02

so I omitted the versions

Alex Miller (Clojure team)17:01:29

if the two B’s are identical, then it shouldn’t matter which one you choose

Alex Miller (Clojure team)17:01:44

and exclusions are never version-specific

geraldodev17:01:58

There are no explicity dependency of transit-java on lein's fulcro template. It appears to include it.

Alex Miller (Clojure team)17:01:26

tree:
  A1 (excl C) -> B1 -> C1
  D1 -> B1 -> C1
selected:
  A1, D1, B1

Alex Miller (Clojure team)17:01:14

is a version-specific example (and the exclusion intentionally does not have a version, as exclusions are not version-specific)

timgilbert17:01:54

I guess I was thinking the semantics of exclusion were more "omit C from the entire transitive tree of A", not "globally exclude C from the tree"

Alex Miller (Clojure team)17:01:50

but I’m saying that omit C1 can’t be consistent with also saying include D1 which depends on B1 which depends on C1

Alex Miller (Clojure team)17:01:04

you’re saying both omit C1 and include C1 - we can’t do both

timgilbert17:01:58

I see the contradiction, yeah...

timgilbert17:01:13

I guess I'd just intuitively expect that in order to get the behavior where C is excluded, you'd have to do

tree:
  A1 (excl C) -> B1 -> C1
  D1 (excl C) -> B1 -> C1
selected:
  A1, D1, B1

Alex Miller (Clojure team)17:01:35

yes, that is what you have to do in either clj or Maven

Alex Miller (Clojure team)17:01:07

there have been requests for global exclusions as a feature but that’s not currently a thing

Alex Miller (Clojure team)17:01:13

if anything were to be done on this, it would be to make it non-arbitrary

Alex Miller (Clojure team)17:01:17

bascially if you have B and B (excl C), do not treat those as interchangeable - prefer one over the other

Alex Miller (Clojure team)17:01:35

this gets tricky when combined with version comparisons though

Alex Miller (Clojure team)17:01:52

and I’m not sure which one you would want to prefer

Alex Miller (Clojure team)17:01:23

seems like geraldodev’s expectation is that you would prefer including it

geraldodev17:01:24

yes, like lein does

Alex Miller (Clojure team)17:01:47

lein relies on Maven’s selection, which is also order-dependent

Alex Miller (Clojure team)17:01:38

it wouldn’t surprise me if the ordering affected what you got in lein too

geraldodev17:01:43

if workspace is not picking a version for you and another package is so be it. because it needs to be there. the version being the same is irrelevant to a greater proposal of having the lib

Alex Miller (Clojure team)17:01:24

this is not about version picking though, it’s about inclusion vs exclusion

geraldodev17:01:44

but the exclusion was caused because of the version being the same

Alex Miller (Clojure team)17:01:03

there is no set of dependencies that can satisfy the constraints stated, so the most correct answer here is actually to fail

Alex Miller (Clojure team)17:01:19

we’re just pouring semantics over the top of a logically inconsistent case

Alex Miller (Clojure team)17:01:43

we do that all the time when selecting deps though wrt versions

hiredman17:01:05

the question is kind of, are exclusions global, or are exclusions local. are exclusions applied while determining what the transitive dependencies of a given dependency are, or are they applied later after all the dependencies have been determined an a graph has been created

Alex Miller (Clojure team)17:01:18

that’s not the question

Alex Miller (Clojure team)17:01:22

exclusions are not global

Alex Miller (Clojure team)17:01:29

they are always contextual

geraldodev17:01:12

lein deps :tree on template project after lein ancient :upgrade. It uses workspaces on 1.0.2

Alex Miller (Clojure team)17:01:00

the selection algorithm is attempting to satisfy (often contradictory) constraints while also balancing performance concerns

geraldodev17:01:07

transit-java is being picked by transitive dependency of shadow-cljs

Alex Miller (Clojure team)17:01:53

clj is intentionally not using the same algorithm as either lein or Maven

Alex Miller (Clojure team)18:01:39

those both prefer versions that are closer to the top or first encountered at a sibling level

hiredman18:01:45

maybe I misstated it, but it sounds like the difference between the current observed behavior, and the behavior @geraldodev is suggesting is between applying exclusions before or after it has been determined that the B both A and D depend on is the same, which maybe isn't possible, but I described it as global because it seems like in order to know A and D depend on the same B you need a global view of the dependency graph

geraldodev18:01:55

@alexmiller it's the newest and forbbidenn by one dependency

Alex Miller (Clojure team)18:01:55

I think this discussion is missing too much context of what’s being considered to be correct

Alex Miller (Clojure team)18:01:32

like when choosing versions, you have to consider what versions you’ve seen, whether a version is under an exclusion of a selected version, etc

geraldodev18:01:11

@alexmiller I'm in no place to argue about this. I just expected the lein behaviour.

Alex Miller (Clojure team)18:01:27

and for performance reasons, we’re doing this in one pass, which limits information and when you know things

Alex Miller (Clojure team)18:01:27

I’m still contending that the overall dependency tree here is logically inconsistent and there is no solution that meets all constraints

Alex Miller (Clojure team)18:01:25

I would not be surprised if lein / Maven both have order-dependent answers to this and depending how you order things, you could see transit-java either being included or not here

Alex Miller (Clojure team)18:01:14

if that’s not true, then their selection algorithm is effectively placing some preference, either intentionally or accidentally

Alex Miller (Clojure team)18:01:40

clj’s selection algorithm is different, and may or may not make the same choice

Alex Miller (Clojure team)18:01:19

I would prefer it not to be order-dependent though as that’s generally a source of confusion

Alex Miller (Clojure team)18:01:57

Maven’s algorithm relies on order as means of selection, so it has to be

hiredman18:01:00

some of it is maybe ergonomic, having the exclusion listed on a particular dependency leads to the expectation (as incorrect as it may be) that the exclusion is somehow limited in scope to that dependency and won't effect dependency info from other deps

kenny19:01:15

In order to use Neanderthal on a Mac you need to specify these exclusions: https://github.com/uncomplicate/neanderthal/blob/7cf295119527843a6d1e9c17161b8a7b2f741309/examples/hello-world/project.clj#L6-L7. I cannot figure out a way to do this in a deps.edn. I tried this:

{:deps {uncomplicate/neanderthal {:mvn/version "0.19.0"
                                  :exclusions  [[org.jcuda/jcuda-natives :classifier "apple-x86_64"]
                                                [org.jcuda/jcublas-natives :classifier "apple-x86_64"]]}}}
which results in
Error building classpath. Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:0.9.0 in central ()
I also tried
{:deps {uncomplicate/neanderthal {:mvn/version "0.19.0"
                                  :exclusions  [org.jcuda/jcuda-natives org.jcuda/jcublas-natives]}}}
which results in the same error. Is there a way to get this to work with a deps.edn?

Alex Miller (Clojure team)20:01:17

exclusions in Maven can’t use classifiers afaik (certainly the deps.edn version does not support it)

Alex Miller (Clojure team)20:01:53

I would expect something like this to work

{:deps {uncomplicate/neanderthal {:mvn/version "0.19.0" :exclusions [org.jcuda/jcuda-natives org.jcuda/jcublas-natives]}}}

kenny20:01:19

That results in

Error building classpath. Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:0.9.0 in central ()

kenny20:01:38

Having the exclusions that are in project.clj works as expected.

kenny20:01:44

… in a project.clj.

Alex Miller (Clojure team)20:01:50

yeah, the error there is accurate - there is no such jar

Alex Miller (Clojure team)20:01:25

I guess this could be the exclusion code not being classifier aware

Alex Miller (Clojure team)20:01:57

so it doesn’t know to try to exclude the os-dependent dependency

Alex Miller (Clojure team)20:01:35

assuming that’s the issue, it shouldn’t be hard to fix

Alex Miller (Clojure team)20:01:13

yeah, that was it. I have a fix for it

kenny21:01:16

Great! Should I still file a ticket?

Alex Miller (Clojure team)21:01:48

or I can do it if you want

kenny22:01:19

Ok will do in a bit. Is there a workaround for now?

Alex Miller (Clojure team)23:01:02

No, don’t have one, sorry. I can rev a new version tomorrow with the fix though

kenny01:01:04

That'd be great. What would I need to do on my end to get that to work?

Alex Miller (Clojure team)14:01:00

I filed a ticket at https://dev.clojure.org/jira/browse/TDEPS-112 and am working on a release. You’ll need to either “brew upgrade clojure” if on mac or re-install if on linux once it’s out (will take a few hours)

kenny16:01:36

Sorry, meant to file the ticket - yesterday was quite busy. Thank you Alex!

kenny16:01:23

I assume the brew upgrade will be available once this PR goes through? https://github.com/Homebrew/homebrew-core/pull/35692

Alex Miller (Clojure team)17:01:07

usually takes up to 24 hrs

kenny22:01:25

@alexmiller I am still getting the same exception after running brew upgrade clojure.

kenny22:01:17

Actually I needed to open a new terminal. It appears to be working now.

kenny23:01:34

I am getting this error when using clojure on a different computer than my usual one.

Error resolving /Users/Mark1/Provisdom/math: [email protected]:...: USERAUTH fail
Cloning: [email protected]:...
I can run git clone [email protected]:... successfully. Why would the Clojure CLI not be picking this up?

Alex Miller (Clojure team)23:01:39

It uses jgit, so is a different pile of stuff

Alex Miller (Clojure team)23:01:04

Can’t say I have enough to go on there

Alex Miller (Clojure team)23:01:30

Private or public repo?

kenny23:01:14

Mac OS. SSH. Public.