Skip to content

Commit

Permalink
Stop using --strict option for while
Browse files Browse the repository at this point in the history
This is to workaround an issue where `--strict` option has been letting the
build failure since ocaml/opam-repository#21959 is merged.
  • Loading branch information
na4zagin3 committed Aug 16, 2022
1 parent 4f83180 commit 721d12f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# SKIP_OLDEST_DEPS: Skip building against oldest dependencies
# SKIP_REVERSE_DEPS: Skip building against reverse dependencies
# WORKAROUND_OPAM_BUG_5132: Skip integrity check against OPAM
# WORKAROUND_OPAM_BUG_STRICT: Don't use --strict option (See https://github.com/ocaml/opam-repository/pull/21959#discussion_r943873612)

set -exo pipefail

Expand All @@ -26,6 +27,13 @@ case "$(opam --version)" in
;;
esac

TIMESTAMP_DEADLINE_WORKAROUND_OPAM_BUG_STRICT=$(date -d 2022-09-01 +%s)
TIMESTAMP_NOW=$(date +%s)
if [ $TIMESTAMP_DEADLINE_WORKAROUND_OPAM_BUG_STRICT -ge $TIMESTAMP_NOW ] ; then
echo "Enable workaround for an OPAM Bug related to --strict"
WORKAROUND_OPAM_BUG_STRICT=1
fi

OCAML_PACKAGE="ocaml.$(opam show --color=never -f version ocaml)"

if [ -n "$SKIP_OLDEST_DEPS" ] || ! opam install --yes opam-0install
Expand Down Expand Up @@ -126,15 +134,18 @@ if true ; then

case "$PACKAGE_NAME" in
satyrographos-*)
declare -a PACKAGES_AND_OPTIONS=('--strict' '--with-test' "$PACKAGE")
declare -a PACKAGES_AND_OPTIONS=('--with-test' "$PACKAGE")
SKIP_OCAML_MISMATCH=1
SKIP_SATYSFI_MISMATCH=1
;;
*)
declare -a PACKAGES_AND_OPTIONS=('--strict' '--with-test' "$PACKAGE")
declare -a PACKAGES_AND_OPTIONS=('--with-test' "$PACKAGE")
SKIP_OCAML_MISMATCH=
SKIP_SATYSFI_MISMATCH=1
esac
if [ -z "$WORKAROUND_OPAM_BUG_STRICT" ] ; then
PACKAGES_AND_OPTIONS+=('--strict')
fi

if ! opam_install_dry_run --json=opam-output.json --cli=2.1 --update-invariant "${PACKAGES_AND_OPTIONS[@]}" "$SATYSFI_PACKAGE"
then
Expand Down

0 comments on commit 721d12f

Please sign in to comment.