Fork me on GitHub
#tools-deps
<
2018-09-17
>
seancorfield00:09:44

TDEPS-74 seems to get to the heart of it. OK, I guess I'll go vote for it!

seancorfield23:09:12

@alexmiller @arrdem was offering a patch for the local/root issue I believe...

Alex Miller (Clojure team)23:09:52

well I’ve thought about it a lot and haven’t come up with a solution I’m happy with

seancorfield23:09:18

If the tools.deps reader converted paths (from :paths, :extra-paths, and :local/root -- and maybe others?) from relative to absolute, based on the location of the deps.edn file in which they occur, would that solve the problem?

seancorfield23:09:47

(or, rephrased, at what point does tools.deps convert paths to absolute ones -- they are absolute in the classpath at the end)

Alex Miller (Clojure team)23:09:26

the extension does it when it resolves the paths for a dep

Alex Miller (Clojure team)23:09:28

but it’s really about what the “current directory” means when you are resolving a transitive dep by relative path - currently nothing is shifting that context so you always have the root dep context

seancorfield23:09:45

Ah, and paths can be in both the system deps and the per-user deps and of course you don't want those resolved against the file they're defined in... yeah...

seancorfield23:09:18

And by the time you've collapsed all the deps down, you've lost that context, right?

Alex Miller (Clojure team)23:09:22

yeah. we actually conceived local deps primarily as working primarily with absolute paths - all the stuff people are doing with relative paths and monorepos is somewhat emergent

arrdem23:09:25

So for https://github.com/fundingcircle/lein-modules, we added a “//” notation somewhat stolen from pantsbuild - the idea was that paths which were not “//” prefixed were treated as relative and just passed around, “//” prefixed paths were treated as being absolute with respect to the project.clj the path occurred in - for us implicitly the “root” project.clj of the repo which emulates the meaning of “//” in Google Blaze derived systems where “//” is repo root when referring to build target names.

Alex Miller (Clojure team)02:09:14

Yeah, I’m not doing that :)

arrdem05:09:17

Perhaps a more serious option here would be #file EDN extensions... maybe not suitable for general purpose but perhaps useful for us.

Alex Miller (Clojure team)05:09:41

None of that seems necessary to me

Alex Miller (Clojure team)05:09:15

I think the intent of this kind of setup is clear as is, the questions are in the implementation

arrdem23:09:36

That’s worked out OK at best for us.