tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
timo 2020-09-23T09:28:42.002Z

one can use xmllint as well for getting the version out like here: https://github.com/replikativ/hasch/blob/87410246864f2e160cccac3a51f7a7e3139c3c45/.circleci/config.yml#L123 but setting it probably mvn plugin like @alexmiller does in the release script.

lread 2020-09-23T14:07:44.003700Z

https://github.com/workframers/garamond offers a way to set the version in pom.xml. If you are using your own versioning scheme you can use its --force-version option.

1šŸ‘
lread 2020-09-23T14:09:21.005200Z

In the past I have also used maven to do this type of work, for example to update the tag and version:

mvn versions:set-scm-tag -DnewTag=$(git rev-parse HEAD) -DgenerateBackupPoms=false
mvn versions:set -DnewVersion=$(bin/generate_version) -DgenerateBackupPoms=false
Somehow it bothers me how long it takes maven to do this thoā€¦

alexmiller 2020-09-23T15:39:08.005800Z

anyone tried the clj prerelease yet?

2020-09-23T15:43:12.007200Z

https://github.com/DeLaGuardo/setup-clojure btw, github action support prerelease as well. Might make the way to try it a little bit easier šŸ˜„

vlaaad 2020-09-23T16:05:25.007400Z

I havenā€™t, but Iā€™d like to do it today

alexmiller 2020-09-23T16:25:38.007600Z

:thumbsup:

seancorfield 2020-09-23T16:33:10.007800Z

Installed it Monday night and integrated it into our dev/test/build pipeline -- everything is working as expected. REPLs, aliases, running tests, building uberjars...

ghadi 2020-09-23T16:52:10.008200Z

works beautifully @delaguardo. Thanks so much!

alexmiller 2020-09-23T16:53:43.008500Z

Thx, good to hear

seancorfield 2020-09-23T17:01:37.010100Z

@delaguardo I'm using your setup for GH Actions on several of my projects so "Thank you!" -- one comment: using tools-deps for the CLI version is a bit confusing since tools.deps is a library with a different version numbering schema -- Clojure CLI 1.10.1.693 uses tools.deps 0.9.799 for example.

2020-09-24T08:32:57.008Z

thanks for the feedback! I made a PR to address that confusion: https://github.com/DeLaGuardo/setup-clojure/pull/13/files#diff-cdc05b01d72867060bc4d72cb108cf25 how do you think about it?

seancorfield 2020-09-24T15:38:08.025200Z

That looks good!

2020-09-24T15:53:52.030400Z

merged, thanks again for pointing on that

vlaaad 2020-09-23T18:44:13.010200Z

I'm just trying to understand the basis stuff, is this intended that :parents of a thing contains a thing itself?

cljfx/cljfx$jdk11 
{:mvn/version "1.7.9"
 :deps/manifest :mvn
 :dependents [cljfx/cljfx$jdk11 cljfx/cljfx]
 :parents #{[cljfx/cljfx cljfx/cljfx$jdk11]
            [cljfx/cljfx]}
 :paths ["C:\\Users\\Vlaaad\\.m2\\repository\\cljfx\\cljfx\\1.7.9\\cljfx-1.7.9-jdk11.jar"]}

vlaaad 2020-09-23T18:44:41.010400Z

(that's an entry in :libs)

alexmiller 2020-09-23T18:56:31.010600Z

you should consider :parents to be undefined for now

alexmiller 2020-09-23T18:57:16.010800Z

in other words, that's internal implementation stuff leaking out and I make no guarantee it will be there or be anything in particular :)

vlaaad 2020-09-23T18:58:07.011Z

ah, okay. what's not internal there?

alexmiller 2020-09-23T18:58:17.011200Z

everything else

alexmiller 2020-09-23T18:59:30.011400Z

to your original question, I'm not sure why'd you see that though, if you could send me your deps.edn, I'd like to look at it

vlaaad 2020-09-23T19:22:44.011600Z

this is deps.edn: https://github.com/vlaaad/reveal/blob/master/deps.edn

vlaaad 2020-09-23T19:23:58.011900Z

I can reproduce it by using clj without any other args and then loading the basis as described here https://clojure.org/reference/deps_and_cli_prerelease#_basis_injection

vlaaad 2020-09-23T19:24:13.012100Z

(clj on windows, if that matters)

alexmiller 2020-09-23T19:46:50.012300Z

doesn't matter. I look at it's a quirk of how classifier libs work in maven. when you have a lib foo and a classifier jar foo$a they technically both use the same pom. in this case, the root jar depends on the classifier jar, which has the same pom, so it looks like it depends on itself.

alexmiller 2020-09-23T19:47:03.012500Z

so, expected but weird :)

vlaaad 2020-09-23T19:53:04.012700Z

ah, I see, thanks for clarification!

grzm 2020-09-23T20:21:09.013900Z

Where might addressing https://clojure.atlassian.net/browse/TDEPS-46 ā€œRepositories from dependenciesā€™ pom.xml are not usedā€ be on the horizon? Any pointers on where one might get started on fixing it?

seancorfield 2020-09-23T20:25:11.016100Z

@alexmiller We haven't seen any impact of the changes to classpath order (yay!) but that made me wonder about pom.xml generation: is the order of the <dependencies> section there important, from a Maven p.o.v.? i.e., does it affect the order things show up on the classpath and does clojure -Spom generate the <dependencies> section in a reproducible order now based on the classpath?

alexmiller 2020-09-23T21:01:27.016800Z

good question. the order is important to maven (you should get deps in the order listed in the pom) and I have not explicitly looked at that ordering wrt deps

vlaaad 2020-09-23T21:07:51.017900Z

so that might be unstable if deployed library is used in a project that uses maven as a build tool?

alexmiller 2020-09-23T21:11:07.019500Z

well, deps.edn takes its deps in a map so from a clj pov, there is no order set by the user (the new changes order by alpha)

alexmiller 2020-09-23T21:12:50.020500Z

@seancorfield if you wanted to file a jira about this, I'd be happy to look at it

alexmiller 2020-09-23T21:53:22.020600Z

Hey, sorry I didn't catch your question earlier in the flow...

alexmiller 2020-09-23T21:54:05.020800Z

I am honestly reluctant to fix this the more I think about it and talk to others about it

alexmiller 2020-09-23T21:55:28.021Z

There are a lot of security concerns around getting someone's else repository, which may either be an internal repo or a repo that provides rogue versions of deps defined in central repos

alexmiller 2020-09-23T21:55:52.021200Z

So my recommendation right now would be to add those repositories explicitly to your deps/pom instead

grzm 2020-09-23T22:02:03.021400Z

Thanks for the feedback! We ran into this today, so I wanted to see what the current thinking on this is. Cheers!

seancorfield 2020-09-23T22:14:19.022800Z

@alexmiller I don't care enough about the issue to file a Jira ticket. I was mostly just curious if you knew off the top of your head whether -Spom generated <dependencies> in the same order as they would now appear on the classpath.

seancorfield 2020-09-23T22:14:44.023300Z

(I didn't care much about the non-reproducible classpath ordering before either -- although some others did)

alexmiller 2020-09-23T22:17:55.024800Z

I looked at the code and the answer is no - they are not necessarily in the same order they'd appear on the classpath

1