Is my understanding correct that with Polylith, you generally develop using a single Clojure runtime that you run in the root of the project, instead of a separate runtime for each :local/root? If so, what happens e.g. if two components use different versions of the same lib?
Yes, normally the :dev project is where you run your REPL (so you typically jack-in and add the :dev alias to that command, or start your REPL manually with the :dev alias).
If your :dev project has both of those components, you'll get the latest version of the library, because that's how the Clojure CLI / deps.edn works.
Can you give a concrete example that you're concerned about?
I would assume that these two components are only ever used in different projects (and you have specific code that needs the older version of that library)?
Thanks! Yeah, I'm not sure I have a concrete example in mind yet (other than the, in this community, luckily unlikely situation where a library has a breaking change), just trying to understand how this thing's put together. I was going to ask about running tests for a limited set of modules, but I think this is the answer: https://github.com/seancorfield/polylith-external-test-runner
Yeah, that also gives you complete test/process isolation and protects you more against memory leaks in your tests. The trade off being, it spawns a new process for each project, when running tests.
(Or just run them from the REPL.)
Right, gotcha. 👍
While I'm developing, I tend to run individual tests or a whole ns of tests from my editor via hot keys. You can also ask Polylith to run tests for just a specific project or even just a specific set of bricks.