-
Notifications
You must be signed in to change notification settings - Fork 3
Support building with dune #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,33 @@ | ||
| *.aux | ||
| *.v.d | ||
| *.vo | ||
| *.vok | ||
| *.vos | ||
| *RocqMakefile* | ||
| .lia.cache | ||
| *.vok | ||
| *.vio | ||
| *.v.d | ||
| .coqdeps.d | ||
| *.glob | ||
| *.cache | ||
| *.aux | ||
| \#*\# | ||
| .\#* | ||
| *~ | ||
| *.bak | ||
| .coqdeps.d | ||
| .coq-native/ | ||
| *.crashcoqide | ||
| .env | ||
| builddep/ | ||
| _RocqProject | ||
| _RocqProject.* | ||
| Makefile.rocq | ||
| Makefile.rocq.conf | ||
| .Makefile.rocq.d | ||
| Makefile.package.* | ||
| .Makefile.package.* | ||
| _opam | ||
| _build | ||
| *.install | ||
| config/local-flags | ||
| .envrc | ||
| .direnv | ||
| builddep | ||
| rocq_mcp_cache_* | ||
| .nia.cache |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Specification for custom Rocq compilation flags (turns into `-arg` values in `_RocqProject`). | ||
| # Syntax: | ||
| # - One flag per line with no leading/trailing blanks. | ||
| # - Empty lines and lines starting with '#' are ignored. | ||
|
|
||
| # We sometimes want to locally override notation, and there is no good way to do | ||
| # that with scopes. | ||
| -w | ||
| -notation-overridden | ||
|
|
||
| # Cannot use non-canonical projections as it causes massive unification failures | ||
| # (https://github.com/coq/coq/issues/6294). | ||
| -w | ||
| -redundant-canonical-projection |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Search paths for all packages. | ||
| # Each line should be of the form "<PACKAGE> <LOGICAL_PATH>", | ||
| # where <PACKAGE> is the name of a directory that matches the | ||
| # corresponding package name. | ||
| cryptis cryptis | ||
| examples cryptis.examples |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| (include_subdirs qualified) | ||
| (rocq.theory | ||
| (name cryptis) | ||
| (package rocq-cryptis) | ||
| (generate_project_file) | ||
| (theories Stdlib Ltac2 HB elpi elpi_elpi mathcomp deriving stdpp iris)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| (env | ||
| (_ ; Applies to all profiles (dev, release, ...). | ||
| (rocq | ||
| ; Configure rocq flags. | ||
| (flags (:standard %{read-lines:flags.dune}))))) | ||
|
|
||
| (rule | ||
| (action | ||
| (with-stdout-to flags.dune | ||
| (pipe-stdout | ||
| (cat config/flags) | ||
| (bash "grep '^[^#]\\+' || true"))))) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| (lang dune 3.21) | ||
| (using rocq 0.11) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| (include_subdirs qualified) | ||
| (rocq.theory | ||
| (name cryptis.examples) | ||
| (package rocq-cryptis-examples) | ||
| (generate_project_file) | ||
| (theories cryptis)) |
|
chandradeepdey marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/sh | ||
| set -e | ||
| # Script generating the contents of [_RocqProject] based on files [config/*]. | ||
|
|
||
| echo "# Generated file, edit [config/*] instead." | ||
|
|
||
| echo | ||
| echo "# Search paths" | ||
| # Adding "-Q " prefix to all non-empty, non-comment lines of [config/paths]. | ||
| cat config/paths | grep "^[^#]\+" | sed "s/^/-Q /" | ||
|
chandradeepdey marked this conversation as resolved.
|
||
|
|
||
| echo | ||
| echo "# Flags" | ||
| # Adding "-arg " prefix to all non-empty, non-comment lines of [config/flags] | ||
| # after adding quotes around each line. | ||
| cat config/flags | grep "^[^#]\+" | sed "s/\(.*\)/\"\1\"/" | sed "s/^/-arg /" | ||
|
|
||
| # List of source files. | ||
| echo | ||
| echo "# Sources" | ||
| # Take only non-empty, non-comment lines of [config/source-list]. | ||
| cat config/source-list | grep "^[^#]\+" | ||
|
chandradeepdey marked this conversation as resolved.
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this a bit overkill? We don't have separate packages per se in this repository, unless we view the examples as a separate entity.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will remove the separate package for examples from this PR and rebase. But the plan is to eventually have separate packages.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing separate packages is more work than I thought. Cryptis's directory structure is nice (cryptis and examples in separate directories). I don't think I want to change that, though I want to split out the Actris parts into a third directory (and the ReLoC parts into a fourth directory eventually). The way the scripts are designed to take one directory per line is also great, which I don't think I want to change. Once the Actris dependency is added to opam, I will do the three directory split but with a single package. I will then rebase this on top of that, and we will have dune + three packages. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/bin/sh | ||
| set -e | ||
| # Helper script to build and/or install just one package out of this repository. | ||
| # Assumes that all the other packages it depends on have been installed already! | ||
|
|
||
| # Make sure we get a GNU version of make. | ||
| # This is exactly how opam determines which make executable to use. | ||
| OS=$(uname) | ||
| MAKE="make" | ||
| if [ "$OS" = "FreeBSD" ] || [ "$OS" = "OpenBSD" ] ||\ | ||
| [ "$OS" = "NetBSD" ] || [ "$OS" = "DragonFly" ]; then | ||
| MAKE="gmake" | ||
| fi | ||
|
|
||
| PROJECT="$1" | ||
| shift | ||
|
|
||
| ROCQFILE="_RocqProject.$PROJECT" | ||
| MAKEFILE="Makefile.package.$PROJECT" | ||
|
|
||
| # Ensure we have an up-to-date _RocqProject file. | ||
| $MAKE _RocqProject | ||
|
|
||
| if ! grep -E -q "^$PROJECT/" _RocqProject; then | ||
| echo "No files in $PROJECT/ found in _RocqProject; this does not seem to be a valid project name." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Generate _RocqProject file and Makefile | ||
| rm -f "$ROCQFILE" | ||
| # Get the right "-Q" line. | ||
| grep -E "^-Q $PROJECT[ /]" _RocqProject >> "$ROCQFILE" | ||
| # Get everything until the first empty line except for the "-Q" lines. | ||
| sed -n '/./!q;p' _RocqProject | grep -E -v "^-Q " >> "$ROCQFILE" | ||
| # Get the files. | ||
| grep -E "^$PROJECT/" _RocqProject >> "$ROCQFILE" | ||
| # Now we can generate the makefile. | ||
| "${COQBIN}rocq" makefile -f "$ROCQFILE" -o "$MAKEFILE" | ||
|
|
||
| # Run build | ||
| $MAKE -f "$MAKEFILE" "$@" | ||
|
|
||
| # Cleanup | ||
| rm -f ".$MAKEFILE.d" "$MAKEFILE"* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| opam-version: "2.0" | ||
| name: "rocq-cryptis-examples" | ||
| version: "dev" | ||
| license: "MIT" | ||
| maintainer: "Arthur Azevedo de Amorim <arthur.aa@gmail.com>" | ||
| authors: "Arthur Azevedo de Amorim, Amal Ahmed, Marco Gaboardi" | ||
| synopsis: "Cryptis: Cryptographic Reasoning in Separation Logic" | ||
| homepage: "https://github.com/arthuraa/cryptis" | ||
| bug-reports: "https://github.com/arthuraa/cryptis/issues" | ||
| dev-repo: "git+https://github.com/arthuraa/cryptis.git" | ||
|
|
||
| depends: [ | ||
| "rocq-cryptis" {= version} | ||
| ] | ||
|
|
||
| build: ["./make-package" "examples" "-j%{jobs}%"] | ||
| install: ["./make-package" "examples" "install"] |
Uh oh!
There was an error while loading. Please reload this page.