Skip to content

Commit 5f2622e

Browse files
authored
Merge pull request #484 from codecrafters-io/andy/upgrade-ocaml
Update OCaml to 5.4
2 parents b3a7bbf + 1b78211 commit 5f2622e

File tree

12 files changed

+44
-14
lines changed

12 files changed

+44
-14
lines changed

compiled_starters/ocaml/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the OCaml version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: ocaml-5.3
11-
buildpack: ocaml-5.3
10+
# Available versions: ocaml-5.4
11+
buildpack: ocaml-5.4

compiled_starters/ocaml/codecrafters_redis.opam

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license: "MIT"
88
homepage: "https://codecrafters.io"
99
bug-reports: "https://github.com/codecrafters-io/build-your-own-redis/issues"
1010
depends: [
11-
"dune" {>= "3.16"}
11+
"dune" {>= "3.21"}
1212
"odoc" {with-doc}
1313
]
1414
build: [
@@ -25,3 +25,4 @@ build: [
2525
"@doc" {with-doc}
2626
]
2727
]
28+
x-maintenance-intent: ["(latest)"]

compiled_starters/ocaml/dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(lang dune 3.16)
1+
(lang dune 3.21)
22

33
(name codecrafters_redis)
44

dockerfiles/ocaml-5.4.Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
FROM ocaml/opam:debian-13-ocaml-5.4
3+
4+
# The image uses opam as the user, so let's set OPAMROOT to re-use whatever is already built
5+
ENV OPAMROOT /home/opam/.opam
6+
7+
# Ensures the container is re-built if dune/dune-project changes
8+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="dune,dune-project,codecrafters_redis.opam"
9+
10+
# Change to root user. All other images seem to use root, so let's do the same here
11+
# hadolint ignore=DL3002
12+
USER root
13+
14+
# Install dune
15+
RUN opam install dune.3.21.0 --yes
16+
17+
# Dune path is /home/opam/.opam/5.4/bin/dune
18+
ENV PATH="${OPAMROOT}/5.4/bin:${PATH}"
19+
20+
WORKDIR /app
21+
22+
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
23+
COPY --exclude=.git --exclude=README.md . /app
24+
25+
# Cache dependencies
26+
RUN opam install . --yes

solutions/ocaml/01-jm1/code/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the OCaml version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: ocaml-5.3
11-
buildpack: ocaml-5.3
10+
# Available versions: ocaml-5.4
11+
buildpack: ocaml-5.4

solutions/ocaml/01-jm1/code/codecrafters_redis.opam

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license: "MIT"
88
homepage: "https://codecrafters.io"
99
bug-reports: "https://github.com/codecrafters-io/build-your-own-redis/issues"
1010
depends: [
11-
"dune" {>= "3.16"}
11+
"dune" {>= "3.21"}
1212
"odoc" {with-doc}
1313
]
1414
build: [
@@ -25,3 +25,4 @@ build: [
2525
"@doc" {with-doc}
2626
]
2727
]
28+
x-maintenance-intent: ["(latest)"]

solutions/ocaml/01-jm1/code/dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(lang dune 3.16)
1+
(lang dune 3.21)
22

33
(name codecrafters_redis)
44

solutions/ocaml/02-rg2/code/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the OCaml version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: ocaml-5.3
11-
buildpack: ocaml-5.3
10+
# Available versions: ocaml-5.4
11+
buildpack: ocaml-5.4

solutions/ocaml/02-rg2/code/codecrafters_redis.opam

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license: "MIT"
88
homepage: "https://codecrafters.io"
99
bug-reports: "https://github.com/codecrafters-io/build-your-own-redis/issues"
1010
depends: [
11-
"dune" {>= "3.16"}
11+
"dune" {>= "3.21"}
1212
"odoc" {with-doc}
1313
]
1414
build: [
@@ -25,3 +25,4 @@ build: [
2525
"@doc" {with-doc}
2626
]
2727
]
28+
x-maintenance-intent: ["(latest)"]

solutions/ocaml/02-rg2/code/dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(lang dune 3.16)
1+
(lang dune 3.21)
22

33
(name codecrafters_redis)
44

0 commit comments

Comments
 (0)