Skip to content

Commit

Permalink
simpler overriding in bench
Browse files Browse the repository at this point in the history
  • Loading branch information
SkySkimmer committed Jul 22, 2024
1 parent 80510b6 commit f92c9e3
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions dev/bench/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -373,32 +373,16 @@ create_opam() {
opam var --global jobs=$number_of_processors >/dev/null
if [ ! -z "$BENCH_DEBUG" ]; then opam config list; fi

opam repo add -q --this-switch coq-extra-dev "$OPAM_COQ_DIR/extra-dev"
opam repo add -q --this-switch coq-released "$OPAM_COQ_DIR/released"

local override_package
local url_or_package
for url_or_package in $OPAM_OVERRIDE_URLS; do
if [ "$override_package" ]; then
echo "Setting source url for $override_package to $url_or_package in $RUNNER"
local found=
for subrepo in extra-dev released; do
path=$OPAM_COQ_DIR/$subrepo/packages/${override_package%%.*}/$override_package/opam
if [ -e "$path" ]; then
found=1
orig=$(opam show -f url.src --raw "$path")
sed -i.bak "s|$orig|\"$url_or_package\"|g" "$path"
if ! [ "\"$url_or_package\"" = "$(opam show -f url.src --raw "$path")" ]; then
msg="Failed to replace url in $path"
>&2 echo "$msg"
zulip_edit "Bench failed: $msg"
exit 1
fi
fi
done
if ! [ "$found" ]; then
msg="Could not find opam file for $override_package in $RUNNER"
>&2 echo "$msg"
zulip_edit "Bench failed: $msg"
exit 1
fi
# NB opam editor start seems to ignore -y but works with </dev/null
OPAMEDITOR="echo 'url { src: \"$url_or_package\" }' >> " opam pin add -nye "$override_package" - </dev/null
override_package=
else
override_package=$url_or_package
Expand All @@ -410,9 +394,6 @@ create_opam() {
exit 1
fi

opam repo add -q --this-switch coq-extra-dev "$OPAM_COQ_DIR/extra-dev"
opam repo add -q --this-switch coq-released "$OPAM_COQ_DIR/released"

opam install -qy -j$number_of_processors $initial_opam_packages
if [ ! -z "$BENCH_DEBUG" ]; then opam repo list; fi

Expand Down

0 comments on commit f92c9e3

Please sign in to comment.