clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
2020-02-12T21:09:12.032300Z

In my experiments at reading ~11K project.clj files using clojure.edn/read, I just tried doing the same replacing clojure.edn/read with clojure.tools.reader.edn/read, and got somewhat different results. No action items for anyone now -- I will probably try soon-ish to look at particular examples that give differences, to see what they are.

2020-02-12T21:09:41.032800Z

I looked at the tools.reader README where it lists differences with LispReader at the end, and didn't see any mentioned for the edn reader.

2020-02-12T21:10:29.033400Z

This is definitely semi-abusing an EDN reader, feeding it many files which weren't intended to be read by an EDN reader, so I won't be surprised if the differences are all "works as designed" here.

cfleming 2020-02-12T21:29:55.034900Z

I would be interested in hearing about those differences. In my experience, people do all sorts of crazy stuff in their project files. My bet would be quasiquoting or something like that which I’ve seen a lot of, but I’m sure there’s weirder stuff out there.

2020-02-12T21:34:26.035900Z

This was part of an experiment motivated by a question asked by Alex Miller in #tools-deps channel a few days ago. The results I have so far are here, if you are curious: https://github.com/jafingerhut/haironfire

telekid 2020-02-13T20:55:07.000100Z

This is very cool work

2020-02-12T21:35:36.036700Z

Most don't do crazy stuff in their project.clj files, but I expect you experience more interesting queries from those who do 🙂

2020-02-12T21:36:32.037600Z

A few have joined "sharp equals" club in their project.clj files, but that is very rare.

cfleming 2020-02-12T21:36:39.037900Z

Yes, Cursive has some horrendous black magic to be able to handle as many cases as possible. Integrating lein was the hardest thing I think I’ve done, or at least the most frustrating.

cfleming 2020-02-12T21:39:29.038800Z

I think the other problem is that you also can’t read project.clj files without evaluating plugins. In particular, projects using things like lein-modules will probably read as EDN but won’t contain correct information.

cfleming 2020-02-12T21:40:49.039600Z

I think you would need to read the project as EDN, then if you get no errors read the project by calling into lein, and compare those results.

cfleming 2020-02-12T21:41:20.039800Z

https://github.com/jcrossley3/lein-modules

2020-02-13T23:29:12.000300Z

@cfleming I wanted to verify that it is OK with you if I copy and paste your comments here into a README in my haironfire repository, as notes on how challenging it can be to calculate accurate dependencies for a Leiningen project. Feel free to say no, if you would prefer these words to be lost to the ether more quickly 🙂

cfleming 2020-02-14T00:02:49.000500Z

That’s fine by me.

2020-02-14T00:22:00.000700Z

Got it. Thanks.

2020-02-14T00:23:42.000900Z

My little article won't drive any new business your way, I doubt, but I'll give you credit and link to Cursive's home page 🙂

cfleming 2020-02-14T00:24:03.001100Z

Thank you 🙂. Every little helps.

2020-02-12T21:48:24.040500Z

Do you have any knowledge of whether plugins can affect the value of the :dependencies list?

2020-02-12T21:48:35.041Z

That is all we are really looking for here.

alexmiller 2020-02-12T21:48:40.041300Z

isn't that how the lein git deps stuff works?

cfleming 2020-02-12T21:48:42.041400Z

Yes, they do - check the lein-modules example.

cfleming 2020-02-12T21:49:13.041500Z

As a plugin, you mean?

cfleming 2020-02-12T21:50:49.043100Z

There’s an example at the bottom of the readme. It allows "_" to be used as a placeholder for the version, and that then comes from a separate map. I believe in the case of submodules, the version map may actually be in the parent project, not the submodule itself, so the project.clj of the submodule is not fully self-contained.

2020-02-12T21:56:14.043200Z

My quick hack analysis code did check for whether version number strings were in the dependencies, or not. I was also only looking for project.clj files in the root directory of the git repo. About 8% had no project.clj file in the root dir, nor deps.edn, and I wasn't looking in subdirectories.

alexmiller 2020-02-12T21:56:40.043400Z

yeah

2020-02-12T21:58:19.043600Z

Of those 8%, a bit over half of those had build.boot files in root directory, and may not have had any use of Leiningen at all.

cfleming 2020-02-12T22:05:30.043800Z

I actually didn’t know that was a thing. Looks like there’s this, which isn’t actually a plugin, it’s a task which just downloads the code, and you have to manually add extra source roots to refer to it: https://github.com/tobyhede/lein-git-deps

cfleming 2020-02-12T22:06:05.044100Z

There’s also this, which is a plugin: https://github.com/reifyhealth/lein-git-down

alexmiller 2020-02-12T22:28:56.044400Z

I was actually thinking of the latter

alexmiller 2020-02-12T22:29:44.044700Z

I think there is also another that is newer (post clj) https://github.com/RickMoynihan/lein-tools-deps