From c014fd55b597c7bf965be6f5c1de04e80cb9c764 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Fri, 5 Jul 2024 15:00:50 +0200 Subject: [PATCH 01/10] gha: depexts, use bash in shebang, as it is launched with bash anyway --- .github/scripts/depexts/generate-actions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index c17fa2d735d..f5819cec77b 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -eu From b6d10339d0c6645a17d45a1c2c91e3d3df02b149 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Fri, 5 Jul 2024 15:01:42 +0200 Subject: [PATCH 02/10] gha: depexts, replace centos docker run with almalinux, faked to be recognised as centos --- .github/scripts/depexts/generate-actions.sh | 7 +++++-- master_changes.md | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index f5819cec77b..1a4ca60caec 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -42,9 +42,12 @@ EOF # CentOS 7 doesn't support OCaml 5 (GCC is too old) OCAML_CONSTRAINT=' & < "5.0"' cat >$dir/Dockerfile << EOF -FROM centos:7 +FROM almalinux:9.4 +RUN dnf install 'dnf-command(config-manager)' -y +RUN dnf config-manager --set-enabled crb RUN yum install -y $mainlibs $ocaml -RUN yum install -y gcc-c++ +RUN yum install -y gcc-c++ diffutils +RUN sed -i 's/ID="almalinux"/ID="centos"/' /etc/os-release EOF ;; debian) diff --git a/master_changes.md b/master_changes.md index ccd176df09f..6f9a2cb9f94 100644 --- a/master_changes.md +++ b/master_changes.md @@ -122,6 +122,7 @@ users) ### Engine ## Github Actions + * Depexts: replace centos docker with almalinux to fake a centos [#6079 @rjbou] ## Doc * Remove the ppa from the installation instructions on Ubuntu [#5988 @kit-ty-kate - fix #5987] From a5507d2faf56df37290a818acd4ebb36421aaf49 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Fri, 5 Jul 2024 15:03:50 +0200 Subject: [PATCH 03/10] gha: depexts, fix conf-* package install check and specify by distribution --- .github/scripts/depexts/generate-actions.sh | 52 +++++++++++++++++---- master_changes.md | 2 + 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index 1a4ca60caec..aca4dc9a081 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -155,22 +155,58 @@ make ./opam switch create confs --empty EOF +# Test depexts + +DEPEXTS2TEST="" test_depext () { - for pkg in $@ ; do - echo "./opam install $pkg || true" >> $dir/entrypoint.sh - done + DEPEXTS2TEST="$DEPEXTS2TEST $@" } -test_depext conf-gmp conf-which conf-autoconf +test_depext conf-gmp conf-which + +if [ $target != "gentoo" ]; then + test_depext conf-autoconf +fi # disable automake for centos, as os-family returns rhel -if [ $target != "centos" ] && [ $target != "opensuse" ]; then +if [ $target != "centos" ] && [ $target != "gentoo" ] && [ $target != "opensuse" ]; then test_depext conf-automake fi -# additionnal -test_depext dpkg # gentoo -test_depext lib-sundials-dev # os version check +# additionna +if [ $target != "oraclelinux" ] && [ $target != "xxx" ]; then + test_depext conf-dpkg # gentoo +fi + +if [ $target = "debian" ] || [ $target = "ubuntu" ]; then + # os version check on debian & ubuntu + test_depext conf-sundials +fi + + +if [ -z "$DEPEXTS2TEST" ]; then + echo "ERROR: You should at least define one depext to test" + exit 3 +fi + +cat >>$dir/entrypoint.sh << EOF +ERRORS="" +test_depexts () { + for pkg in \$@ ; do + ./opam install \$pkg || ERRORS="\$ERRORS \$pkg" + done +} + +test_depexts $DEPEXTS2TEST + +if [ -z "\$ERRORS" ]; then + exit 0 +else + echo "ERROR on packages\$ERRORS" + exit 1 +fi +EOF + chmod +x $dir/entrypoint.sh diff --git a/master_changes.md b/master_changes.md index 6f9a2cb9f94..e5b71084986 100644 --- a/master_changes.md +++ b/master_changes.md @@ -123,6 +123,8 @@ users) ## Github Actions * Depexts: replace centos docker with almalinux to fake a centos [#6079 @rjbou] + * Depexts: fix conf package install check [#6079 @rjbou] + * Depexts: specify packages to test per distribution [#6079 @rjbou] ## Doc * Remove the ppa from the installation instructions on Ubuntu [#5988 @kit-ty-kate - fix #5987] From f29cf3dc5653808c1373d7358a19bcf1afecae3e Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Fri, 5 Jul 2024 15:04:46 +0200 Subject: [PATCH 04/10] gha: depexts, update docker syntax ENV FOO foo to ENV FOO=foo --- .github/scripts/depexts/generate-actions.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index aca4dc9a081..d2d173239bc 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -111,11 +111,11 @@ cp binary/opam $dir/opam cat >>$dir/Dockerfile << EOF RUN test -d /opam || mkdir /opam -ENV OPAMROOTISOK 1 -ENV OPAMROOT /opam/root -ENV OPAMYES 1 -ENV OPAMCONFIRMLEVEL unsafe-yes -ENV OPAMPRECISETRACKING 1 +ENV OPAMROOTISOK=1 +ENV OPAMROOT=/opam/root +ENV OPAMYES=1 +ENV OPAMCONFIRMLEVEL=unsafe-yes +ENV OPAMPRECISETRACKING=1 COPY opam /usr/bin/opam COPY entrypoint.sh /opam/entrypoint.sh ENTRYPOINT ["/opam/entrypoint.sh"] From 6875a985cd773a84d5369ea047706e5ce99aaa25 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Fri, 5 Jul 2024 15:09:00 +0200 Subject: [PATCH 05/10] gha: depexts, add some local testing parts --- .github/scripts/depexts/generate-actions.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index d2d173239bc..70efcfe104a 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -136,6 +136,11 @@ opam switch create this-opam --formula='$OCAML_INVARIANT' # Workdir is /github/workpaces cd /github/workspace + +### LOCAL TESTING +#git clone https://github.com/ocaml/opam --single-branch --branch 2.2 --depth 1 local-opam +#cd local-opam + EOF # workaround for opensuse, mccs & glpk From 5f8df7396807eea84757d4468aa09d15a21cf098 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Fri, 5 Jul 2024 15:09:33 +0200 Subject: [PATCH 06/10] gha: depexts, add update system package manager step --- .github/scripts/depexts/generate-actions.sh | 4 ++++ master_changes.md | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index 70efcfe104a..edf6410db3b 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -212,6 +212,10 @@ else fi EOF +# Test depexts update +cat >>$dir/entrypoint.sh << EOF +./opam update --depexts || ERRORS="\$ERRORS opam-update-depexts" +EOF chmod +x $dir/entrypoint.sh diff --git a/master_changes.md b/master_changes.md index e5b71084986..12a8f35ce9b 100644 --- a/master_changes.md +++ b/master_changes.md @@ -125,6 +125,7 @@ users) * Depexts: replace centos docker with almalinux to fake a centos [#6079 @rjbou] * Depexts: fix conf package install check [#6079 @rjbou] * Depexts: specify packages to test per distribution [#6079 @rjbou] + * Depexts: add update depexts check [#6079 @rjbou] ## Doc * Remove the ppa from the installation instructions on Ubuntu [#5988 @kit-ty-kate - fix #5987] From 002194923114a1dbee1a11cff00da03b2e4e64c5 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Fri, 5 Jul 2024 15:10:41 +0200 Subject: [PATCH 07/10] gha: depexts, move in docker image build compiler and part of opam deps, to have them cached and not computed each time --- .github/scripts/depexts/generate-actions.sh | 11 ++++++----- master_changes.md | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index edf6410db3b..6d95bc7d390 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -117,6 +117,12 @@ ENV OPAMYES=1 ENV OPAMCONFIRMLEVEL=unsafe-yes ENV OPAMPRECISETRACKING=1 COPY opam /usr/bin/opam +RUN echo 'default-invariant: [ $OCAML_INVARIANT ]' > /opam/opamrc +RUN /usr/bin/opam init --no-setup --disable-sandboxing --bare --config /opam/opamrc git+$OPAM_REPO#$OPAM_REPO_SHA +RUN echo 'archive-mirrors: "https://opam.ocaml.org/cache"' >> \$OPAMROOT/config +RUN /usr/bin/opam switch create this-opam --formula='$OCAML_INVARIANT' +RUN /usr/bin/opam install opam-core opam-state opam-solver opam-repository opam-format opam-client --deps +RUN /usr/bin/opam clean -as --logs COPY entrypoint.sh /opam/entrypoint.sh ENTRYPOINT ["/opam/entrypoint.sh"] EOF @@ -128,11 +134,6 @@ cat >$dir/entrypoint.sh << EOF set -eux git config --global --add safe.directory /github/workspace -# For systems that don't have an up to date compiler, to avoid ocaml-secondary -echo 'default-invariant: [ $OCAML_INVARIANT ]' > /opam/opamrc -opam init --no-setup --disable-sandboxing --bare --config /opam/opamrc git+$OPAM_REPO#$OPAM_REPO_SHA -echo 'archive-mirrors: "https://opam.ocaml.org/cache"' >> \$OPAMROOT/config -opam switch create this-opam --formula='$OCAML_INVARIANT' # Workdir is /github/workpaces cd /github/workspace diff --git a/master_changes.md b/master_changes.md index 12a8f35ce9b..341039f3ef2 100644 --- a/master_changes.md +++ b/master_changes.md @@ -126,6 +126,7 @@ users) * Depexts: fix conf package install check [#6079 @rjbou] * Depexts: specify packages to test per distribution [#6079 @rjbou] * Depexts: add update depexts check [#6079 @rjbou] + * Depexts: move parts to docker build image, for caching [#6079 @rjbou] ## Doc * Remove the ppa from the installation instructions on Ubuntu [#5988 @kit-ty-kate - fix #5987] From 395d6d1e9a3fe92a091244f9dfc402c80876dc03 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Fri, 5 Jul 2024 16:10:14 +0200 Subject: [PATCH 08/10] gha: depexts, set version for conf-* packages --- .github/scripts/depexts/generate-actions.sh | 10 +++++----- master_changes.md | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index 6d95bc7d390..2724f324fd3 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -168,25 +168,25 @@ test_depext () { DEPEXTS2TEST="$DEPEXTS2TEST $@" } -test_depext conf-gmp conf-which +test_depext conf-gmp.4 conf-which.1 if [ $target != "gentoo" ]; then - test_depext conf-autoconf + test_depext conf-autoconf.0.1 fi # disable automake for centos, as os-family returns rhel if [ $target != "centos" ] && [ $target != "gentoo" ] && [ $target != "opensuse" ]; then - test_depext conf-automake + test_depext conf-automake.1 fi # additionna if [ $target != "oraclelinux" ] && [ $target != "xxx" ]; then - test_depext conf-dpkg # gentoo + test_depext conf-dpkg.1 # gentoo fi if [ $target = "debian" ] || [ $target = "ubuntu" ]; then # os version check on debian & ubuntu - test_depext conf-sundials + test_depext conf-sundials.2 fi diff --git a/master_changes.md b/master_changes.md index 341039f3ef2..5546abdbc2e 100644 --- a/master_changes.md +++ b/master_changes.md @@ -127,6 +127,7 @@ users) * Depexts: specify packages to test per distribution [#6079 @rjbou] * Depexts: add update depexts check [#6079 @rjbou] * Depexts: move parts to docker build image, for caching [#6079 @rjbou] + * Depexts: set version for conf packages to check [#6079 @rjbou] ## Doc * Remove the ppa from the installation instructions on Ubuntu [#5988 @kit-ty-kate - fix #5987] From fc3b139d5ca6433dca3e374ee214de8f2c80e459 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Mon, 8 Jul 2024 11:55:29 +0200 Subject: [PATCH 09/10] gha: depexts, add package that contains os-version filter --- .github/scripts/depexts/generate-actions.sh | 19 ++++++++++++++++++- master_changes.md | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index 2724f324fd3..d6e79c172ab 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -184,11 +184,28 @@ if [ $target != "oraclelinux" ] && [ $target != "xxx" ]; then test_depext conf-dpkg.1 # gentoo fi +# package with os-version check + if [ $target = "debian" ] || [ $target = "ubuntu" ]; then - # os version check on debian & ubuntu test_depext conf-sundials.2 + # conf-libgccjit.1 conf-rdkit.1 +fi + +if [ $target = "alpine" ]; then + test_depext conf-clang-format.1 + # conf-pandoc.0.1 +fi + +if [ $target = "fedora" ]; then + test_depext conf-emacs.1 +fi + +if [ $target = "oraclelinux" ] || [ $target = "centos" ]; then + test_depext conf-pkg-config.3 fi +# oraclelinux: conf-libev.4-12 conf-npm.1 +# centos: conf-perl.2 if [ -z "$DEPEXTS2TEST" ]; then echo "ERROR: You should at least define one depext to test" diff --git a/master_changes.md b/master_changes.md index 5546abdbc2e..3f422ff7122 100644 --- a/master_changes.md +++ b/master_changes.md @@ -128,6 +128,7 @@ users) * Depexts: add update depexts check [#6079 @rjbou] * Depexts: move parts to docker build image, for caching [#6079 @rjbou] * Depexts: set version for conf packages to check [#6079 @rjbou] + * Depexts: add package to test containing `os-version` in filter [#6079 @rjbou] ## Doc * Remove the ppa from the installation instructions on Ubuntu [#5988 @kit-ty-kate - fix #5987] From f3bc570df7a2141cd8e554647b81cd1385ff1053 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Tue, 9 Jul 2024 16:01:17 +0200 Subject: [PATCH 10/10] gha: depexts, remove opensuse workaround for glpk/mccs --- .github/scripts/depexts/generate-actions.sh | 11 ----------- master_changes.md | 1 + 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index d6e79c172ab..07bfb37d6a0 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -142,17 +142,6 @@ cd /github/workspace #git clone https://github.com/ocaml/opam --single-branch --branch 2.2 --depth 1 local-opam #cd local-opam -EOF - -# workaround for opensuse, mccs & glpk -if [ $target = "opensuse" ]; then - cat >>$dir/entrypoint.sh << EOF -OPAMEDITOR="sed -i 's|^build.*$|& [\\"mv\\" \\"src/glpk/dune-shared\\" \\"src/glpk/dune\\"]|'" opam pin edit mccs -yn -#opam show --raw mccs -EOF -fi - -cat >>$dir/entrypoint.sh << EOF opam install . --deps eval \$(opam env) ./configure diff --git a/master_changes.md b/master_changes.md index 3f422ff7122..8942c5730c9 100644 --- a/master_changes.md +++ b/master_changes.md @@ -129,6 +129,7 @@ users) * Depexts: move parts to docker build image, for caching [#6079 @rjbou] * Depexts: set version for conf packages to check [#6079 @rjbou] * Depexts: add package to test containing `os-version` in filter [#6079 @rjbou] + * Depexts: fix opensuse job [#6079 @rjbou] ## Doc * Remove the ppa from the installation instructions on Ubuntu [#5988 @kit-ty-kate - fix #5987]