Suppose I make a major update of an opam package which breaks compatibility to previous versions. If many packages depends on my package, we need to add { < X.X.X } to a lot of packages.
I guess this is a common problem among packaging systems. I suppose this kind of situation is currently solved by manual effort, but it’s much better if this can be solved automatically somehow.
I can think of several solutions
Don’t do this. Keep it backward-compatible
If do this, change the package name
Introduce a convention; if the version number goes from 1.0 to 2.0, this indicates there is an incompatible change
Ideally, build compatibility of dependent packages should be done by automated testing on PRs to the opam-repo. Changing the semantics of an existing function is not nice and IMHO should go through an intermediate package where the function is declared deprecated (or maybe one could define a new attribute for this case?) in order to ease upgrading the code.