Skip to content

Commit 7ed50bd

Browse files
Merge branch 'ocaml:main' into main
2 parents 130dfd9 + 4a50587 commit 7ed50bd

23 files changed

+695
-197
lines changed

.github/workflows/debug-ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- ocaml-base-compiler.4.14.1
2020

2121
steps:
22-
- name: Checkout Repo
22+
- name: Checkout code
2323
uses: actions/checkout@v4
2424

2525
- name: Use OCaml ${{ matrix.ocaml-compiler }}
@@ -36,12 +36,15 @@ jobs:
3636
if: runner.os == 'Linux'
3737

3838
- name: Install system dependencies (macOS)
39-
run: brew install libev openssl@3.3 # Openssl is a workaround for https://github.com/ocaml/opam-repository/issues/19676
39+
run: brew update && brew reinstall libev openssl@3 # Openssl is a workaround for https://github.com/ocaml/opam-repository/issues/19676
4040
if: runner.os == 'macOS'
4141

4242
- name: Install opam dependencies
43-
run: opam install --deps-only .
43+
run: opam install --deps-only --with-test .
4444

4545
- name: Build project
46-
run: opam exec -- dune build
46+
run: opam exec -- dune build @install
47+
48+
- name: Run tests
49+
run: opam exec -- dune test
4750

HACKING.md

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@
22

33
## Setup and Development
44

5-
### Setting up the Project
5+
### Setting Up the Project
66

7-
Before starting to hack you need a properly configured development environment. Linux and macOS are supported and used daily by the core team. System dependencies include:
7+
Before starting to hack, you need a properly configured development environment. Linux and macOS are supported and used daily by the core team. System dependencies include:
88
* Libev: http://software.schmorp.de/pkg/libev.html
99
* Oniguruma: https://github.com/kkos/oniguruma
1010
* OpenSSL: https://www.openssl.org/
1111
* GNU Multiple Precision: https://gmplib.org/
1212

13-
The project [`Dockerfile`](./Dockerfile) contains up-to-date system configuration instructions, as used to ship into production. It is written for the Alpine Linux distribution but is meant to be adapted to other environments such as Ubuntu, macOS+Homebrew or others. The GitHub workflow file [`.github/workflows/ci.yml`](.github/workflows/ci.yml) also contains useful commands for Ubuntu and macOS. Since ocaml.org is mostly written in OCaml, a properly configured OCaml development environment is also required, but is not detailed here. Although Docker is used to ship, it is not a requirement to begin hacking. Currently, ocaml.org doesn't yet compile using OCaml 5, version 4.14 of the language is used. It is possible to run workflow files in `.github/workflows` using the [nektos/act](https://github.com/nektos/act) tool. For instance, run the following command to run the CI checks run by GitHub on each pull request (where `ghghgh` is replace by an _ad-hoc_ GitHub token, see: https://github.com/nektos/act#github_token)
13+
The project [`Dockerfile`](./Dockerfile) contains up-to-date system configuration instructions, as used to ship into production. It is written for the Alpine Linux distribution, but it is meant to be adapted to other environments such as Ubuntu, macOS+Homebrew, or others. The GitHub workflow file [`.github/workflows/ci.yml`](.github/workflows/ci.yml) also contains useful commands for Ubuntu and macOS. Since OCaml.org is mostly written in OCaml, a properly configured OCaml development environment is also required, but is not detailed here. Although Docker is used to ship, it is not a requirement to begin hacking. Currently, OCaml.org doesn't yet compile using OCaml 5; version 4.14 of the language is used. It is possible to run workflow files in `.github/workflows` using the [`nektos/act`](https://github.com/nektos/act) tool. For instance, the following command runs the CI checks through GitHub on each pull request (where `ghghgh` is replace by an _ad-hoc_ GitHub token, see: https://github.com/nektos/act#github_token)
1414
```
1515
act -s GITHUB_TOKEN=ghghgh .github/workflows/ci.yml -j build
1616
```
1717

1818

19-
The `Makefile` contains many commands that can get you up and running, a typical workflow will be to clone the repository after forking it.
19+
The Makefile contains many commands that can get you up and running. A typical workflow is to clone the repository after forking it.
2020

2121
```
22-
git clone https://github.com/<username>/ocaml.org.git
23-
cd ocaml.org
22+
git clone https://github.com/<username>/OCaml.org.git
23+
cd OCaml.org
2424
```
2525

26-
Ensure you have `opam` installed. Opam will manage the OCaml compiler along with all of the OCaml packages needed to build and run the project. By this point we should all be using some Unix-like system (Linux, macOS, WSL2) so you should [run the opam install script](https://opam.ocaml.org/doc/Install.html#Binary-distribution). There are also manual instructions for people that don't want to run a script from the internet. We assume you are using `opam.2.1.0` or later which provides a cleaner, friendlier experience when installing system dependencies.
26+
Ensure you have `opam` installed. Opam will manage the OCaml compiler along with all of the OCaml packages needed to build and run the project. By this point, we should all be using some Unix-like system (Linux, macOS, WSL2), so you should [run the opam install script](https://opam.OCaml.org/doc/Install.html#Binary-distribution). There are also manual instructions for people that don't want to run a script from the internet. We assume you are using `opam.2.1.0` or later, which provides a cleaner, friendlier experience when installing system dependencies.
2727

28-
With opam installed you can now initialise opam with `opam init`. Note in containers or WSL2 you will have to run `opam init --disable-sandboxing`. Opam might complain about some missing system dependencies like `unzip`, `cc` (a C compiler like `gcc`) etc. Make sure to install these before `opam init`.
28+
With opam installed, you can now initialise opam with `opam init`. Note that in containers or WSL2, you will have to run `opam init --disable-sandboxing`. Opam might complain about some missing system dependencies like `unzip`, `cc` (a C compiler like `gcc`), etc. Make sure to install these before `opam init`.
2929

30-
Finally from the root of your project you can setup a [local opam switch](https://opam.ocaml.org/doc/Manual.html#Switches) and install the dependencies. There is a single `make` target to do just that.
30+
Finally from the root of your project, you can setup a [local opam switch](https://opam.OCaml.org/doc/Manual.html#Switches) and install the dependencies. There is a single `make` target to do just that.
3131

3232
```
3333
make switch
3434
```
3535

36-
If you don't want a local opam switch and are happy to install everything globally (in the opam sense) then you can just install the dependencies directly.
36+
If you don't want a local opam switch and are happy to install everything globally (in the opam sense), then you can just install the dependencies directly.
3737

3838
```
3939
make deps
4040
```
4141

42-
Opam will likely ask questions about installing system dependencies, for the project to work you will have to answer yes to installing these.
42+
Opam will likely ask questions about installing system dependencies. Ror the project to work, you will have to answer yes to installing these.
4343

44-
### Running the server
44+
### Running the Server
4545

4646
After building the project, you can run the server with:
4747

@@ -57,7 +57,7 @@ make watch
5757

5858
This will restart the server on filesystem changes.
5959

60-
### Running tests
60+
### Running Tests
6161

6262
You can run the unit test suite with:
6363

@@ -67,46 +67,45 @@ make test
6767

6868
### Building the Playground
6969

70-
The OCaml Playground is compiled separately from the rest of the server and the generated assets can be found in
70+
The OCaml Playground is compiled separately from the rest of the server. The generated assets can be found in
7171
[`playground/asset/`](./playground/asset/).
7272

73-
You can build the playground from the root of the project, there is no need to move to the `./playground/` directory for the following commands.
73+
You can build the playground from the root of the project. There is no need to move to the `./playground/` directory for the following commands.
7474

7575
To regenerate the playground, you need to install the playground's dependencies first:
7676

7777
```
7878
make deps -C playground
7979
```
8080

81-
After the dependencies have been installed, simply build the project to re-generate the JavaScript assets:
81+
After the dependencies have been installed, simply build the project to regenerate the JavaScript assets:
8282

8383
```
8484
make playground
8585
```
8686

87-
Once the compilation is complete and successuful, the newly generated assets have to be git committed
88-
in ocaml.org and merged as a pull request.
87+
Once the compilation is complete and successuful, commit the newly-generated assets in OCaml.org's Git repo and merge the pull request.
8988

9089
### Deploying
9190

9291
Commits added on some branches are automatically deployed:
93-
- `main` on <https://ocaml.org/>.
94-
- `staging` on <https://staging.ocaml.org/>.
92+
- `main` on <https://OCaml.org/>
93+
- `staging` on <https://staging.OCaml.org/>
9594

96-
The deployment pipeline is managed in <https://github.com/ocurrent/ocurrent-deployer> which listens to the `main` and `staging` branches and builds the site using the `Dockerfile` at the root of the project. You can monitor the state of each deployment on [`deploy.ci.ocaml.org`](https://deploy.ci.ocaml.org/?repo=ocaml/ocaml.org)
95+
The deployment pipeline is managed in <https://github.com/ocurrent/ocurrent-deployer>, which listens to the `main` and `staging` branches and builds the site using the `Dockerfile` at the project's root. You can monitor the state of each deployment on [`deploy.ci.OCaml.org`](https://deploy.ci.OCaml.org/?repo=ocaml/OCaml.org).
9796

98-
To test the deployment locally, you can run the following commands:
97+
To test the deployment locally, run the following commands:
9998

10099
```
101100
docker build -t ocamlorg .
102101
docker run -p 8080:8080 ocamlorg
103102
```
104103

105-
This will build the docker image and run a docker container with the port `8080` mapped to the HTTP server.
104+
This will build the Docker image and run a Docker container with the port `8080` mapped to the HTTP server.
106105

107-
With the docker container running, you can visit the site at <http://localhost:8080/>.
106+
With the Docker container running, visit the site at <http://localhost:8080/>.
108107

109-
The docker images automatically build from the `live` and `staging` branches, and are then pushed to Docker Hub: https://hub.docker.com/r/ocurrent/v3.ocaml.org-server
108+
The Docker images automatically build from the `live` and `staging` branches. They are then pushed to Docker Hub: https://hub.docker.com/r/ocurrent/v3.OCaml.org-server.
110109

111110
### Staging Pull Requests
112111

@@ -118,16 +117,16 @@ to do so. For example, documentation PRs or new features where we need testing
118117
and feedback from the community will generally be live on `staging` for a while
119118
before they get merged.
120119

121-
### Managing dependencies
120+
### Managing Dependencies
122121

123-
ocaml.org is using an Opam switch which is local and bound to a pinned commit in opam-repository. This is intended to protect the build from upstream regressions. The Opam repository is specified in three (3) places:
122+
OCaml.org is using an opam switch that is local and bound to a pinned commit in `opam-repository`. This is intended to protect the build from upstream regressions. The opam repository is specified in three (3) places:
124123
```
125124
Dockerfile
126125
Makefile
127126
.github/workflows/*.yml
128127
```
129128

130-
When bringing up ocaml.org to a newer pin, the commit hash found it those files must be changed all at once.
129+
When bringing up OCaml.org to a newer pin, the commit hash found it those files must be changed all at once.
131130

132131
Once the opam repo pin is updated, the local switch must be updated using the following command:
133132
```sh
@@ -136,22 +135,22 @@ opam repo set-url pin git+https://github.com/ocaml/opam-repository#<commit-hash>
136135

137136
Where `<commit-hash>` is the pinned hash specified in the files mentioned above.
138137

139-
Once this is done, you can do `opam update` and `opam upgrade`. If ocamlformat
138+
Once this is done, you can run `opam update` and `opam upgrade`. If OCamlFormat
140139
was upgraded in the process, the files `.ocamlformat` and
141140
`.github/workflows/ci.yml` must be modified with the currently installed version
142-
of ocamlformat.
141+
of OCamlFormat.
143142

144-
## Repository structure
143+
## Repository Structure
145144

146-
The following snippet describes the repository structure.
145+
The following snippet describes the repository structure:
147146

148147
```text
149148
.
150149
├── asset/
151150
| The static assets served by the site.
152151
153152
├── data/
154-
| Data used by ocaml.org in Yaml and Markdown format.
153+
| Data used by OCaml.org in Yaml and Markdown format.
155154
156155
├── playground/
157156
│ The source and generated assets for the OCaml Playground

data/changelog/merlin/2024-05-22-merlin-5.0.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ tags: [merlin, platform]
44
changelog: |
55
+ merlin binary
66
- Support for OCaml 5.2 (#1757)
7-
- destruct: Removal of residual patterns (#1737, fixes #1560)
7+
- `destruct`: Removal of residual patterns (#1737, fixes #1560)
88
- Do not erase fields' names when destructing punned record fields (#1734,
99
fixes #1661)
1010
- Ignore SIGPIPE in the Merlin server process (#1746)
1111
- Fix lexing of quoted strings in comments (#1754, fixes #1753)
1212
- Improve cursor position detection in longidents (#1756)
13-
- Addition of a merlin-lib.commands library which disassociates the
14-
execution of commands from the new_protocol, from the binary, allowing
13+
- Addition of a `merlin-lib.commands` library that disassociates the
14+
execution of commands from the `new_protocol`, from the binary, allowing
1515
it to be invoked from other projects (#1758)
16-
- New occurrences backend: Don't index occurrences when merlin.hide
16+
- New occurrences backend: Don't index occurrences when `merlin.hide`
1717
attribute is present. (#1768)
18-
- Use the new uid_to_decl table in 5.2's cmt files to get documentation.
18+
- Use the new `uid_to_decl` table in 5.2's CMT files to get documentation.
1919
(#1773)
2020
2121
@@ -25,4 +25,4 @@ We are pleased to announce the release of Merlin 5.0-502!
2525

2626
This release brings official support for OCaml 5.2. Substantial backend changes were required to adapt to this release, especially for features such as occurrences and get-documentation. Do not hesitate to report any suspicious behavior in the [issue tracker](https://github.com/ocaml/merlin/issues)!
2727

28-
This release also fixes a handful of issues, two of them improving the behavior of Merlin's `destruct` feature.
28+
This release also fixes a handful of issues, two of them improving the behaviour of Merlin's `destruct` feature.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Merlin 4.16 for OCaml 4.14 and 5.1
3+
tags: [merlin, platform]
4+
changelog: |
5+
+ merlin binary
6+
- Addition of a `merlin-lib.commands` library which disassociates the
7+
execution of commands from the `new_protocol`, from the binary, allowing
8+
it to be invoked from other projects (ocaml/merlin#1758)
9+
- `merlin-lib.commands`: Add a `find_command_opt` alternative to
10+
`find_command` that does not raise (ocaml/merlin#1778)
11+
12+
---
13+
14+
We are pleased to announce the release of Merlin `4.16-414` and `4.16-501`.
15+
16+
These releases expose additional functions for packages using merlin-lib that
17+
need to manually parse merlin commands.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Merlin 5.1-502 for OCaml 5.2
3+
tags: [merlin, platform]
4+
changelog: |
5+
+ merlin binary
6+
- Support project-wide occurrences queries using index files (ocaml/merlin#1766)
7+
- The file format is described in library `Merlin_lib.index_format`
8+
- Two new configuration directives are introduced:
9+
- `SOURCE_ROOT` that is used to resolve relative paths found in the
10+
indexes.
11+
- `INDEX` that is used to declare the list of index files Merlin should
12+
use when looking for occurrences.
13+
- A new `UNIT_NAME` configuration directive that can be used to tell Merlin
14+
the correct name of the current unit in the presence of wrapping (ocaml/merlin#1776)
15+
- Perform incremental indexation of the buffer when typing. (ocaml/merlin#1777)
16+
- `merlin-lib.commands`: Add a `find_command_opt` alternative to
17+
`find_command` that does not raise (ocaml/merlin#1778)
18+
- Prevent uid clashes by not returning PWO for defs located in the current
19+
interface file (ocaml/merlin#1781)
20+
- Reset uid counters when restoring the typer cache so that uids are stable
21+
across re-typing (ocaml/merlin#1779)
22+
- Improve the behavior on occurrences when the cursor is on a label /
23+
constructor declaration (ocaml/merlin#1785)
24+
+ editor modes
25+
- emacs: add basic support for project-wide occurrences (ocaml/merlin#1766)
26+
- vim: add basic support for project-wide occurrences (ocaml/merlin#1767, @Julow)
27+
28+
---
29+
30+
We are pleased to announce the release of Merlin `5.1-502`. This is an important release that brings a lot of backend changes and a major
31+
new feature: project-wide occurrences queries.
32+
33+
Try it by running `dune build @ocaml-index` (since dune `3.16.0`) and performing a reference query!
34+
35+
More information can be found in the [discuss
36+
announcement](https://discuss.ocaml.org/t/ann-project-wide-occurrences-in-merlin-and-lsp/14847)
37+
and the
38+
[wiki](https://github.com/ocaml/merlin/wiki/Get-project%E2%80%90wide-occurrences).

data/changelog/odoc/2024-04-30-odoc-2.4.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ changelog: |
99
- Fix issues #1066 and #1095 with extended opens (@jonludlam, #1082, #1100)
1010
---
1111

12-
We've released Odoc 2.4.2 with compatibility with OCaml 5.2 and a few bug fixes.
12+
We've released `odoc` 2.4.2 with OCaml 5.2 compatibility and a few bug fixes.

0 commit comments

Comments
 (0)