Skip to content

Commit 2a7e66b

Browse files
committed
add rocq workarounds for coq_makefile scripts
Signed-off-by: Ali Caglayan <[email protected]>
1 parent 463b3b1 commit 2a7e66b

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ jobs:
8282
sudo chown -R 1000:1000 .
8383
endGroup
8484
echo "::remove-matcher owner=coq-problem-matcher::" # remove problem matcher installed by Coq docker action, so we don't get duplicate warning annotations
85+
# Workaround for Rocq 9.0 naming transition
86+
if ! command -v coq_makefile >/dev/null 2>&1 && command -v rocq >/dev/null 2>&1; then
87+
opam install coq-core coq-stdlib coq -y >/dev/null 2>&1 || true
88+
if ! command -v coq_makefile >/dev/null 2>&1; then
89+
sudo sh -c 'echo "#!/bin/bash" > /usr/local/bin/coq_makefile'
90+
sudo sh -c 'echo "exec rocq makefile \"\$@\"" >> /usr/local/bin/coq_makefile'
91+
sudo chmod +x /usr/local/bin/coq_makefile
92+
fi
93+
fi
8594
make -j2
8695
- name: Revert permissions
8796
# to avoid a warning at cleanup time - https://github.com/coq-community/docker-coq-action#permissions
@@ -116,6 +125,15 @@ jobs:
116125
sudo chown -R 1000:1000 .
117126
endGroup
118127
echo "::remove-matcher owner=coq-problem-matcher::" # remove problem matcher installed by Coq docker action, so we don't get duplicate warning annotations
128+
# Workaround for Rocq 9.0 naming transition
129+
if ! command -v coq_makefile >/dev/null 2>&1 && command -v rocq >/dev/null 2>&1; then
130+
opam install coq-core coq-stdlib coq -y >/dev/null 2>&1 || true
131+
if ! command -v coq_makefile >/dev/null 2>&1; then
132+
sudo sh -c 'echo "#!/bin/bash" > /usr/local/bin/coq_makefile'
133+
sudo sh -c 'echo "exec rocq makefile \"\$@\"" >> /usr/local/bin/coq_makefile'
134+
sudo chmod +x /usr/local/bin/coq_makefile
135+
fi
136+
fi
119137
sudo apt-get -o Acquire::Retries=30 update -q
120138
sudo apt-get -o Acquire::Retries=30 install python3 python-is-python3 -y --allow-unauthenticated
121139
etc/coq-scripts/github/reportify-coq.sh --errors ${{ matrix.extra-gh-reportify }} make TIMED=1 -j2 --output-sync
@@ -184,6 +202,15 @@ jobs:
184202
coq_version: ${{ env.coq-version-supported }}
185203
ocaml_version: ${{ env.ocaml-version }}
186204
custom_script: |
205+
# Workaround for Rocq 9.0 naming transition
206+
if ! command -v coq_makefile >/dev/null 2>&1 && command -v rocq >/dev/null 2>&1; then
207+
opam install coq-core coq-stdlib coq -y >/dev/null 2>&1 || true
208+
if ! command -v coq_makefile >/dev/null 2>&1; then
209+
sudo sh -c 'echo "#!/bin/bash" > /usr/local/bin/coq_makefile'
210+
sudo sh -c 'echo "exec rocq makefile \"\$@\"" >> /usr/local/bin/coq_makefile'
211+
sudo chmod +x /usr/local/bin/coq_makefile
212+
fi
213+
fi
187214
opam install -y coq-serapi
188215
sudo apt-get -o Acquire::Retries=30 update -q
189216
sudo apt-get -o Acquire::Retries=30 install python3-pip python3-venv autoconf -y --allow-unauthenticated
@@ -232,6 +259,15 @@ jobs:
232259
coq_version: ${{ env.coq-version-supported }}
233260
ocaml_version: ${{ env.ocaml-version }}
234261
custom_script: |
262+
# Workaround for Rocq 9.0 naming transition
263+
if ! command -v coq_makefile >/dev/null 2>&1 && command -v rocq >/dev/null 2>&1; then
264+
opam install coq-core coq-stdlib coq -y >/dev/null 2>&1 || true
265+
if ! command -v coq_makefile >/dev/null 2>&1; then
266+
sudo sh -c 'echo "#!/bin/bash" > /usr/local/bin/coq_makefile'
267+
sudo sh -c 'echo "exec rocq makefile \"\$@\"" >> /usr/local/bin/coq_makefile'
268+
sudo chmod +x /usr/local/bin/coq_makefile
269+
fi
270+
fi
235271
sudo apt-get update
236272
sudo apt-get install -y ghc
237273
sudo apt-get install -y --allow-unauthenticated \
@@ -325,6 +361,15 @@ jobs:
325361
coq_version: ${{ env.coq-version-supported }}
326362
ocaml_version: ${{ env.ocaml-version }}
327363
custom_script: |
364+
# Workaround for Rocq 9.0 naming transition
365+
if ! command -v coq_makefile >/dev/null 2>&1 && command -v rocq >/dev/null 2>&1; then
366+
opam install coq-core coq-stdlib coq -y >/dev/null 2>&1 || true
367+
if ! command -v coq_makefile >/dev/null 2>&1; then
368+
sudo sh -c 'echo "#!/bin/bash" > /usr/local/bin/coq_makefile'
369+
sudo sh -c 'echo "exec rocq makefile \"\$@\"" >> /usr/local/bin/coq_makefile'
370+
sudo chmod +x /usr/local/bin/coq_makefile
371+
fi
372+
fi
328373
startGroup "Workaround permission issue" # https://github.com/coq-community/docker-coq-action#permissions
329374
sudo chown -R 1000:1000 .
330375
endGroup
@@ -368,6 +413,15 @@ jobs:
368413
coq_version: ${{ env.coq-version-supported }}
369414
ocaml_version: ${{ env.ocaml-version }}
370415
custom_script: |
416+
# Workaround for Rocq 9.0 naming transition
417+
if ! command -v coq_makefile >/dev/null 2>&1 && command -v rocq >/dev/null 2>&1; then
418+
opam install coq-core coq-stdlib coq -y >/dev/null 2>&1 || true
419+
if ! command -v coq_makefile >/dev/null 2>&1; then
420+
sudo sh -c 'echo "#!/bin/bash" > /usr/local/bin/coq_makefile'
421+
sudo sh -c 'echo "exec rocq makefile \"\$@\"" >> /usr/local/bin/coq_makefile'
422+
sudo chmod +x /usr/local/bin/coq_makefile
423+
fi
424+
fi
371425
sudo apt-get update
372426
sudo apt-get install -y time python3 python-is-python3 lua5.1
373427
startGroup "Workaround permission issue" # https://github.com/coq-community/docker-coq-action#permissions
@@ -418,6 +472,15 @@ jobs:
418472
coq_version: ${{ matrix.coq-version }}
419473
ocaml_version: ${{ env.ocaml-version }}
420474
custom_script: |
475+
# Workaround for Rocq 9.0 naming transition
476+
if ! command -v coq_makefile >/dev/null 2>&1 && command -v rocq >/dev/null 2>&1; then
477+
opam install coq-core coq-stdlib coq -y >/dev/null 2>&1 || true
478+
if ! command -v coq_makefile >/dev/null 2>&1; then
479+
sudo sh -c 'echo "#!/bin/bash" > /usr/local/bin/coq_makefile'
480+
sudo sh -c 'echo "exec rocq makefile \"\$@\"" >> /usr/local/bin/coq_makefile'
481+
sudo chmod +x /usr/local/bin/coq_makefile
482+
fi
483+
fi
421484
startGroup "Workaround permission issue" # https://github.com/coq-community/docker-coq-action#permissions
422485
sudo chown -R 1000:1000 .
423486
endGroup
@@ -456,6 +519,20 @@ jobs:
456519
coq_version: ${{ matrix.coq-version }}
457520
ocaml_version: ${{ env.ocaml-version }}
458521
custom_script: |
522+
# Workaround for Rocq 9.0 naming transition
523+
if ! command -v coq_makefile >/dev/null 2>&1 && command -v rocq >/dev/null 2>&1; then
524+
opam install coq-core coq-stdlib coq -y >/dev/null 2>&1 || true
525+
if ! command -v coq_makefile >/dev/null 2>&1; then
526+
sudo sh -c 'echo "#!/bin/bash" > /usr/local/bin/coq_makefile'
527+
sudo sh -c 'echo "exec rocq makefile \"\$@\"" >> /usr/local/bin/coq_makefile'
528+
sudo chmod +x /usr/local/bin/coq_makefile
529+
fi
530+
if ! command -v coqtop >/dev/null 2>&1; then
531+
sudo sh -c 'echo "#!/bin/bash" > /usr/local/bin/coqtop'
532+
sudo sh -c 'echo "exec rocq \"\$@\"" >> /usr/local/bin/coqtop'
533+
sudo chmod +x /usr/local/bin/coqtop
534+
fi
535+
fi
459536
startGroup "Workaround permission issue" # https://github.com/coq-community/docker-coq-action#permissions
460537
sudo chown -R 1000:1000 .
461538
endGroup

0 commit comments

Comments
 (0)