2.2. Bytecode Packages

A bytecode package has all its binaries compiled into bytecode. It depends on a package containing the OCaml runtime system. By consequence, such a package has its architecture field set to all.

A bytecode package must depend on ocaml-base-nox-3.09.2 (or ocaml-base-3.09.2 if the program either uses the Graphics or the LablTk module). In order for the package to be able to be rebuilt or even binNMUed without a change in the packaging, this version should not be hardcoded in the debian/control file. Instead, the package should depend on ocaml-base-nox-${F:OCamlABI} and use OCAMLABI := $(shell ocamlc -version) and dh_gencontrol -- -VF:OCamlABI="$(OCAMLABI)" in the debian/rules file.

A bytecode package must build-depend-indep on ocaml-nox-3.09.2 (or ocaml-3.09.2 if the program either uses the Graphics or the LablTk module). The current version number of OCaml should not be hardcoded into the build-dependency (this is a deviation from a practice which used be recommended but is depreciated now). Of course, if it is necessary to ensure that the version of OCaml has a certain value then version constraints can be used. However, this should be justified by the requirements of the compilation of the program.

Bytecode programs which are compiled by ocamlc -custom must not be stripped. In particular, their package should be excluded from the dh_strip script. When compiled this way, an elf executable is generated containing the ocaml interpreter, and the bytecode of the program in a section which is removed when the program is stripped. For more information, see the bug 256900. An override for the lintian warning is considered as acceptable in this situation.