This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 0159444c2 chore(bindings/ocaml): Add contributing document to readme 
(#2829)
0159444c2 is described below

commit 0159444c29f2df791036efe7e7088b1934cfb588
Author: ran <[email protected]>
AuthorDate: Wed Aug 9 16:29:12 2023 +0800

    chore(bindings/ocaml): Add contributing document to readme (#2829)
    
    add contributing document to readme
---
 bindings/ocaml/README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 58 insertions(+), 3 deletions(-)

diff --git a/bindings/ocaml/README.md b/bindings/ocaml/README.md
index 9d9167c0c..4e116d8bf 100644
--- a/bindings/ocaml/README.md
+++ b/bindings/ocaml/README.md
@@ -5,17 +5,72 @@
 * OCaml version > 4.03 and < 5.0.0
 
 
-## Build
+## Contributing
 
 
+### Setup
+We recommend using `OPAM the OCaml Package Manager` to install and manage the 
OCaml environment.
+
+#### Install OPAM
+
+The quickest way to get the latest opam up and working is to run this script:
+```bash
+bash -c "sh <(curl -fsSL 
https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)"
+```
+Similarly, you can also use your distribution's package manager to install
+
+##### Arch
+```bash
+pacman -S opam
+```
+##### Debian | Ubuntu
+```bash
+apt-get install opam
+```
+
+#### Init OPAM
+*Do not put sudo in front of any opam commands. That would break your OCaml 
installation.*
+
+After Install OPAM, we need initialize it
+
+For the general case, we can execute 
+```bash
+opam init --bare -a -y
+```
+If you are using WSL1 on windows, run:
+```bash
+opam init --bare -a -y --disable-sandboxing
+```
+
+
+
+#### Create OPAM Switch
+Using opam we can have multiple versions of ocaml at the same time, this is 
called switch. 
+
+Due to the upstream `ocaml-rs`, we currently do not support OCaml5, and 
recommend using the latest version of OCaml4
+We can create use this command:
+
+```
+opam switch create opendal-ocaml4.14 ocaml-base-compiler.4.14.0
+
+eval $(opam env)
+```
+#### Install OPAM Package
+
+opendal does not depend on opam package except `ounit2` for testing.
+However, in order to facilitate development in an IDE such as vscode, it is 
usually necessary to install the following content
+```bash
+opam install -y utop odoc ounit2 ocaml-lsp-server ocamlformat ocamlformat-rpc
+```
+### Build
 
 ```bash
 cd bindings/ocaml
 dune build
 ```
 
-## Test
-
+### Test
+To execute unit tests, we can simply use the following command:
 ```bash
 cd bindings/ocaml
 dune test

Reply via email to