# Ocaml (/pipeline-sdk/reference/toolchains/ocaml)



{/* Generated by docs-site/scripts/generate-dsl-docs.ts — do not edit. */}

## `ocaml` [#ocaml]

Callable singleton for the OCaml toolchain — access as `hm.ocaml`.

Call directly to construct an `OCamlProject`, or use the bare-form
action methods (`ocaml.build()`, `ocaml.test()`, etc.) for a
one-shot leaf.

```python
ocaml(*, path='.', compiler='5.1.1', image=None, base=None) -> OCamlProject
```

| Parameter                                                  | Type           | Default   | Description                                              |
| ---------------------------------------------------------- | -------------- | --------- | -------------------------------------------------------- |
| `path`                                                     | `str`          | `'.'`     | Path to the OCaml project root. If `*.opam` files are    |
| present, `opam install . --deps-only` is run and cached on |                |           |                                                          |
| those files.                                               |                |           |                                                          |
| `compiler`                                                 | `str`          | `'5.1.1'` | OCaml compiler version to install via opam               |
| (e.g. `"5.1.1"`).                                          |                |           |                                                          |
| `image`                                                    | `str \| None`  | `None`    | Local-mode Docker base image override.                   |
| `base`                                                     | `Step \| None` | `None`    | Existing `Step` to attach to instead of emitting a fresh |
| apt-base step.                                             |                |           |                                                          |

**Returns** `OCamlProject` — An `OCamlProject` whose `installed` step is the opam-deps step.

### `ocaml.build()` [#ocamlbuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `ocaml.fmt()` [#ocamlfmt]

```python
fmt(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `ocaml.test()` [#ocamltest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `OCamlEntry` [#ocamlentry]

Callable singleton for the OCaml toolchain — access as `hm.ocaml`.

Call directly to construct an `OCamlProject`, or use the bare-form
action methods (`ocaml.build()`, `ocaml.test()`, etc.) for a
one-shot leaf.

### `OCamlEntry.build()` [#ocamlentrybuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `OCamlEntry.fmt()` [#ocamlentryfmt]

```python
fmt(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `OCamlEntry.test()` [#ocamlentrytest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `OCamlProject` [#ocamlproject]

OCaml project install chain — constructed via `hm.ocaml()`.

`installed` is the opam-deps step. Action methods (`build`,
`test`, `fmt`) attach leaves to `installed`.

### Fields [#fields]

| Field       | Type   | Default    |
| ----------- | ------ | ---------- |
| `path`      | `str`  | *required* |
| `installed` | `Step` | *required* |

### `OCamlProject.build()` [#ocamlprojectbuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `OCamlProject.fmt()` [#ocamlprojectfmt]

```python
fmt(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `OCamlProject.test()` [#ocamlprojecttest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`
