polylith

vacuous_gold 2025-09-28T07:36:21.600829Z

Hi, I imagine this question has already been asked, but after searching I only find messages from ~4 years ago: how do you pin library versions across the whole dev project? Let's say that we have 5 different components depending on com.github.seancorfield/next.jdbc {:mvn/version "1.2.796"} and you update one component to {:mvn/version "1.3.1070"} . I would like that something in CI (or locally too) fails because the library is not updated everywhere. Is there any way to enforce that all components in the workspace use the same version? I see that when doing a check or a libs nothing raises an error or a warning.

tengstrand 2025-09-28T08:56:31.486939Z

We could add a warning if libraries are out of sync. We have the https://cljdoc.org/d/polylith/clj-poly/0.2.22/doc/libraries#_updating command that updates all libraries (that are not specified in :keep-lib-versions) to the latest version. Would that command in combination with a warning (that checks all libraries, except those listed in :keep-lib-versions ) solve your problems?

vacuous_gold 2025-09-28T10:04:04.552119Z

I've seen that, but indeed, I'm more interested in out of sync failure in CI. To enforce updates across all deps.edn However, we are not always interested in updating to the latest. An example we face currently is the MySQL connector (`mysql/mysql-connector-java`) which made a breaking change for us on version 8.0.23 so we cannot update past 8.0.22 without further refactoring. Imagine we are everywhere on 8.0.21 and one deps.edn is updated to 8.0.22. I would like to enforce across the whole workspace that everything uses 8.0.22, basically enforcing that whenever the update to 22 is done is done across all deps.edn. But as this is the example the latest version is 8.0.33 (and 9.4.0 if we look at com.mysql/mysql-connector-j), which we are not interested in.

tengstrand 2025-09-28T10:54:40.587429Z

Okay, so if the poly tool finds the latest used version for all libraries and then make sure that version is used across all deps.edn files, e.g. by calling poly libs sync (not implemented yet) then it would solve your problem? I think we can reuse :keep-lib-versions for the new sync option (if implemented).

🙌 1
vacuous_gold 2025-09-28T11:17:45.254979Z

For our use case only reporting non-uniform libraries is enough. So there's no need to have to look up which one is newest. My intuitive idea is to have something like poly libs check (or poly libs :check, or poly check :uniform-libs, not too familiar with the poly tool to give my opinion on that) which reports non-uniform versions. For our use case we would like to convert this to an error on CI, but maybe somebody else just wants to report (hence no error status code, and just printing would be enough), or some people might want to ignore some known discrepancies. I'm not familiar with the tool to argue about a specific behaviour, and maybe what you say goes more in line with everything (`poly libs check` which finds the newest one and reports the ones that don't have the newest also). Just wanted to clarify that the minimal that I find useful is to report discrepancies (without associating a good or bad version), and converting that to an exit status locally or in CI.

tengstrand 2025-09-28T11:59:31.237649Z

Yes, I agree users probably have different needs here. I have a few ideas as well, so let's see if we can get more input from others in this thread!

seancorfield 2025-09-28T14:12:03.505299Z

Yes, we would find it useful to have a way to check for inconsistent lib versions across the workspace. Like the OP, I'm not interested in the keep lib versions or lib update stuff. I have other ways of dealing with version updates. But having poly libs be able to warn about bricks and projects that use the same lib with different versions would be very useful.

👌 1
👌🏿 1
tengstrand 2025-10-01T08:16:11.830529Z

What do you think about the suggested solution in issue https://github.com/polyfy/polylith/issues/562? @vacuous_gold_5t @seancorfield

seancorfield 2025-10-01T15:20:26.041599Z

I assume "yellow if :type is set to true" should be "yellow if :type is set to :warning" ?

tengstrand 2025-10-01T15:42:44.043179Z

Yes

seancorfield 2025-10-01T15:55:22.261859Z

The feature as spec'd looks pretty good to me.

👍 1
tengstrand 2025-09-29T07:34:44.920409Z

I created issue https://github.com/polyfy/polylith/issues/562. Please take a look and see if it meets your needs.

2025-09-28T08:15:05.913009Z

I also have many components depending on common dependencies. Not sure if others like it, but for me the following works. I have a dir in my project libs and there I put shims of common libs. E.g libs/next.jdbc with only a deps.edn pointing to one specific version. Then in the components deps.edn I just have next.jdbc {:local/root "../libs/next.jdbc"}. Now I only have to update next.jdbc in one place. (Typing from my phone so it is a bit limited)

💡 2