From 19e6e946ef5113db3aa86300e1d8474cce93a87c Mon Sep 17 00:00:00 2001 From: Bruno Bernardo Date: Fri, 18 Jul 2025 16:23:17 +0200 Subject: [PATCH 1/2] CI: disable [cargo] and [sccache] caches in [ocaml-check] OCaml type checking with dune should not create rust compiling files. Proof: no Rust file in _build/ ``` % rm -rf _build/ % dune build @check --stop-on-first-error % ls _build/default/**/*.ml | wc -l 6597 % ls _build/default/**/*.mli | wc -l 4541 % ls _build/default/**/*.rs zsh: no matches found: _build/default/**/*.rs ``` --- .gitlab/ci/pipelines/before_merging.yml | 15 +-------------- .gitlab/ci/pipelines/merge_train.yml | 15 +-------------- .gitlab/ci/pipelines/schedule_extended_test.yml | 15 +-------------- ci/bin/code_verification.ml | 2 +- 4 files changed, 4 insertions(+), 43 deletions(-) diff --git a/.gitlab/ci/pipelines/before_merging.yml b/.gitlab/ci/pipelines/before_merging.yml index a01cd0cd231f..c376f43504db 100644 --- a/.gitlab/ci/pipelines/before_merging.yml +++ b/.gitlab/ci/pipelines/before_merging.yml @@ -2507,15 +2507,7 @@ ocaml-check: - oc.docker:ci:amd64 timeout: 60 minutes cache: - - key: cargo-$CI_JOB_NAME_SLUG - paths: - - $CI_PROJECT_DIR/.cargo/registry/cache - policy: pull-push - - key: sccache-$CI_JOB_NAME_SLUG - paths: - - $CI_PROJECT_DIR/_sccache - policy: pull-push - - key: dune_cache-$CI_JOB_NAME_SLUG + key: dune_cache-$CI_JOB_NAME_SLUG paths: - $CI_PROJECT_DIR/_dune_cache policy: pull-push @@ -2524,17 +2516,12 @@ ocaml-check: - ./scripts/ci/take_ownership.sh - . ./scripts/version.sh - eval $(opam env) - - . ./scripts/ci/sccache-start.sh script: - dune build @check --stop-on-first-error after_script: - - ./scripts/ci/sccache-stop.sh - eval $(opam env) - dune cache trim --size=5GB variables: - CARGO_NET_OFFLINE: "false" - SCCACHE_DIR: $CI_PROJECT_DIR/_sccache - SCCACHE_CACHE_SIZE: 5G DUNE_CACHE: enabled DUNE_CACHE_STORAGE_MODE: hardlink DUNE_CACHE_ROOT: $CI_PROJECT_DIR/_dune_cache diff --git a/.gitlab/ci/pipelines/merge_train.yml b/.gitlab/ci/pipelines/merge_train.yml index f0939aecabf2..3364e5b0634b 100644 --- a/.gitlab/ci/pipelines/merge_train.yml +++ b/.gitlab/ci/pipelines/merge_train.yml @@ -2506,15 +2506,7 @@ ocaml-check: - oc.docker:ci:amd64 timeout: 60 minutes cache: - - key: cargo-$CI_JOB_NAME_SLUG - paths: - - $CI_PROJECT_DIR/.cargo/registry/cache - policy: pull-push - - key: sccache-$CI_JOB_NAME_SLUG - paths: - - $CI_PROJECT_DIR/_sccache - policy: pull-push - - key: dune_cache-$CI_JOB_NAME_SLUG + key: dune_cache-$CI_JOB_NAME_SLUG paths: - $CI_PROJECT_DIR/_dune_cache policy: pull-push @@ -2523,17 +2515,12 @@ ocaml-check: - ./scripts/ci/take_ownership.sh - . ./scripts/version.sh - eval $(opam env) - - . ./scripts/ci/sccache-start.sh script: - dune build @check --stop-on-first-error after_script: - - ./scripts/ci/sccache-stop.sh - eval $(opam env) - dune cache trim --size=5GB variables: - CARGO_NET_OFFLINE: "false" - SCCACHE_DIR: $CI_PROJECT_DIR/_sccache - SCCACHE_CACHE_SIZE: 5G DUNE_CACHE: enabled DUNE_CACHE_STORAGE_MODE: hardlink DUNE_CACHE_ROOT: $CI_PROJECT_DIR/_dune_cache diff --git a/.gitlab/ci/pipelines/schedule_extended_test.yml b/.gitlab/ci/pipelines/schedule_extended_test.yml index 3363be2668b2..de3c61353e91 100644 --- a/.gitlab/ci/pipelines/schedule_extended_test.yml +++ b/.gitlab/ci/pipelines/schedule_extended_test.yml @@ -2496,15 +2496,7 @@ ocaml-check: - oc.docker:ci:amd64 timeout: 60 minutes cache: - - key: cargo-$CI_JOB_NAME_SLUG - paths: - - $CI_PROJECT_DIR/.cargo/registry/cache - policy: pull-push - - key: sccache-$CI_JOB_NAME_SLUG - paths: - - $CI_PROJECT_DIR/_sccache - policy: pull-push - - key: dune_cache-$CI_JOB_NAME_SLUG + key: dune_cache-$CI_JOB_NAME_SLUG paths: - $CI_PROJECT_DIR/_dune_cache policy: pull-push @@ -2514,17 +2506,12 @@ ocaml-check: - ./scripts/ci/take_ownership.sh - . ./scripts/version.sh - eval $(opam env) - - . ./scripts/ci/sccache-start.sh script: - dune build @check --stop-on-first-error after_script: - - ./scripts/ci/sccache-stop.sh - eval $(opam env) - dune cache trim --size=5GB variables: - CARGO_NET_OFFLINE: "false" - SCCACHE_DIR: $CI_PROJECT_DIR/_sccache - SCCACHE_CACHE_SIZE: 5G DUNE_CACHE: enabled DUNE_CACHE_STORAGE_MODE: hardlink DUNE_CACHE_ROOT: $CI_PROJECT_DIR/_dune_cache diff --git a/ci/bin/code_verification.ml b/ci/bin/code_verification.ml index f504082fbac3..c62cd92a4ac8 100644 --- a/ci/bin/code_verification.ml +++ b/ci/bin/code_verification.ml @@ -933,7 +933,7 @@ let jobs pipeline_type = the log and to reduce time to merge of other MRs further down the merge train. *) ["dune build @check --stop-on-first-error"] - |> enable_cargo_cache |> enable_sccache |> enable_dune_cache + |> enable_dune_cache in (* This job triggers the debian child pipeline automatically if any files in the changeset is modified. It's the same as -- GitLab From 58bb559ad14a76c9d230129be85b6bb38d7dea62 Mon Sep 17 00:00:00 2001 From: Bruno Bernardo Date: Fri, 18 Jul 2025 16:26:02 +0200 Subject: [PATCH 2/2] CI: set to 3GB dune cache max size in [ocaml-check] --- .gitlab/ci/pipelines/before_merging.yml | 2 +- .gitlab/ci/pipelines/merge_train.yml | 2 +- .gitlab/ci/pipelines/schedule_extended_test.yml | 2 +- ci/bin/code_verification.ml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab/ci/pipelines/before_merging.yml b/.gitlab/ci/pipelines/before_merging.yml index c376f43504db..010e7f6a282d 100644 --- a/.gitlab/ci/pipelines/before_merging.yml +++ b/.gitlab/ci/pipelines/before_merging.yml @@ -2520,7 +2520,7 @@ ocaml-check: - dune build @check --stop-on-first-error after_script: - eval $(opam env) - - dune cache trim --size=5GB + - dune cache trim --size=3GB variables: DUNE_CACHE: enabled DUNE_CACHE_STORAGE_MODE: hardlink diff --git a/.gitlab/ci/pipelines/merge_train.yml b/.gitlab/ci/pipelines/merge_train.yml index 3364e5b0634b..3fcf9f2dd747 100644 --- a/.gitlab/ci/pipelines/merge_train.yml +++ b/.gitlab/ci/pipelines/merge_train.yml @@ -2519,7 +2519,7 @@ ocaml-check: - dune build @check --stop-on-first-error after_script: - eval $(opam env) - - dune cache trim --size=5GB + - dune cache trim --size=3GB variables: DUNE_CACHE: enabled DUNE_CACHE_STORAGE_MODE: hardlink diff --git a/.gitlab/ci/pipelines/schedule_extended_test.yml b/.gitlab/ci/pipelines/schedule_extended_test.yml index de3c61353e91..7e3736839726 100644 --- a/.gitlab/ci/pipelines/schedule_extended_test.yml +++ b/.gitlab/ci/pipelines/schedule_extended_test.yml @@ -2510,7 +2510,7 @@ ocaml-check: - dune build @check --stop-on-first-error after_script: - eval $(opam env) - - dune cache trim --size=5GB + - dune cache trim --size=3GB variables: DUNE_CACHE: enabled DUNE_CACHE_STORAGE_MODE: hardlink diff --git a/ci/bin/code_verification.ml b/ci/bin/code_verification.ml index c62cd92a4ac8..9503fd2a43e4 100644 --- a/ci/bin/code_verification.ml +++ b/ci/bin/code_verification.ml @@ -933,7 +933,7 @@ let jobs pipeline_type = the log and to reduce time to merge of other MRs further down the merge train. *) ["dune build @check --stop-on-first-error"] - |> enable_dune_cache + |> enable_dune_cache ~cache_size:"3GB" in (* This job triggers the debian child pipeline automatically if any files in the changeset is modified. It's the same as -- GitLab