-
Notifications
You must be signed in to change notification settings - Fork 10
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
Update for Dune-Coq 0.8 and Coq 8.17 #7
Open
palmskog
wants to merge
3
commits into
v8.16
Choose a base branch
from
v8.17+0.8
base: v8.16
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Docker CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'v8.17+0.8' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build: | ||
# the OS must be GNU/Linux to be able to use the docker-coq-action | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image: | ||
- 'coqorg/coq:dev-ocaml-4.14-flambda' | ||
- 'coqorg/coq:8.17.1-ocaml-4.09.1-flambda' | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: coq-community/docker-coq-action@v1 | ||
with: | ||
opam_file: 'coq-my-plugin.opam' | ||
custom_image: ${{ matrix.image }} | ||
|
||
# See also: | ||
# https://github.com/coq-community/docker-coq-action#readme | ||
# https://github.com/erikmd/docker-coq-github-action-demo |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,60 @@ | ||
# Template for Coq Plugins using Dune | ||
# Coq Plugin Template using Dune | ||
|
||
This repository contains a template for writing a plugin for the | ||
[![Docker CI][docker-action-shield]][docker-action-link] | ||
|
||
[docker-action-shield]: https://github.com/coq-community/coq-plugin-template/workflows/Docker%20CI/badge.svg?branch=v8.17 | ||
[docker-action-link]: https://github.com/coq-community/coq-plugin-template/actions?query=workflow:"Docker%20CI" | ||
|
||
Template repository writing a plugin in [OCaml](https://ocaml.org) for the | ||
[Coq](https://coq.inria.fr) proof assistant using the [Dune](https://dune.build) | ||
build system. It showcases a few advanced features such as linking to C code or | ||
to external libraries. | ||
|
||
The current version is tested (and requires): | ||
|
||
- Dune 2.9 | ||
- Coq 8.16 | ||
|
||
Minimal historical requirements are Coq 8.9 and Dune 1.10, but they | ||
are not supported anymore. See template history / branches for | ||
changes at your own risk. | ||
## Meta | ||
|
||
See the [Dune documentation](https://dune.readthedocs.io/en/latest/) for more help. | ||
- License: [Unlicense](LICENSE) (change to your license of choice) | ||
- Compatible Coq versions: 8.17.1 or later | ||
- Additional dependencies: | ||
- [Dune](https://dune.build) 3.8.2 or later | ||
- Coq namespace: `MyPlugin` | ||
|
||
## See also | ||
|
||
The [official tutorial](https://github.com/coq/coq/tree/master/doc/plugin_tutorial) | ||
for writing Coq plugins in the Coq repository, which already includes `dune` files | ||
for OCaml parts. | ||
|
||
## How to build | ||
## Building instructions | ||
|
||
To install dependencies via [opam](https://opam.ocaml.org/doc/Install.html): | ||
```shell | ||
$ dune build | ||
$ opam install dune.3.8.2 coq.8.17.1 | ||
``` | ||
and the rest of the regular Dune commands. To test your library, you can use | ||
|
||
To build the plugin when all dependencies are installed: | ||
```shell | ||
$ dune exec -- coqtop -R _build/default/theories MyPlugin | ||
$ dune build | ||
``` | ||
|
||
or starting with Dune 3.2 | ||
The plugin can be tested manually: | ||
```shell | ||
$ dune coq top theories/Test.v | ||
``` | ||
|
||
## Releasing OPAM packages | ||
Welcome to Coq 8.17.1 | ||
|
||
You can use | ||
[`dune-release`](https://github.com/ocamllabs/dune-release) to | ||
automatically release OPAM packages. | ||
Coq < Require Import MyPlugin. | ||
[Loading ML file my_plugin.cmxs (using legacy method) ... done] | ||
|
||
For that, you need to update the included `.opam` file, and configure | ||
your Github tokens as described in the documentation of `dune-release`. | ||
Coq < CallC. | ||
Toplevel input, characters 0-6: | ||
> CallC. | ||
> ^^^^^^ | ||
Warning: 546 | ||
``` | ||
|
||
## Linking with external libraries | ||
See also the [Dune documentation](https://dune.readthedocs.io/en/latest/) for more help, | ||
and the [official tutorial](https://github.com/coq/coq/tree/master/doc/plugin_tutorial) | ||
for writing Coq plugins in the Coq repository which already includes `dune` files | ||
for the OCaml parts. | ||
|
||
Starting with Coq 8.16, Coq will load dependencies of your | ||
plugin. This requires that your plugin is named as a findlib package. | ||
## Releasing opam packages | ||
|
||
See [Coq documentation](https://coq.github.io/doc/master/refman/proof-engine/vernacular-commands.html#coq:cmd.Declare-ML-Module) for more information. | ||
You can use [`dune-release`](https://github.com/tarides/dune-release) to | ||
automatically release opam packages. | ||
|
||
For that, you need to update the included `.opam` file, and configure | ||
your Github tokens as described in the documentation of `dune-release`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
opam-version: "2.0" | ||
maintainer: "[email protected]" | ||
version: "dev" | ||
|
||
homepage: "https://github.com/your-github/my-plugin" | ||
dev-repo: "git+https://github.com/your-github/my-plugin.git" | ||
bug-reports: "https://github.com/your-github/my-plugin/issues" | ||
doc: "https://your-github.github.io/my-plugin" | ||
license: "MIT" | ||
homepage: "https://github.com/coq-community/my-plugin" | ||
dev-repo: "git+https://github.com/coq-community/my-plugin.git" | ||
bug-reports: "https://github.com/coq-community/my-plugin/issues" | ||
doc: "https://coq-community.github.io/my-plugin" | ||
license: "SPDX-identifier-for-your-license" | ||
|
||
synopsis: "One line description of your plugin" | ||
description: """ | ||
|
@@ -14,9 +15,9 @@ cover multiple lines. Including punctuation.""" | |
|
||
build: ["dune" "build" "-p" name "-j" jobs] | ||
depends: [ | ||
"ocaml" {>= "4.07.1"} | ||
"dune" {>= "2.5"} | ||
"coq" {>= "8.14" & < "8.15"} | ||
"ocaml" {>= "4.09.0"} | ||
"dune" {>= "3.8.2"} | ||
"coq" {>= "8.17.1"} | ||
] | ||
|
||
tags: [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(lang dune 2.9) | ||
(using coq 0.3) | ||
(lang dune 3.8) | ||
(using coq 0.8) | ||
(name my-plugin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to use a more recent OCaml version? I suggest 4.14.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But 4.14.1 isn't required, right? I thought we keep this the lower bound.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it is not. That's a good question about what versions we put here. In general it will depend on the OCaml features the plugin writer uses.
Note also that 8.17.0 is not either a lower bound here, as the template works fine with 8.16.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As dicussed in Zulip, generally a template has a range of versions that it is suitable for, so we may want just to document the ranges users can do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR doesn't work on Coq 8.16 since I removed
-rectypes
.