[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

version pinning in OPAM


Currently, the dev packages of mirage are managed with a special (git) backend 
in OPAM. As a user, its quite convenient to always have the latest HEAD 
installed of these packages, but as a developer, you must commit every changes 
you make in order to trigger a recompilation ... This can quickly become 
painful, so I've started implementing some kind of version pining for OPAM. I 
have a first prototype almost working, it allows you to do the following:

  $ opam pin mirage-0.3dev /local/path  # the path will be used instead of the 
remote git url
  [ cd /local/path && hack hack hack ]
  $ opam update  && opam upgrade # recompile all the packages which depends on 
mirage-0.3dev, using the contents you have registered with "opam pin"

Is this convenient ? Would it be better to have "opam pin mirage /local/path" 
instead (ie. no package version) and a more specific update/upgrade command 
(like "opam pin -reinstall") to just upgrade the pinned packages without having 
to do a full upgrade ?

Under the hook, I've done the following:

* on init,  we now have a special "rsync" OPAM repository, which will contain 
the pinned packages
* each time you call opam pin:
  - ~/.opam/repo/index is updated to say that the pin repo is prioritary for 
the the pinned package
  - ~/.opam/repo/pin/url/$package.$version is created, containing the new path
  -  the contents of the new path is copied in 
* on update, I've extended the behavior of the rsync backend to compare the 
cached version with the actual contents, and to mark the package as new if the 
diff is not empty
* the upgrade hasn't changed




Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.