Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9890983
chore: migrate to using dune package management
sabine May 26, 2025
052da15
make Dockerfile use Dune Developer Preview to build
sabine May 28, 2025
d012918
update Makefile to use Dune Developer Preview
sabine May 28, 2025
056143a
remove .opam files
sabine May 28, 2025
03ed5cb
update HACKING.md for dune pkg, CONTRIBUTING.md doesn't need updating
sabine Jun 6, 2025
e9add8b
attempt to make Playground build with Dune Developer Preview (fails)
sabine May 28, 2025
f2a124d
Build playground with dune pkg
Sudha247 Jun 11, 2025
1f81110
update CI to use Dune Developer Preview
sabine Jun 16, 2025
5310706
update scraper workflow to use dev preview
sabine Jun 16, 2025
3c1d0a7
copy playground cmi files
sabine Jun 16, 2025
f5efbab
update playground gitignore
sabine Jun 17, 2025
7a26498
remove opam.locked file
sabine Jun 17, 2025
f4b7c91
rely on dune.lock
sabine Jun 17, 2025
3074548
remove obsolete config
sabine Jun 17, 2025
636a588
build scraper in makefile
sabine Jun 17, 2025
18c5973
rely on dune.lock
sabine Jun 17, 2025
490181a
Pin dune pkg to a specific version in the Dockerfile
Sudha247 Jul 17, 2025
87cb879
update Dockerfile and HACKING.md
Sudha247 Jul 18, 2025
87c681c
revert accidental playground changes
sabine Jul 23, 2025
2cf37c1
Update to use Dune binary
Sudha247 Aug 1, 2025
0ba1af7
Address review comments
Sudha247 Aug 1, 2025
b180e20
add ocamlformat as a test dependency
Sudha247 Aug 1, 2025
dc83438
remove river pin
sabine Aug 19, 2025
47b01d1
reduce changes to playground dune-project
sabine Aug 19, 2025
2e17363
update README.md and HACKING.md
sabine Aug 28, 2025
b3fd1d9
update workflows to use Dune 3.19.1 binary
sabine Aug 28, 2025
ab45fb5
add a workflow to build every day using Dune Developer Preview
sabine Aug 28, 2025
3d372ed
remove unnecessary compiler version parameter from workflows
sabine Aug 28, 2025
c927ae8
Update Dockerfile @gridbugs
sabine Sep 9, 2025
b16de58
update workflows to use ocaml-dune/setup-dune@v1
sabine Sep 9, 2025
2d22624
update contributor docs to mention opam-repository pin upgrade process
sabine Sep 9, 2025
f6b377c
add a note for contributors for troubleshooting build issue after rebase
sabine Sep 9, 2025
776e0a2
be more precise
sabine Sep 9, 2025
d50b14b
Fix make clean, add make wipe
cuihtlauac Oct 2, 2025
9125e06
Update Dockerfile
sabine Oct 6, 2025
7c92a48
Update Dockerfile
sabine Oct 6, 2025
b5731d4
Update Dockerfile
sabine Oct 6, 2025
269508d
Apply suggestion from @MisterDA
sabine Oct 6, 2025
c99a3d1
Apply suggestion from @MisterDA
sabine Oct 6, 2025
34076cd
Update playground/dune to use `ocaml-config` instead of `ocamlopt`
sabine Oct 6, 2025
64ec3f9
Update Dockerfile
sabine Oct 6, 2025
a19a329
use 'latest' version of Dune
sabine Oct 13, 2025
5d7eae3
Update Dockerfile to use alpine:3.22
sabine Oct 13, 2025
433b700
update maintainer docs to reflect Dockerfile not pinning opam-repository
sabine Oct 13, 2025
a07f4ea
use dune 3.20.1 again because 'latest' is not downloadable via the sh…
sabine Oct 13, 2025
348ab34
add announcement post about this migration
sabine Oct 14, 2025
aca8154
use --network=host on docker build command in Makefile
sabine Oct 29, 2025
e907f4f
corrections to the included OCaml Backstage post
sabine Oct 29, 2025
de1e62f
rename
sabine Oct 29, 2025
b9eee75
update playground/dune-workspace to also rely on overlay repository
sabine Oct 29, 2025
bda6f03
Fix playground build by properly resolving jsoo_listunits path
sabine Oct 29, 2025
945a19c
Fix markdown linting error in Dune package management blog post
sabine Oct 29, 2025
d18e313
correct a comment in Dockerfile
sabine Oct 29, 2025
a2ff129
address @MisterDA review from 2 weeks ago
sabine Oct 29, 2025
31b7fdb
remaining Oct 3 review changes from @MisterDA review
sabine Oct 29, 2025
26d592c
had to add back -s 3.20.1 on the Dune installation in Dockerfile beca…
sabine Oct 29, 2025
89545d6
correct invocation of Dune install script to use the latest stable ve…
sabine Oct 29, 2025
3b2139b
use latest stable version of dune in all CI actions
sabine Oct 29, 2025
d2b11f8
upgrade to alpine:3.22 on the container to be deployed
sabine Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!tool/
!dune
!dune-project
!ocamlorg.opam
!dune-workspace
!tailwind.config.js
!init-cache
!.git
41 changes: 41 additions & 0 deletions .github/workflows/build_with_dev_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build OCaml.org Using Dune Developer Preview

on:
workflow_dispatch:
schedule:
# Run every day
- cron: 36 5 * * *

jobs:
build:
name: Build OCaml.org Using Dune Developer Preview

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest

steps:
- name: Install system dependencies (Linux)
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev
if: runner.os == 'Linux'

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

- name: Setup Dune Developer Preview
uses: ocaml-dune/setup-dune@v1

- name: Checkout Repo
uses: actions/checkout@v5

- name: Build project
run: make

- name: Run tests
run: make test
24 changes: 6 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,8 @@ jobs:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- "5.2.0"

steps:
- name: Checkout Repo
uses: actions/checkout@v5

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#584630e7a7e27e3cf56158696a3fe94623a0cf4f
opam-disable-sandboxing: true

- name: Install system dependencies (Linux)
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev
if: runner.os == 'Linux'
Expand All @@ -46,11 +32,13 @@ jobs:
run: brew update && brew reinstall libev openssl@3 # Openssl is a workaround for https://github.com/ocaml/opam-repository/issues/19676
if: runner.os == 'macOS'

- name: Install opam dependencies
run: opam install --deps-only --with-test .
- name: Setup Dune
uses: ocaml-dune/setup-dune@v1
with:
version: latest

- name: Install ocamlformat
run: opam install ocamlformat.0.26.2
- name: Checkout Repo
uses: actions/checkout@v5

- name: Build project
run: make
Expand Down
32 changes: 10 additions & 22 deletions .github/workflows/debug-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,8 @@ jobs:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- "5.2.0"

steps:
- name: Checkout Repo
uses: actions/checkout@v5

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#584630e7a7e27e3cf56158696a3fe94623a0cf4f
opam-disable-sandboxing: true

- name: Install system dependencies (Linux)
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev
if: runner.os == 'Linux'
Expand All @@ -39,18 +25,20 @@ jobs:
run: brew update && brew reinstall libev openssl@3 # Openssl is a workaround for https://github.com/ocaml/opam-repository/issues/19676
if: runner.os == 'macOS'

- name: Install opam dependencies
run: opam install --deps-only --with-test .
- name: Setup Dune
uses: ocaml-dune/setup-dune@v1
with:
version: latest

- name: Install ocamlformat
run: opam install ocamlformat.0.26.2
- name: Checkout Repo
uses: actions/checkout@v5

- name: Build project
run: opam exec -- dune build @install
run: make

- name: Run tests
run: opam exec -- dune test
run: make test

- name: Format code
run: opam exec -- dune build --auto-promote @fmt
if: runner.os == 'Linux'
run: make fmt
if: runner.os == 'Linux'
2 changes: 2 additions & 0 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v5
with:
fetch-depth: 0
Expand All @@ -17,6 +18,7 @@ jobs:
!data/planet/**/*.md
!data/changelog/**/*.md
separator: ","

- uses: DavidAnson/markdownlint-cli2-action@v20
if: steps.changed-files.outputs.any_changed == 'true'
with:
Expand Down
23 changes: 5 additions & 18 deletions .github/workflows/scrape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,18 @@ jobs:
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- "5.2.0"

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
- name: Setup Dune
uses: ocaml-dune/setup-dune@v1
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#584630e7a7e27e3cf56158696a3fe94623a0cf4f
opam-disable-sandboxing: true
version: latest

- name: Install system dependencies
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev

- name: Install opam dependencies
run: opam install --deps-only --with-test .

- name: Build scraper
run: |
opam exec -- dune build tool/ood-gen/bin/scrape.exe
- name: Checkout code
uses: actions/checkout@v5

- name: Run scrapers
run: |
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/scrape_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,20 @@ jobs:
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- "5.2.0"

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
- name: Setup Dune
uses: ocaml-dune/setup-dune@v1
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#584630e7a7e27e3cf56158696a3fe94623a0cf4f
opam-disable-sandboxing: true
version: latest

- name: Install system dependencies
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev

- name: Install opam dependencies
run: opam install --deps-only --with-test .

- name: Build scraper
run: |
opam exec -- dune build tool/ood-gen/bin/scrape.exe
- name: Checkout code
uses: actions/checkout@v5

- name: Run scrapers
- name: Run scraper
run: |
make scrape_platform_releases

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Dune artifacts
_build/
dune.lock
dev-tools.locks

# Local OPAM switch
_opam/
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

## Reporting Bugs

We use GitHub issues to track all bugs and feature requests. Feel free to open an issue over [here](https://github.com/ocaml/ocaml.org/issues/new) if you have found a bug or wish to see a feature implemented.

Check failure on line 13 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint

Link text should be descriptive

CONTRIBUTING.md:13:95 MD059/descriptive-link-text Link text should be descriptive [Context: "[here]"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md059.md

Please include images and browser-specific information if the bug is related to some visual aspect of the site. This tends to make it easier to reproduce and fix.

Expand All @@ -33,7 +33,7 @@
OCaml Platform maintainers can contribute to these sections:
- [The OCaml Changelog](#content-changelog)
- [Backstage OCaml](#content-backstage)
- [Platform Tools Releases](#content-platform-tools-releases)

Check failure on line 36 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint

Link fragments should be valid

CONTRIBUTING.md:36:3 MD051/link-fragments Link fragments should be valid [Context: "[Platform Tools Releases](#content-platform-tools-releases)"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md051.md

The following sections give more details on how to contribute.

Expand All @@ -47,7 +47,7 @@

Videos or other media should not be added to the OCaml.org GitHub repository.

### <a name="ocaml-planet"></a>Add Your RSS Feed or YouTube Channel to the OCaml Planet

Check failure on line 50 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint

Line length

CONTRIBUTING.md:50:81 MD013/line-length Line length [Expected: 80; Actual: 87] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md013.md

Anyone can contribute to the [OCaml Planet](https://ocaml.org/ocaml-planet), which is composed of three types of content:

Expand All @@ -73,7 +73,7 @@

Create a `.md` file with the following header:

```

Check failure on line 76 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint

Fenced code blocks should have a language specified

CONTRIBUTING.md:76 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md040.md
---
title: Title of Your Self-Hosted Post Here (title case)
description: one-sentence description
Expand Down Expand Up @@ -130,7 +130,7 @@

Location
- **`lat`**: The latitude of the institution’s location.
- **`long`**: The longitude of the institution’s location.

Check failure on line 133 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces

CONTRIBUTING.md:133:59 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md009.md

For instance: [cornell.md](data/academic_institutions/cornell.md).

Expand All @@ -151,7 +151,7 @@

Additional Information
- **`consortium`**: Indicates whether the organization is part of a consortium (`true` or `false`).
- **`featured`**: Indicates whether the organization is highlighted as a featured entity (`true` or `false`).

Check failure on line 154 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces

CONTRIBUTING.md:154:110 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md009.md

For instance: [cryptosense.md](data/industrial_users/cryptosense.md).

Expand Down Expand Up @@ -267,7 +267,7 @@

As a dual to the OCaml Changelog, Backstage OCaml is a channel TODO

#### Contributing a Post

Check failure on line 270 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint

Multiple headings with the same content

CONTRIBUTING.md:270 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Contributing a Post"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md024.md

To contribute a new post to Backstage OCaml:

Expand Down Expand Up @@ -308,3 +308,9 @@
- Consult the tasks noted in the PR template.
- When merging, consider cleaning up the commit body.
- Close any issues that were addressed by this PR.

## Troubleshooting

### After rebase on `main`, my branch doesn't build anymore

Please check in the commit log (`git log`) whether an upgrade of the dependencies (advancing of the `opam-repository` commit hash) has happened. If this is the case, running `dune pkg lock` should install the new dependencies.

Check failure on line 316 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint

Files should end with a single newline character

CONTRIBUTING.md:316:226 MD047/single-trailing-newline Files should end with a single newline character https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md047.md
47 changes: 22 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM ocaml/opam:alpine-3.21-ocaml-5.2 AS build
# syntax=docker/dockerfile:1
FROM alpine:3.22 AS build

# Install system dependencies
RUN sudo apk -U upgrade --no-cache && sudo apk add --no-cache \
RUN apk -U upgrade && apk add \
# to download and install Dune with alpine:3.22
build-base patch tar ca-certificates git \
libx11-dev coreutils xz curl bash \
autoconf \
curl-dev \
gmp-dev \
Expand All @@ -10,44 +14,37 @@ RUN sudo apk -U upgrade --no-cache && sudo apk add --no-cache \
oniguruma-dev \
openssl-dev

# Use Opam 2.2 and enable the backup mirror if primary sources of packages are unavailable
RUN sudo mv /usr/bin/opam-2.2 /usr/bin/opam && opam update
RUN opam option --global 'archive-mirrors+="https://opam.ocaml.org/cache"'

# Branch freeze was opam-repo HEAD at the time of commit
RUN cd ~/opam-repository && git reset --hard 584630e7a7e27e3cf56158696a3fe94623a0cf4f && opam update

WORKDIR /home/opam

# Install opam dependencies
COPY --chown=opam ocamlorg.opam .
RUN opam install . --deps-only
RUN curl -fsSL https://github.com/ocaml-dune/dune-bin-install/releases/download/v3/install.sh | sh -s -- --install-root /usr --no-update-shell-config
RUN dune --version

# Build project
COPY --chown=opam . .
RUN opam exec -- dune build @install --profile=release
COPY --chown=root --link . "/root/ocaml.org"
WORKDIR "/root/ocaml.org"
RUN ls

RUN dune pkg lock
RUN dune build @install --profile=release

# Launch project in order to generate the package state cache
RUN cd ~/opam-repository && git checkout master && git pull origin master && opam update
ENV OCAMLORG_PKG_STATE_PATH=package.state \
OCAMLORG_REPO_PATH=opam-repository
RUN touch package.state && ./init-cache package.state

FROM alpine:3.21
FROM alpine:3.22

RUN apk -U upgrade --no-cache && apk add --no-cache \
RUN apk -U upgrade && apk add \
git \
gmp \
libev

COPY --from=build /home/opam/package.state /var/package.state
COPY --from=build /home/opam/opam-repository /var/opam-repository
COPY --from=build /home/opam/_build/default/src/ocamlorg_web/bin/main.exe /bin/server
COPY --from=build --link "/root/ocaml.org/package.state" /var/package.state
COPY --from=build --link "/root/ocaml.org/opam-repository" /var/opam-repository
COPY --from=build --link "/root/ocaml.org/_build/default/src/ocamlorg_web/bin/main.exe" /bin/server

COPY playground/asset playground/asset
COPY --link playground/asset playground/asset

RUN git clone https://github.com/ocaml-web/html-compiler-manuals /manual
ADD data/v2 /v2
ADD --keep-git-dir --link https://github.com/ocaml-web/html-compiler-manuals /manual
ADD --link data/v2 /v2

RUN git config --global --add safe.directory /var/opam-repository

Expand Down
Loading
Loading