Enforcing Type-Safe Linking using Inter-Package Relationships
Mehdi Dogguy, Stéphane Glondu, Sylvain Le Gall, Gall S. Zacchiroli, Ocamlcore S. A. R. L · 2010
ABSTRACT. Strongly-typed languages rely on link-time checks to ensure that type safety is not violated at the borders of compilation units. Such checks entail very fine-grained dependencies among compilation units, which are at odds with the implicit assumption of backward compatibility that is relied upon by common library packaging techniques adopted by FOSS (Free and Open Source Software) package-based distributions. As a consequence, package managers are often unable to prevent users to install a set of libraries which cannot be linked together. We discuss how to guarantee link-time compatibility using inter-package relationships; in doing so, we take into account real-life maintainability problems such as support for automatic package rebuild and manageability of ABI (Application Binary Interface) strings by humans. We present thedh_ocaml implementation of the proposed solution, which is currently in use in the Debian distribution to safely deploy more than 300 OCaml-related packages. RÉSUMÉ. Les langages fortement typés reposent sur des vérifications lors de l’édition de liens afin de garantir que la sûreté du typage reste respectée entre différentes unités de compilation. Ces vérifications sont très strictes, et incompatibles avec l’usage dans les distributions de logiciels libres utilisant des paquets qui est de supposer que les bibliothèques sont rétrocompatibles. Ainsi, les gestionnaires de paquets sont souvent incapables d’empêcher un utilisateur 1. Partially supported by the European Community FP7, MANCOOSI project, grant agreement n. 214898d’installer un ensemble incohérent de bibliothèques. Nous étudions ici diverses approches à ce problème, et la solution que nous proposons, qui a été adoptée par Debian avec succès pour plus de 300 paquets.