Skip to content

Commit

Permalink
Fix opam install instructions
Browse files Browse the repository at this point in the history
- using `--bare` doesn't create a switch, and the `pin` command then fails
  (but fix ocaml version to 5.0.0 so that catala doesn't need to change the version)
- the pin-depends of catala-lsp require catala to be pinned to version `dev`, so explicit
  that version in advance when pinning so that it doesn't get reinstalled
- otherwise `opan pin <url>` is enough, `opam pin add <pkg>.<version> <url>` is unnecessarily verbose
  • Loading branch information
AltGr committed Jan 30, 2025
1 parent 3abb7cb commit a1714a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
book
_build
.#*
#*#
13 changes: 7 additions & 6 deletions src/1-1-installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ $ bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)"

Then, initialize `opam`:
```bash
$ opam init --bare
$ opam init -c 5.0.0
$ eval $(opam env)
```

### Getting Catala

Run the following command to install the latest Catala version via `opam`:

```bash
$ opam pin add catala git+https://github.com/CatalaLang/catala -y
$ opam pin catala.dev git+https://github.com/CatalaLang/catala -y
```

Once this finishes, the Catala compiler (and its build system) should
Expand All @@ -57,7 +58,7 @@ The VSCode extension requires the Catala's Language Server Protocol to be instal
This can be done by running:

```bash
$ opam pin add catala-lsp git+https://github.com/CatalaLang/catala-language-server -y
$ opam pin catala-lsp.dev git+https://github.com/CatalaLang/catala-language-server -y
```

### Getting the VSCode extension
Expand All @@ -77,7 +78,7 @@ installed, you will need to load a WSL VSCode window by pressing F1

Run the following command:
```bash
$ opam pin add catala git+https://github.com/CatalaLang/catala-format -y
$ opam pin catala-format.dev git+https://github.com/CatalaLang/catala-format -y
```

_Note_: this installation will take some time as it requires a Rust
Expand Down Expand Up @@ -105,7 +106,7 @@ instructions: https://opam.ocaml.org/doc/Install.html

Then, initialize `opam`:
```bash
$ opam init --bare
$ opam init -c 5.0.0
```

### Getting Catala
Expand All @@ -115,7 +116,7 @@ Windows. However, the Catala's lsp server bundles a subset of Catala
which is fine. This may be installed the same way as Linux/WSL2:

```bash
$ opam pin add catala git+https://github.com/CatalaLang/catala-lsp -y
$ opam pin git+https://github.com/CatalaLang/catala-lsp -y
```

### Setting up the Catala LSP server
Expand Down

0 comments on commit a1714a5

Please sign in to comment.