# \[RFC\] Set up OCaml - Extends

**URL:** <https://discuss.ocaml.org/t/rfc-set-up-ocaml-extends/8681>\
**Category:** Ecosystem\
**Created:** [October 23, 2021, 7:51pm UTC](https://discuss.ocaml.org/t/rfc-set-up-ocaml-extends/8681 "2021-10-23T19:51:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![smorimoto](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/smorimoto/32/6479_2.png) [@smorimoto](https://discuss.ocaml.org/u/smorimoto)\
**Post date:** [October 23, 2021, 7:51pm UTC](https://discuss.ocaml.org/t/rfc-set-up-ocaml-extends/8681/1 "2021-10-23T19:51:25Z")

</div>

I was a bit surprised to see that many users were not using setup-ocaml and GitHub Actions to publish odoc to GitHub Pages, even though it was not so hard. So I’m trying to publish some extends in the setup-ocaml repository but I’d like to see how the community actually thinks about this.

The early ones are the following extends:

- deploy-doc
  - Deploy odoc to GitHub Pages

- lint-doc
  - Check if your doc comments are error-and-warning-free

- lint-fmt
  - Check if your files are well-formatted

- lint-opam
  - Check if your dune and opam dependencies are consistent

Except for deploy-doc, all extends allow us to do the same thing with just copy and paste on GitHub Actions that the CI infrastructure called ocaml-ci, which we are currently using in the Mirage project, etc.

> <https://github.com/ocaml/setup-ocaml/pull/297>
>
> Add "extends" experimentally. The purpose is to provide more strong crash barrie…rs for the user's OCaml project, and/or to encourage the document to be deployed. However, this PR is a sort of RFC, and it's not yet sure if it can actually be merged.

---

<div class="post-metadata">

**Author:** ![smorimoto](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/smorimoto/32/6479_2.png) [@smorimoto](https://discuss.ocaml.org/u/smorimoto)\
**Post date:** [October 23, 2021, 7:53pm UTC](https://discuss.ocaml.org/t/rfc-set-up-ocaml-extends/8681/2 "2021-10-23T19:53:15Z")

</div>

At this stage, deploy-doc does not yet support cross-reference document generation, but if the community really wants it, we can hack on our side to make it simple for users to use them, until we implement support on the dune side.

---

<div class="post-metadata">

**Author:** ![yawaramin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yawaramin/32/3384_2.png) [@yawaramin](https://discuss.ocaml.org/u/yawaramin)\
**Post date:** [October 24, 2021, 3:38am UTC](https://discuss.ocaml.org/t/rfc-set-up-ocaml-extends/8681/3 "2021-10-24T03:38:52Z")

</div>

Wouldn’t it be easier to wait a bit for the v3 site? And arguably a little better since it will be a consolidated source of API docs.

---

<div class="post-metadata">

**Author:** ![BikalGurung](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/bikalgurung/32/5105_2.png) [@BikalGurung](https://discuss.ocaml.org/u/BikalGurung)\
**Post date:** [October 25, 2021, 8:36am UTC](https://discuss.ocaml.org/t/rfc-set-up-ocaml-extends/8681/4 "2021-10-25T08:36:05Z")

</div>

> [@smorimoto](#):
>
> I was a bit surprised to see that many users were not using setup-ocaml and GitHub Actions to publish odoc to GitHub Pages, even though it was not so hard

Is there an example of such step? i.e. publishing ocaml docs to github pages when using setup-ocaml?

---

<div class="post-metadata">

**Author:** ![smorimoto](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/smorimoto/32/6479_2.png) [@smorimoto](https://discuss.ocaml.org/u/smorimoto)\
**Post date:** [November 5, 2021, 3:05pm UTC](https://discuss.ocaml.org/t/rfc-set-up-ocaml-extends/8681/5 "2021-11-05T15:05:50Z")

</div>

Fair enough. But it’s a bit better in terms of giving you more control. For example, always generate a document with the latest commit, and/or lint is just helpful for finding document errors.

---

<div class="post-metadata">

**Author:** ![smorimoto](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/smorimoto/32/6479_2.png) [@smorimoto](https://discuss.ocaml.org/u/smorimoto)\
**Post date:** [November 5, 2021, 3:07pm UTC](https://discuss.ocaml.org/t/rfc-set-up-ocaml-extends/8681/6 "2021-11-05T15:07:55Z")

</div>

You can check that here. It’s actually possible to do just with deploy-doc, but each project requires a different OCaml compiler constraint, so it’s set up as a different action.

> **[GitHub - smorimoto/setup-ocaml at extends - deploy-doc](https://github.com/smorimoto/setup-ocaml/tree/extends#deploy-doc)**
>
> extends
