Commit cbe5e59a authored by Ralf Jung's avatar Ralf Jung

use OPAM-based CI

parent 30664fa6
Pipeline #3315 passed with stage
in 18 minutes and 21 seconds
image: coq:8.5 image: ralfjung/opam-ci:latest
stages: iris_atomic-coq8.5.3:
- iris
- iris-atomic
stage: iris
- coq
- coqc -v
# see if the Iris submodule needs cleaning, then build it
- 'git submodule status iris | egrep "^ " || (git submodule update --init iris && cd iris && git clean -xfd)'
- 'cd iris && make -j8'
- master
- ci
stage: iris-atomic
- coq
script: script:
- coqc -v # prepare
# prepare the environment, safeguard against outdated submodule - . build/ 'coq 8.5.3' 'coq-mathcomp-ssreflect 1.6'
- 'git submodule status iris | egrep "^ "' # build
- 'ln -s iris iris-enabled'
# build local repo
- 'time make -j8' - 'time make -j8'
key: "coq8.5"
- opamroot/
only: only:
- master - master
- ci - ci
[submodule "iris"]
path = iris
url =
# Process flags
ifeq ($(Y), 1)
# Determine Coq version
COQ_VERSION=$(shell coqc --version | egrep -o 'version 8.[0-9]' | egrep -o '8.[0-9]')
ifeq ($(COQ_VERSION), 8.6)
COQ_MAKEFILE_FLAGS += -arg -w -arg -notation-overridden,-redundant-canonical-projection
# Forward most targets to Coq makefile (with some trick to make this phony)
%: Makefile.coq phony %: Makefile.coq phony
+@make -f Makefile.coq $@ +@make -f Makefile.coq $@
# Compile this project
all: Makefile.coq all: Makefile.coq
+@make -f Makefile.coq all +@make -f Makefile.coq all
clean: Makefile.coq clean: Makefile.coq
+@make -f Makefile.coq clean +@make -f Makefile.coq clean
find \( -name "*.v.d" -o -name "*.vo" -o -name "*.aux" -o -name "*.cache" -o -name "*.glob" -o -name "*.vio" \) -print -delete
rm -f Makefile.coq rm -f Makefile.coq
# Create Coq Makefile
Makefile.coq: _CoqProject Makefile Makefile.coq: _CoqProject Makefile
coq_makefile -f _CoqProject | sed 's/$$(COQCHK) $$(COQCHKFLAGS) $$(COQLIBS)/$$(COQCHK) $$(COQCHKFLAGS) $$(subst -Q,-R,$$(COQLIBS))/' > Makefile.coq @# we want to pass the correct name to coq_makefile or it will be confused.
coq_makefile $(COQ_MAKEFILE_FLAGS) -f _CoqProject -o Makefile.coq
# Use local Iris dependency mv Makefile.coq Makefile.coq.tmp
iris-local: @# The sed script is for Coq 8.5 only, it fixes 'make verify'.
git submodule update --init iris # If not initialized, then initialize; If not updated with this remote, then update @# The awk script fixes 'make uninstall'.
ln -nsf iris iris-enabled # If not linked, then link sed 's/$$(COQCHK) $$(COQCHKFLAGS) $$(COQLIBS)/$$(COQCHK) $$(COQCHKFLAGS) $$(subst -Q,-R,$$(COQLIBS))/' < Makefile.coq.tmp \
+make -C iris -f Makefile # If not built, then build | awk '/^uninstall:/{print "uninstall:";print "\tif [ -d \"$$(DSTROOT)\"$$(COQLIBINSTALL)/iris/ ]; then find \"$$(DSTROOT)\"$$(COQLIBINSTALL)/iris/ -name \"*.vo\" -print -delete; fi";getline;next}1' > Makefile.coq
rm Makefile.coq.tmp
# Use system-installed Iris dependency
iris-system: clean # Install build-dependencies
rm -f iris-enabled build-dep:
build/ < opam.pins
_CoqProject: ; opam upgrade $(YFLAG) # it is not nice that we upgrade *all* packages here, but I found no nice way to upgrade only those that we pinned
opam pin add coq-iris-atomic "$$(pwd)#HEAD" -k git -n -y
opam install coq-iris-atomic --deps-only $(YFLAG)
opam pin remove coq-iris-atomic
# some fiels that do *not* need to be forwarded to Makefile.coq
Makefile: ; Makefile: ;
_CoqProject: ;
# Phony targets (i.e. targets that should be run no matter the timestamps of the involved files)
phony: ; phony: ;
.PHONY: all clean phony
.PHONY: all clean phony iris-local iris-system
-Q theories iris_atomic -Q theories iris_atomic
-Q iris-enabled iris
theories/atomic.v theories/atomic.v
theories/sync.v theories/sync.v
theories/atomic_incr.v theories/atomic_incr.v
set -e
# This script installs the build dependencies for CI builds.
# Prepare OPAM configuration
export OPAMROOT="$(pwd)/opamroot"
export OPAMJOBS=16
export OPAM_EDITOR="$(which false)"
# Make sure we got a good OPAM
test -d "$OPAMROOT" || (mkdir "$OPAMROOT" && opam init --no-setup -y)
eval `opam conf env`
test -d "$OPAMROOT/repo/coq-extra-dev" || opam repo add coq-extra-dev -p 5
test -d "$OPAMROOT/repo/coq-core-dev" || opam repo add coq-core-dev -p 5
test -d "$OPAMROOT/repo/coq-released" || opam repo add coq-released -p 10
opam update
opam install ocamlfind -y # Remove this once the Coq crew fixed their package...
# Install fixed versions of some dependencies
for PIN in "${@}"
echo "Applying pin: $PIN"
opam pin add $PIN -k version -y
# Install build-dependencies
make build-dep Y=1
# done
coqc -v
set -e
## Process an opam.pins file from stdin: Add all the given pins, but don't install anything.
## Usage:
## ./ < opam.pins
# Process stdin
while read PACKAGE URL HASH; do
if echo "$URL" | egrep '^https://gitlab\.mpi-sws\.org' > /dev/null; then
echo "[opam-pins] Recursing into $URL"
# an MPI URL -- try doing recursive pin processing
curl -f "$URL/raw/$HASH" 2> /dev/null | "$0"
echo "[opam-pins] Applying pin: $PACKAGE -> $URL#$HASH"
opam pin add "$$HASH" "$URL#$HASH" -k git -y -n
Subproject commit b72a3301d7ff957cfbb06d06bba85fb4ee9a2c39
opam-version: "1.2"
name: "coq-iris-atomic"
version: "dev"
maintainer: "Zhen Zhang, Ralf Jung"
authors: "Zhen Zhang"
homepage: ""
bug-reports: ""
dev-repo: ""
build: [
[make "-j%{jobs}%"]
install: [make "install"]
remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/iris_atomic" ]
depends: [
coq-iris b72a3301d7ff957cfbb06d06bba85fb4ee9a2c39
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment