From f35825a9c1bf81c0d88c7b7db5f959109ab3a13e Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Tue, 1 Aug 2023 16:51:39 +0200 Subject: [PATCH 1/2] Update CI build --- Dockerfile | 15 +-------------- catala.opam | 6 +++--- clerk.opam | 4 ++++ 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee4179c8..a9824174 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # STAGE 1: setup an opam switch with all dependencies installed # # (only depends on the opam files) -FROM ocamlpro/ocaml:4.14-2023-06-18 AS dev-build-context +FROM ocamlpro/ocaml:4.14-2023-08-01 AS dev-build-context # Image from https://hub.docker.com/r/ocamlpro/ocaml RUN mkdir catala @@ -25,19 +25,6 @@ RUN opam --cli=2.1 switch create catala ocaml-system && \ # Note: just `opam switch create . --deps-only --with-test --with-doc && opam clean` # should be enough once opam 2.2 is released (see opam#5185) -# Install extra dependencies not handled yet by the opam depexts -# -# python3, ninja (samurai in this case), etc. already got installed through opam's -# depext mechanism at this point -- see clerk.opam and catala.opam -# -# pandoc is not in alpine stable yet though, so install it manually with an explicit repository -RUN sudo apk add pandoc --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/ - -# Workaround broken rescript build that recompiles its own version of -# ninja with a badly written script :[] -RUN sudo apk add pythonispython3 - - # # STAGE 2: get the whole repo, run checks and builds # diff --git a/catala.opam b/catala.opam index b19bdc14..188e1047 100644 --- a/catala.opam +++ b/catala.opam @@ -71,10 +71,10 @@ build: [ ] dev-repo: "git+https://github.com/CatalaLang/catala.git" depexts: [ - ["groff" "colordiff" "latexmk" "python3-pip" "pandoc"] + ["groff" "latexmk" "python3-pip" "pandoc"] {cataladevmode & os-family = "debian"} - ["groff" "colordiff" "texlive" "texmf-dist-fontsextra" "texmf-dist-latexextra" "py3-pip" "py3-pygments"] + ["groff" "texlive-xetex" "texmf-dist-latexextra" "texmf-dist-pictures" "py3-pip" "py3-pygments" "pandoc-cli"] {cataladevmode & os-distribution = "alpine"} - ["groff" "colordiff" "latex-mk" "python-pygments" "pandoc"] + ["groff" "latex-mk" "python-pygments" "pandoc"] {cataladevmode & os-family = "arch"} ] diff --git a/clerk.opam b/clerk.opam index b70e2497..9114a831 100644 --- a/clerk.opam +++ b/clerk.opam @@ -38,4 +38,8 @@ dev-repo: "git+https://github.com/CatalaLang/catala.git" depexts: [ ["ninja-build"] {os-family = "debian"} ["samurai"] {os-distribution = "alpine"} + ["colordiff"] {cataladevmode & + (os-distribution = "alpine" | + os-family = "arch" | + os-family = "debian")} ] From ab365b25b33f675a6e9f99c9f59e9e2a2d10bc06 Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Wed, 2 Aug 2023 12:19:38 +0200 Subject: [PATCH 2/2] Clerk: replace colordiff with `diff --color` This should be available mostly everywhere now (first appeared in e.g. Ubuntu 18) and avoids the need for an additional run-time dependency. --- build_system/clerk_driver.ml | 2 +- clerk.opam | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/build_system/clerk_driver.ml b/build_system/clerk_driver.ml index 90a1432f..f8469d47 100644 --- a/build_system/clerk_driver.ml +++ b/build_system/clerk_driver.ml @@ -338,7 +338,7 @@ let pipe_diff_cmd = Var.tested_file; Lit "/dev/stdin"; ] - else Seq [Lit "| colordiff -u -b"; Var.tested_file; Lit "-"] + else Seq [Lit "| diff -u -b --color"; Var.tested_file; Lit "-"] let inline_test_rule catala_exe catala_opts = let open Nj.Expr in diff --git a/clerk.opam b/clerk.opam index 9114a831..58babf36 100644 --- a/clerk.opam +++ b/clerk.opam @@ -19,6 +19,7 @@ depends: [ "catala" {= version} "ninja_utils" {= version} "odoc" {with-doc} + "conf-diffutils" {cataladevmode} ] build: [ ["dune" "subst"] {dev} @@ -38,8 +39,4 @@ dev-repo: "git+https://github.com/CatalaLang/catala.git" depexts: [ ["ninja-build"] {os-family = "debian"} ["samurai"] {os-distribution = "alpine"} - ["colordiff"] {cataladevmode & - (os-distribution = "alpine" | - os-family = "arch" | - os-family = "debian")} ]