I am back from Debconf 9 in Cáceres. As usual it was a great time to meet other Debian contributor and to exchange knowledge.

This year we come with several new and old pieces of OCaml code that has attracted unexpected people to OCaml:

  • the debian release team ask us for some demonstration of the language in order to see if the transition monitor is usable for general transition tracking
  • Joachim Breitner is now using edos-debcheck to enhance test before starting build (should save time if some package are uninstallable)

Git repository of dh-ocaml

During Debcamp we, the OCaml Debian task force, have done a big work on dh_ocaml and related tools:

  • dh_ocaml can now computes Depends/Provides and .md5sums file for every OCaml package
  • dh_ocamldoc can produce documentation and is a replacement for CDBS ocamldoc targets
  • dh_ocamlinit do replacement in debian/*.in files just as ocamlinit.mk before
  • lintian tests (bug submitted to lintian for integration)
  • policy review (still in progress)

The dh_ocaml is working as follow:

  • it makes the distinction between 3 kinds of packages: dev, runtime, and (standard) binary
    • dev and runtime package are always associated since runtime just provide non-development objects of a dev package
    • binary package that are not dev neither runtime package
  • dev and runtime packages are scanned for objects containing assumptions (*.cmx, *.cmi, *.cmo...)
  • all packages are scanned for bytecode executables that also contain assumptions
  • assumption are extracted and sorted into 2 categories: defined and imported
  • defined assumptions are used to compute interfaces provided by the package
  • imported assumptions are used to compute interfaces from which Depends the package
  • defined assumption is used to generate .md5sums file that will be distributed in the dev package and will be used to compute Depends for other packages

Provides and Depends use virtual packages and checksums of the defined assumptions. E.g. it use libzip-ocaml-dev-12z3a to stat dependency to libzip-ocaml-dev, the 12z3a is the base 36 checksum of the 5 first digits of the MD5 of defined interfaces. This way, if some interfaces change in camlzip, checksums will also change and will make package that depends on libzip-ocaml-dev-12z3a not installable. It should prevent user to install packages that don't make good assumptions about libzip-ocaml-dev.

Package "ocaml" (resp. "ocaml-nox") is a dev package, its runtime is "ocaml-base" (resp "ocaml-base-nox"). In the case of this OCaml base packages, we use the upstream version rather than the checksum in the Provides/Depends. So provided packages are "ocaml-3.11.1" (runtime "ocaml-base-3.11.1"), "ocaml-nox-3.11.1" (runtime "ocaml-base-nox-3.11.1"). In fact, using this scheme we just fallback to the earlier way of making Depends in OCaml Debian packages, except that now it is automatically computed and generalized

Depends are computed using the type of packages: runtime and binary package will Depends on other runtime packages, dev packages will Depends on other dev packages. E.g. headache is a bytecode executable, this package is classified as a binary package. dh_ocaml automatically make it Depends on "ocaml-base-nox-3.11.1" because it contains bytecode objects that used it. Another example, libzip-ocaml-dev is a dev package and dh_ocaml make it Depends on "ocaml-nox-3.11.1".

We have checked on a various packages this Depends/Provides field completion and it seems to work quite well. We have found unexpected dependencies (ocaml-findlib depending on "ocaml-3.11.1" because it contains a wizard using Tk). We have also found unexpected defined interface (ocaml-fileutils defines module Unix due to a "-linkall" flag when building the .cma).

What remains to do:

  • dh_ocaml needs to make the difference between arch-independent and dependent provides
  • dh_ocaml needs to do binNMU safe version between internal packages (i.e. ones being built)
  • some more tools: dh_ocamlmeta to install META files (with good version), dh_ocamldirs to create standard directories, dh_ocamlinstall to move objects in dev and runtime package from debian/tmp build directory.

All this new tools should help to track automatically dependencies between packages and ease the work of OCaml debian task force. Debcamp was a great time for a brainstorm on Debian OCaml package management. The overall quality of OCaml in Debian should be increased.