ocaml_signature Last updated Mar 27, 2025

load("@rules_ocaml//build:rules.bzl", "ocaml_signature")

Generates OCaml .cmi (inteface) file. (signatures). Provides OCamlSignatureProvider.

CONFIGURABLE DEFAULTS for rule ocaml_signature

In addition to the [Configurable defaults] that apply to all ocaml_* rules, the following apply to this rule. (Note the difference between '/' and ':' in such labels):

Label Default opts attrib

@rules_ocaml//cfg/signature/linkall

True

-linkall, -no-linkall

@rules_ocaml//cfg/signature:warnings

@1..3@5..28@30..39@43@46..47@49..57@61..62-40

-w plus option value

Attributes

Name Description Type Mandatory Default

name

A unique name for this target.

Name

required

deps

List of OCaml dependencies. Use this for compiling a .mli source file with deps. See [Dependencies](#deps) for details.

List of labels

optional

[]

src

A single .mli source file label

Label

optional

None

env

Env variables

Dictionary: String -> String

optional

{}

module_name

Set module (sig) name to this string

String

optional

""

ns

Bottom-up namespacing

Label

optional

None

open

List of OCaml dependencies to be passed with -open.

List of labels

optional

[]

opts

List of compile options; overrides configurable default options. Supports -no- prefix for each option; for example, -no-linkall.

List of strings

optional

[]

pack

Experimental

String

optional

""

ppx

Label of ppx_executable target to be used to transform source before compilation.

Label

optional

None

ppx_args

Options to pass to PPX executable passed by the ppx attribute.

List of strings

optional

[]

ppx_data

PPX runtime data dependencies. List of labels of files needed by the PPX executable passed via the ppx attribute when it is executed to transform the source file. For example, a source file using ppx_optcomp may import a file using extension [%%import ]; this file should be listed in this attribute.

List of labels

optional

[]

ppx_print

Format of output of PPX transform: binary (default) or text. Value must be one of @rules_ocaml//ppx/print:binary! or @rules_ocaml//ppx/print:text!.

Label

optional

None

ppx_verbose

-

Boolean

optional

False

xmo

Cross-module optimization. If false, compile with -opaque

Boolean

optional

True