samoht / assemblage

A collection of tools to manage the configuration of OCaml projects
54 stars 4 forks source link

Wrong .cmi files in .install #105

Closed lpw25 closed 10 years ago

lpw25 commented 10 years ago

The follwoing assemble.ml:

open Assemblage

(* OCamlfind packages *)
let lib_pkgs = [pkg "opam-lib"; pkg "opam-lib.client"; pkg "compiler-libs.common"; pkg "ocamlgraph"; pkg "findlib"]
let bin_pkgs = [pkg "cmdliner"]

(* Compilation units *)
let opamUnitsConfig  = unit "opamUnitsConfig" (`Path ["src"])
let opamLibrary = unit "opamLibrary" (`Path ["src"])
let opamUnit = unit "opamUnit" (`Path ["src"])
let opamUnitsState = unit "opamUnitsState" (`Path ["src"])
let main = unit "main" (`Path ["src"])

(* Binary and library *)
let l = lib ~deps:lib_pkgs "opam-units" (`Units [opamLibrary; opamUnit; opamUnitsConfig; opamUnitsState])
let b = bin ~deps:(l :: bin_pkgs) "opam-units" (`Units [main])

let () = assemble (project "opam-units" [b;l])

produces the following opam-units.install:

lib: [
  "META"
  "_build/lib-opam-units/opam-units.cmi"
  "_build/lib-opam-units/opam-units.cma"
  "?_build/lib-opam-units/opam-units.cmi"
  "?_build/lib-opam-units/opam-units.cmxa"
  "?_build/lib-opam-units/opam-units.a"
  "?_build/lib-opam-units/opam-units.cmxs"
  "?_build/lib-opam-units/opam-units.cmti"
]
bin: [
  "?_build/bin-opam-units/opam-units.byte" {"opam-units"}
  "?_build/bin-opam-units/opam-units.native" {"opam-units"}
  "?_build/bin-opam-units/opam-units.js" {"opam-units"}
]

This includes a non-existent opam-units.cmi rather than opamLibrary.cmi, opamUnitsConfig.cmi, opamUnit.cmi and opamUnitsState.cmi.

dbuenzli commented 10 years ago

Note that the api is not adapted here. As you really want to be able to define which cmi define your interface and install only that ones.

samoht commented 10 years ago

(and the cause of the bug is a regression I've introduced while removing the big recursive modules)