Hi folks,
Is it possible to pack an addon that currently is not under dune?
Or the easiest way would be to initially "dunify" the lib and then add it to jscoq?
Thanks
if it's a regular Coq library, dunifying is generally quick (for example, our template for basic dune
file is four lines long). And Dune boilerplate can live alongside other build scripts. Not sure if Dune is required for jsCoq though.
Dune is not a requirement for doing an addon, however it does pay off quickly, in particular when developing jsCoq.
To build an addon without dune, you just need to point the build system of the addon to the right paths of jsCoq's own copy of Coq. Unfortunately we distribute a patched version of Coq, so jsCoq doesn't work against Coq OPAM. I am not sure how easy would be to add these patches to Coq's opam package tho. In this case jscoq could be built against opam's copy.
@Hanneli Tavante look at previous jscoq versions addons
directory and you will see a few examples how addons were done before dune
@Emilio Jesús Gallego Arias you could do a jsCoq version of the coq
package in the core-dev
opam repository
But that becomes very annoying quickly if you are going to develop, as you don't get incremental rebuilds, so each time you do make addons everything is done.
Karl Palmskog said:
Emilio Jesús Gallego Arias you could do a jsCoq version of the
coq
package in thecore-dev
opam repository
I'm not gonna do that myself, as I don't plan to use it, but I'd be happy to help / support the initiative.
My use case always relies in a composed coq.
That is to say, I'm always hacking both in jsCoq and Coq simultaneously, so I don't use the opam package.
sure, then if anyone would be interested in a special opam Coq package for jsCoq, I can add it (if Emilio points at sources/branch to use)
Let's see what Shachar says, but I'm not sure it is worth it, as still opam doesn't provide binary compatiblity. Main use case users have is to build packages that contain .vo , unfortunately with opam, you don't get that. We need something stronger such as docker, so packages built that way can be published in npm.
So I'd wait for someone to have a use case for the jscoq opam package.
OK, fine by me
@Hanneli Tavante example of building a non-dunerized addons https://github.com/jscoq/jscoq/blob/v8.12/coq-addons/equations.addon
Thanks folks!
Just wanted to confirm dune indeed would be the most practical way :+1:
@Emilio Jesús Gallego Arias how about a utility that builds a boilerplate Dune file based on a _CoqProject definition? sounds like it would be helpful for others in porting things.
I'm happy to send a PR improving the docs for the addons + dune if it helps as a short term solution
that would be wonderful!
Last updated: Jun 01 2023 at 12:01 UTC