ocaml_ns Last updated Mar 27, 2025
ocaml_ns
load("@rules_ocaml//build:rules.bzl", "ocaml_ns")
ocaml_ns(*, name, env, import_as, ns_import_as, ns_merge, ns_name, opts, private, submodules, visibility)
Macro. Expands to an ocaml_ns_config and an ocaml_ns_module target that together define an OCaml build namespace.
Attributes
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
A unique name for this macro instance. Normally, this is also the name for the macro’s main or only target. The names of any other targets that this macro might create will be this name with a string suffix. |
required |
|||
Env variables |
optional |
|
||
Import exogenous (non-namepaced) modules. Exogenous (sub)modules, namespaced or non-namespaced. Aliased names will not be prefixed with ns name of this ns_config. Keys: labels of modules; Values: alias name to be used in this resolver. e.g. module R = Red |
optional |
|
||
Import exogenous namespaces ( Dictionary: keys are exogenous namespaces ( |
optional |
|
||
Merges all submodules of an exogenous namespace. |
optional |
|
||
Use this as the ns name (prefix string) |
String |
optional |
|
|
List of compile options; overrides configurable default options. Supports |
List of strings |
optional |
|
|
When True, adds suffix Not to be confused with the visibility attribute, which controls visibility of the target within the Bazel environment. |
Boolean |
optional |
|
|
List of strings from which submodule names are to be derived for aliasing. Bazel labels may be used; the submodule name will be derived from the target part. For example, '//a/b:c' normalizes to C. But they are just strings, and will not be checked against any files. The normalized submodule names must match the names of the modules electing membership via the 'ns_config' attribute. |
List of strings |
optional |
|
|
The visibility to be passed to this macro’s exported targets. It always implicitly includes the location where this macro is instantiated, so this attribute only needs to be explicitly set if you want the macro’s targets to be additionally visible somewhere else. |
optional |