Skip to content
Snippets Groups Projects
Commit 80da656e authored by Ralf Jung's avatar Ralf Jung
Browse files

Merge branch 'ci' into 'master'

New opam-based CI and build system

Submodules are gone. If you have opam set up, `make build-dep` will install the right version of everything.

This is *not* exactly what we discussed last week; I think I found something better. In particular, this approach lets us also figure out for historic lambdaRust versions, which commit of iris they needed. No magic branches in other repositories are needed, everything is local here.

Essentially, since the `opam` files do not support documenting detailed enough version information, I added a new file `opam.pins` that "enhances" the opam file appropriately. This file contains pins (one per line) that have to be set to compile lambdaRust. The script in `build/opam-pins.sh` applies those pins - and crucially, it does so recursively: When it finds a pin that is one of our git repositories, it will download the `opam.pins` files for *that* commit and also apply its pins. So if lambdaRust pins a particular commit of iris, and iris pins a particular commit of the prelude, then doing `make build-dep` in lambdaRust will follow this transitive chain and install the correct versions of iris and the prelude.

Cc @jjourdan @robbertkrebbers

See merge request !2
parents 846abf49 73391eeb
No related branches found
No related tags found
1 merge request!2New opam-based CI and build system
Pipeline #
...@@ -11,3 +11,4 @@ ...@@ -11,3 +11,4 @@
.coq-native/ .coq-native/
iris-enabled iris-enabled
Makefile.coq Makefile.coq
opamroot
image: coq:8.5 image: opam
stages: lrust-coq8.5.3:
- iris
- lrust
iris:
stage: iris
tags:
- coq
script:
- 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'
only:
- master
- ci
lrust:
stage: lrust
tags: tags:
- coq - coq
script: script:
- coqc -v # prepare
# prepare the environment, safeguard against outdated submodule - . build/opam-ci.sh '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'
cache:
key: "coq8.5.3-2"
paths:
- opamroot/
only: only:
- master - master
- ci - ci
[submodule "iris"]
path = iris
url = https://gitlab.mpi-sws.org/FP/iris-coq.git
...@@ -12,15 +12,10 @@ clean: Makefile.coq ...@@ -12,15 +12,10 @@ clean: Makefile.coq
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 coq_makefile -f _CoqProject | sed 's/$$(COQCHK) $$(COQCHKFLAGS) $$(COQLIBS)/$$(COQCHK) $$(COQCHKFLAGS) $$(subst -Q,-R,$$(COQLIBS))/' > Makefile.coq
# Use local Iris dependency build-dep:
iris-local: cat opam.pins | build/opam-pins.sh
git submodule update --init iris # If not initialized, then initialize; If not updated with this remote, then update opam pin add coq-lambda-rust "$$(pwd)#HEAD" -k git -y -n
ln -nsf iris iris-enabled # If not linked, then link opam install coq-lambda-rust --deps-only -y
+make -C iris -f Makefile # If not built, then build
# Use system-installed Iris dependency
iris-system: clean
rm -f iris-enabled
_CoqProject: ; _CoqProject: ;
......
...@@ -6,21 +6,17 @@ This is the Coq formalization of lambda-Rust. ...@@ -6,21 +6,17 @@ This is the Coq formalization of lambda-Rust.
This version is known to compile with: This version is known to compile with:
- Coq 8.5pl2 - Coq 8.5pl3
- Ssreflect 1.6 - Ssreflect 1.6
- A development version of [Iris](https://gitlab.mpi-sws.org/FP/iris-coq/)
You will furthermore need an up-to-date version of The easiest way to install the correct versions of the dependencies is through
[Iris](https://gitlab.mpi-sws.org/FP/iris-coq/). Run `git submodule status` to opam. Once you got opam set up, just run `make build-dep` to install the right
see which git commit of Iris is known to work. You can pick between using a versions of the dependencies.
system-installed Iris (from Coq's `user-contrib`) or a version of Iris locally
compiled for lambda-Rust.
## Building Instructions Alternatively, you can manually determine the required Iris commit by consulting
the `opam.pins` file.
To use the system-installed Iris (which is the default), run `make iris-system`. ## Building Instructions
This only works if you previously built and installed a compatible version of the
Iris Coq formalization. To use a local Iris (which will always be the right
version), run `make iris-local`. Run this command again later to update the
local Iris, in case the preferred Iris version changed.
Now run `make` to build the full development. Run `make` to build the full development.
-Q theories lrust -Q theories lrust
-Q iris-enabled iris
theories/adequacy.v theories/adequacy.v
theories/derived.v theories/derived.v
theories/heap.v theories/heap.v
......
#!/bin/bash
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 -n)
eval `opam conf env`
test -d "$OPAMROOT/repo/coq-extra-dev" || opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev -p 5
test -d "$OPAMROOT/repo/coq-core-dev" || opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev -p 5
test -d "$OPAMROOT/repo/coq-released" || opam repo add coq-released https://coq.inria.fr/opam/released -p 10
opam update
opam install ocamlfind -y # Remove this once the Coq crew fixed their package...
# Pick fixed versions of some dependencies
echo
for PIN in "${@}"
do
echo "Applying pin: $PIN"
opam pin add $PIN -k version -y -n
done
# Install/upgrade build-dependencies
echo
opam upgrade -y
make build-dep
# done
echo
coqc -v
#!/bin/bash
set -e
# Process an opam.pins file from stdin.
while read PACKAGE PIN; do
if echo "$PIN" | egrep '^https://gitlab\.mpi-sws\.org' > /dev/null; then
# an MPI URL -- try doing recursive pin processing
URL=$(echo "$PIN" | sed 's|#|/raw/|')/opam.pins
curl -f "$URL" 2> /dev/null | "$0"
fi
echo "Applying pin: $PACKAGE -> $PIN"
opam pin add "$PACKAGE" "$PIN" -k git -y -n
done
Subproject commit 243fdd139ccdf1370e5b186650e4323d5e73e54b
...@@ -13,5 +13,5 @@ build: [ ...@@ -13,5 +13,5 @@ build: [
install: [make "install"] install: [make "install"]
remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/lrust'" ] remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/lrust'" ]
depends: [ depends: [
"coq-iris" { (= "dep.lrust") } "coq-iris"
] ]
coq-iris https://gitlab.mpi-sws.org/FP/iris-coq#243fdd139ccdf1370e5b186650e4323d5e73e54b
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment