Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Using SerAPI in a plugin

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Using SerAPI in a plugin


Chronological Thread 
  • From: Lasse Blaauwbroek <lasse AT blaauwbroek.eu>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Using SerAPI in a plugin
  • Date: Wed, 8 Sep 2021 02:54:58 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=lasse AT blaauwbroek.eu; spf=Pass smtp.mailfrom=lasse AT blaauwbroek.eu; spf=None smtp.helo=postmaster AT mail.blaauwbroek.eu
  • Ironport-hdrordr: A9a23:POT3jKNZ7FoBkMBcTsyjsMiBIKoaSvp037BZ7TEXdfU1SL39qynKpp4mPHDP6Ar5NEtPpTnEAtjkfZq+z+8W3WByB9aftWDd0QPCEGgh1+TfKlbbdhEWmNQw6U4tSdkcNOHN
  • Ironport-phdr: A9a23:8DwwgBJmB2vsscX9vtmcuKtmWUAX0o4c3iYr45Yqw4hDbr6kt8y7ehCFvbM81RSUAs3y0LFts6LuqafuWGgNs96qkUspV9hybSIDktgchAc6AcSIWgXRJf/uaDEmTowZDAc2t360PlJIF8ngelbcvmO97SIIGhX4KAF5Ovn5FpTdgsipy+y+4ZnebxhHiDe9Y755MQm7oxjWusQKm4VpN7w/ygHOontGeuRWwX1nKFeOlBvi5cm+4YBu/T1It/0u68BPX6P6f78lTbNDFzQpL3o15MzwuhbdSwaE+2YRXX8XkhpMBAjF8Q36U5LsuSb0quZxxC+XNtDwQLspWzqt8r1rRQf1hikZOT438GLZhMJ+g61Uoh2uuwdyzJTIbIyPLvdyYq3QcNEcSGFcXshRTStBAoakYoUJFeUBJv1YoJfgrFYTqRuxHxOjBP7hyzBTnH/22rM10+c8GgzB2AwvBckOsG/Ko9juL6gSVfq6w7PVzTTNdPxWwzD955bLchw7v/6MQKt9fMzMwkYgCw3LlE+fqZD5PzyLzOQNtXCW4upvWO+ylmIqrxx8ryary8ojjoTEhp8YxFDa+Ch43Ys5OdK1RFB6bNCrHpZdqT+XO5d4T84/X2xmtzg2xqEHtJO9YSMExpMnxxvFZPyGdYiF+h3jVOeNITd4mXJqY6iziAq18UilzOD3S8q60E5SoyZYkdTBtmoB2wLc58SdVPdx4Fut1SyN2gzO8u1IPE45mKXBJ5I8wrM9lYAfvVnBEyL1gkn6kqmbfVg+9Oey8eToeLDmq4ecN4BqjgH+NbwjmsmlDuQ5NggCRXOU+eCm27L54E34Tq5FjucxkqbHs5DWP9oUprOhDw9U1IYs9Qq/Ai+73NkbnXQLNkxJdR2dg4T3JV3CPOr0APWij1i0lTdk3fHGPrnvApXXKXjDla/sfbJn5E5H0wo808tS6IlQCr4bOv3zR0Hwu8fCDh8+LQO0wPzrB8tg1o8GQ2KAHreZML/OsV+P/u8gP+6MZJYMtDnhL/gl+uXhgGQimV4deKmpxYEYZGq5HvRgOUWZYGDjjs0PEWcQ7UICS7nhj0THWjpObV6zWbg973c1EtGIF4DGE6Skm6eMlA2/F5RLeWpcDV2PWSPsfp6fVt8GbCubP9BriDsJVv6sVtlyhlmVqAbmxu8/faLv8SoCuMe7vDCQz+fXnBgv6jZuCMmelWyQHTkcdowgTTs/1b1gq1Z6x1TF3LUq2pSw9PRW7vJNFA0+PJfB0OZgDN3xHA/cLI/hdQ==

With dune, Coq's libraries are split into sub-libraries, such as 'coq.plugins.ltac'. When you need to use a particular API file, you check which library it is in (by opening the dune file in the directory of that file), and add that library as a dep. The repo I linked does this with 'coq.plugins.ltac'.

On 08/09/2021 02:50, Talia Ringer wrote:
Thanks, with Dune though I can't even get my Coq plugin without SerAPI to load Constr, Environ, and other necessary modules. I have no idea what I'm supposed to depend on to get those.

On Tue, Sep 7, 2021 at 7:47 PM Lasse Blaauwbroek <lasse AT blaauwbroek.eu> wrote:

I have an example plugin that does exactly this here: https://github.com/LasseBlaauwbroek/serapi-example

I think I built this again 8.11 at the time, but I'm not sure (I didn't try to recompile the plugin before this email). Word of warning: Using SerAPI in a Coq plugin can be rather difficult due to its dependencies.

Lasse

On 08/09/2021 02:30, Talia Ringer wrote:
Hi all,

Have any of you gotten plugins that call out to SerAPI working, especially on Coq 8.9 (I am bound to 8.9 because of a dependency)? If so, I'd really love to see some example plugins. This is a major blocker for me and a student on a project.

I'm open to any build system at this point, but I haven't managed to get Dune working even without SerAPI---it gives me a bunch of errors failing to find Constr, Environ, and so on. The Dune tutorial didn't seem to address those errors. I don't know where to find the list of Coq libraries I can try to depend on from within a Dune project.

Without using Dune, using the normal _CoqProject and so on, I can get it to build if I build from source, which is already hacky. But then it fails to load:

File "./theories/Plib.v", line 1, characters 0-25:
Error:
while loading /home/talia/coq-plugin-lib/src/plib.cmxs:
error loading shared library: /home/talia/coq-plugin-lib/src/plib.cmxs: undefined symbol: camlPlib__Serapi_goals__anon_fn$5bcoq$2dserapi$2fserapi$2fserapi_goals$2eml$3a66$2c31$2d$2d47$5d_175_closure

Help with either of these paths would be strongly appreciated. 

Talia 



Archive powered by MHonArc 2.6.19+.

Top of Page