exact version dependency for ocaml libraries

Ryan Schmidt ryandesign at macports.org
Thu Aug 19 10:13:23 PDT 2010


On Aug 19, 2010, at 12:01, Anil Madhavapeddy wrote:

> On 19 Aug 2010, at 17:38, Ryan Schmidt wrote:
> 
>> You wouldn't run ocamlc -version in the port; you would hardcode the current version number, and when a new ocaml is rereleased, manually update everywhere it was hardcoded.
>> 
>> I suppose it could be done in the portgroup somehow. But for example for the bundled php5 extensions, I just hardcode it in every port. Somehow it didn't feel right to be fiddling with ${version} outside of the portfile itself.
> 
> That's fine, except that if the user doesn't actually upgrade their ocaml compiler but just the port, then the hardcoded version is actually wrong.
> 
> e.g. i have:
> 
> ocaml-3.11
> caml-findlib-1.2.5-ocaml-3.11
> 
> installed
> 
> then a new upstream versions come in:
> ocaml-3.12
> caml-findlib-1.2.5-ocaml-3.12
> 
> If the user just does a 'port upgrade caml-findlib', they would have it compiled with the older version of the compiler, and things would break.

1. If the user just does "sudo port upgrade caml-findlib" but ocaml is outdated, MacPorts will upgrade ocaml first since ocaml is a dependency.

2. If the user does "sudo port -n upgrade caml-findlib" to prevent MacPorts from automatically upgrading dependencies like it usually would, you should prevent the installation in the port (or, better yet, portgroup) if the versions don't match. See how the php5extension portgroup does this.

I'm seeing there isn't a portgroup for ocaml yet, so one should be created and commonalities should be factored out of the various ocaml ports into the portgroup. It's high time for that anyway.


> It would be a lot easier to be able to have a port depend on an *explicit* version of a subport, so caml-findlib-1.25 could depend on =ocaml-3.11.  Is that difficult to add in as a feature in the current Macports infrastructure?

I don't know.

Recall that MacPorts does not support installing any arbitrary version of a port; you can only install the currently-available version. So that would have to be taken into consideration if someone were to design this feature.





More information about the macports-dev mailing list