Skip to content

Commit

Permalink
Build on OCaml 5 (river pin) (#2609)
Browse files Browse the repository at this point in the history
* Build on OCaml 5

The build was failing due to problems with a configuration script in
ocamlnet, a transitive dependency of OCaml.org, through package river.
For details on the problem in ocamlnet, see

  aantron/ocamlnet@7ef255a

This commit pins ocamlnet to a fork with a workaround, until ocamlnet is
fixed upstream and released. See

  https://gitlab.com/gerdstolpmann/lib-ocamlnet3/-/merge_requests/24

* Try with CI on 5.2.0

* Fix Dockerfile

* Fix .devcontainer/Dockerfile

* Update dune files .opam is generated from

* Switch to upgraded River instead of ocamlnet

---------

Co-authored-by: Cuihtlauac ALVARADO <[email protected]>
  • Loading branch information
aantron and Cuihtlauac ALVARADO authored Aug 9, 2024
1 parent 96b3812 commit cbf0dd3
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ocaml/opam:debian-ocaml-4.14
FROM ocaml/opam:debian-ocaml-5.2

# Branch freeze was opam-repo HEAD at the time of commit
RUN cd ~/opam-repository && git checkout -b freeze c45f5bab71d3589f41f9603daca5acad14df0ab0 && opam update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- "4.14"
- "5.2"

steps:
- name: Checkout Repo
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ocaml/opam:alpine-3.20-ocaml-4.14 as build
FROM ocaml/opam:alpine-3.20-ocaml-5.2 as build

# Install system dependencies
RUN sudo apk update && sudo apk add --update libev-dev openssl-dev gmp-dev oniguruma-dev inotify-tools curl-dev autoconf
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ deps: create_switch ## Install development dependencies

.PHONY: create_switch
create_switch: ## Create switch and pinned opam repo
opam switch create . 4.14.2 --no-install --repos pin=git+https://github.com/ocaml/opam-repository#c45f5bab71d3589f41f9603daca5acad14df0ab0
opam switch create . 5.2.0 --no-install --repos pin=git+https://github.com/ocaml/opam-repository#c45f5bab71d3589f41f9603daca5acad14df0ab0

.PHONY: switch
switch: deps ## Create an opam switch and install development dependencies
Expand Down
4 changes: 1 addition & 3 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
"This repository contains the server that serves the official OCaml website at https://ocaml.org.")
(depends
(ocaml
(and
(>= 4.14.0)
(< 5.0.0)))
(>= 4.14.0))
dune
cohttp
cohttp-lwt-unix
Expand Down
7 changes: 6 additions & 1 deletion dune-workspace
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
(lang dune 3.15)

(pin
(name river)
(url "git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a")
(package (name river)))

(pin
(name tailwindcss)
(url "git+https://github.com/tmattio/opam-tailwindcss#3e60fc32bbcf82525999d83ad0f395e16107026b")
Expand All @@ -11,4 +16,4 @@
(package (name olinkcheck)))

(lock_dir
(pins tailwindcss olinkcheck))
(pins river tailwindcss olinkcheck))
3 changes: 2 additions & 1 deletion ocamlorg.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ homepage: "https://github.com/ocaml/ocaml.org"
doc: "https://ocaml.github.io/ocaml.org/"
bug-reports: "https://github.com/ocaml/ocaml.org/issues"
depends: [
"ocaml" {>= "4.14.0" & < "5.0.0"}
"ocaml" {>= "4.14.0"}
"dune" {>= "3.15"}
"cohttp"
"cohttp-lwt-unix"
Expand Down Expand Up @@ -70,6 +70,7 @@ build: [
]
dev-repo: "git+https://github.com/ocaml/ocaml.org.git"
pin-depends: [
["river.dev" "git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a"]
["tailwindcss.dev" "https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz"]
["olinkcheck.~dev" "git+https://github.com/tarides/olinkcheck"]
]
1 change: 1 addition & 0 deletions ocamlorg.opam.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pin-depends: [
["river.dev" "git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a"]
["tailwindcss.dev" "https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz"]
["olinkcheck.~dev" "git+https://github.com/tarides/olinkcheck"]
]

0 comments on commit cbf0dd3

Please sign in to comment.