From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 17CC87EF29 for ; Fri, 18 Dec 2015 22:43:50 +0100 (CET) IronPort-PHdr: 9a23:WgahYBV5XGw77baSLM0rdWuIXivV8LGtZVwlr6E/grcLSJyIuqrYZhyBt8tkgFKBZ4jH8fUM07OQ6PC+HzRYqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh770o8WbSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6LoJvvRNWqTifqk+UacQTHF/azh0t4XXskzqVw6GZX9UfXiXlBdBHkCR5Qv/V5r19CTnu+xw0TSyMMvtCLQlXjLk4b09GzHyjyJSGDcz6mDajoRLh6JWuh+770hwyoTOYYyRcuF1fq7HcMkySm9IX8IXXCtEVNDvJ7ATBvYMaL4L57L2oEED+F7nXVGh Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-io0-f180.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.223.180; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.223.180 as permitted sender) identity=mailfrom; client-ip=209.85.223.180; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-io0-f180.google.com) identity=helo; client-ip=209.85.223.180; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-io0-f180.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BCAAAFfXRWnLTfVdFehAxtBrMOikYBDYFjI4VqAoE2BzgUAQEBAQEBAQEQAQEBAQEGDQkJIS6CLYIHAQEBAwESER0BGx0BAwELBgMCCw0qAgIiAREBBQEcBhMbB4d3AQMKCA6OL49OgTE+MYtIgWqCeYgFChknDVaDPwEBAQEBAQEDAQEBAQEBAQEVAQUOhkiDeIEGhQiCb4FJBZZ/hTuID4IlkzGGBhIkgRcRDwEBgkYNFgeBVz00hRkBAQE X-IPAS-Result: A0BCAAAFfXRWnLTfVdFehAxtBrMOikYBDYFjI4VqAoE2BzgUAQEBAQEBAQEQAQEBAQEGDQkJIS6CLYIHAQEBAwESER0BGx0BAwELBgMCCw0qAgIiAREBBQEcBhMbB4d3AQMKCA6OL49OgTE+MYtIgWqCeYgFChknDVaDPwEBAQEBAQEDAQEBAQEBAQEVAQUOhkiDeIEGhQiCb4FJBZZ/hTuID4IlkzGGBhIkgRcRDwEBgkYNFgeBVz00hRkBAQE X-IronPort-AV: E=Sophos;i="5.20,447,1444687200"; d="scan'208";a="157653666" Received: from mail-io0-f180.google.com ([209.85.223.180]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 18 Dec 2015 22:43:48 +0100 Received: by mail-io0-f180.google.com with SMTP id 186so104799396iow.0 for ; Fri, 18 Dec 2015 13:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=fwUKrr0cqrG5Y/6XkI6iV64YdlIUgvrRZMfbHMVN/HQ=; b=nNEht4C2cwF5cW+NkKOyzqa96UmWTobL9QqseBmJxs3CifUaDRXK7/NMGs0pt4JrlK aL0VCX3xrmDDBR11o/nbWeVJjreRFuySbQeozJQBk8TOmvEOJfLvmZ6WyInUGXbvDn8n VhSPKV5QvWhy9M98GMH12PMzskaFDaGLT8FzckBB2MqO3wBIfoDdkRDjK1LuTbPItWA5 tU4hWjI/A1XPE55kOK25otxM6PVyt4Hb0o33n8uYb3i7dIH40n77j9qzIQmJ5NX9F5W9 TVdG7gBdd6USmwaAozIXP7Tpjnd1FGYVulN4jDRjy0AXdX6IJpeG7B7I4iMYyAtO8G2c Y7rA== X-Received: by 10.107.157.85 with SMTP id g82mr6987575ioe.144.1450475026639; Fri, 18 Dec 2015 13:43:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.27.205 with HTTP; Fri, 18 Dec 2015 13:43:07 -0800 (PST) In-Reply-To: <56745B1C.7090904@ens-lyon.fr> References: <567430DC.6020009@ens-lyon.fr> <56745B1C.7090904@ens-lyon.fr> From: Gabriel Scherer Date: Fri, 18 Dec 2015 22:43:07 +0100 Message-ID: To: =?UTF-8?B?QXJtYcOrbCBHdcOpbmVhdQ==?= Cc: caml users , Gerd Stolpmann Content-Type: multipart/alternative; boundary=001a1140a722b7f2bd0527330875 Subject: Re: [Caml-list] OCamldoc plugins & ocamlbuild --001a1140a722b7f2bd0527330875 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable There is no ocamldoc.cm{,x}a in ocamldoc libraries today. We could probably change ocamldoc's build system to build one, but for now an ocamldoc package would have no archive(...) field, just the directory. It is not clear we need an ocamldoc.cm{,x}a archive if all plugins are to be passed to ocamldoc{,.opt} which is already linked with ocamldoc modules. On Fri, Dec 18, 2015 at 8:14 PM, Arma=C3=ABl Gu=C3=A9neau wrote: > Ok, thanks for the explanations. > > As for the ocamldoc package, would a META file along these lines do the > trick? > > # Specification for the "ocamldoc" library > requires =3D "compiler-libs" > version =3D "[distributed with Ocaml]" > description =3D "ocamldoc support library" > directory=3D "^ocamldoc" > archive(byte) =3D "ocamldoc.cma" > archive(native) =3D "ocamldoc.cmxa" > > Le 18/12/2015 18:06, Gabriel Scherer a =C3=A9crit : > > So I just tried=C2=B9, and the failure is as follows: > > $ ocamlbuild = -tag > use_ocamldoc test.cmxs > + /home/gasche/.opam/4.02.3/bin/ocamlopt.opt > -shared -I +ocamldoc ocamldoc.cmxa test.cmx -o test.cmxs > File "_none_", > line 1: > Error: Cannot find file ocamldoc.cmxa > > It looks like the tag > use_ocamldoc expects a file ocamldoc.cmxa to exist, providing library > support for ocamldoc plugins, and it does not seem to exist -- it seems > that the preferred way to use ocamldoc plugins is to use "ocamldoc.opt -g > foo.cmxs", with ocamldoc libraries already linked inside ocamldoc.opt. So > just using > > ocamlbuild -cflags -I,+ocamldoc test.cmxs > > works and > seems to do what you expect. > > It goes without saying that this is not a > perfect long-term solution, as it assumes that ocamldoc libraries are > distributed with the stdlib. It would be cleaner to have an ocamldoc > package for them (just like ocamlbuild has a dummy ocamlfind package > indicating the location of its library files), but it seems that this is > not currently the case. It would be nice (but not super-high priority) to > have such a dummy package in ocamlfind in the future, so that you can just > do > > ocamlbuild -use-ocamlfind -package ocamldoc test.cmxs > > =C2=B9= : The > most time-consuming part was finding the code of a ocamldoc plugin to > compile, as the documentation examples are incomplete. Next time, feel fr= ee > to provide a tarball with a minimal example to reproduce. > > On Fri, Dec > 18, 2015 at 5:14 PM, Arma=C3=ABl Gu=C3=A9neau > wrote: > > Hi list, > > I'm > wondering how one should compile ocamldoc custom generators using > > ocamlbuild. > > First, the ocamlbuild manual > ( > https://github.com/gasche/manual-ocamlbuild/blob/master/manual.md#basic-t= ags-) > > says that the [use_ocamldoc] tag is deprecated; and that a > corresponding > ocamlfind package should be used instead. Is there su= ch > a package for ocamldoc? > I did not found one. > > Then, I did not > manage to build the plugin into .cma/.cmxs files directly using > > ocamlbuild. My command line was something along these lines: > > > ocamlbuild -use-ocamlfind -tag use_ocamldoc -package compiler-libs > plugin.cmxs > > When trying to build plugin.cma/plugin.cmxs, ocamlbui= ld > complained that "Cannot > find file ocamldoc.cma/ocamldoc.cmxa" > (respectively). However, I can build > plugin.cmo/plugin.cmx using the > same command line, then create the .cma/.cmxs > manually using > ocamlc/ocamlopt - which I ended up doing. > > Is there a better way to > do so? If the whole process can be improved (how?), I > would be happy > to write the required patches/documentation. > > =E2=80=94 Arma=C3=AB= l > > > > > --001a1140a722b7f2bd0527330875 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
There is no ocamldoc.cm= {,x}a in=C2=A0 ocamldoc libraries today. We could probably change ocamldoc&= #39;s build system to build one, but for now an ocamldoc package would have= no archive(...) field, just the directory. It is not clear we need an ocamldoc.cm{,x}a archive if all plugins are = to be passed to ocamldoc{,.opt} which is already linked with ocamldoc modul= es.

On F= ri, Dec 18, 2015 at 8:14 PM, Arma=C3=ABl Gu=C3=A9neau <= ;armael.gue= neau@ens-lyon.fr> wrote:
=20=20 =20=20=20=20 =20=20
Ok, thanks for the explanations.

As for the ocamldoc package, would a META file along these lines do the trick?

# Specification for the "ocamldoc" library
requires =3D "compiler-libs"
version =3D "[distributed with Ocaml]"
description =3D "ocamldoc support library"
directory=3D "^ocamldoc"
archive(byte) =3D "ocamldoc.cma"
archive(native) =3D "ocamldoc.cmxa"

Le 18/12/2015 18:06, Gabriel Scherer a =C3=A9crit :
> So I just tried=C2=B9, and th= e failure is as follows: > > $ ocamlbuild -tag use_ocamldoc test.cmxs > + /home/gasche/.opam/4.02.3/bin/ocamlopt.opt -shared -I +ocamldoc ocam= ldoc.cmxa test.cmx -o test.cmxs > File "_none_", line 1: > Error: Cannot find file ocamldoc.cmxa > > It looks like the tag use_ocamldoc expects a file ocamldoc.cmxa to exi= st, providing library support for ocamldoc plugins, and it does not seem to= exist -- it seems that the preferred way to use ocamldoc plugins is to use= "ocamldoc.opt -g foo.cmxs", with ocamldoc libraries already link= ed inside ocamldoc.opt. So just using > >=C2=A0=C2=A0 ocamlbuild -cflags -I,+ocamldoc test.cmxs > > works and seems to do what you expect. > > It goes without saying that this is not a perfect long-term solution, = as it assumes that ocamldoc libraries are distributed with the stdlib. It w= ould be cleaner to have an ocamldoc package for them (just like ocamlbuild = has a dummy ocamlfind package indicating the location of its library files)= , but it seems that this is not currently the case. It would be nice (but n= ot super-high priority) to have such a dummy package in ocamlfind in the fu= ture, so that you can just do > >=C2=A0=C2=A0 ocamlbuild -use-ocamlfind -package ocamldoc test.cmxs > > =C2=B9: The most time-consuming part was finding the code of a ocamldo= c plugin to compile, as the documentation examples are incomplete. Next tim= e, feel free to provide a tarball with a minimal example to reproduce. > > On Fri, Dec 18, 2015 at 5:14 PM, Arma=C3=ABl Gu=C3=A9neau <armael.gueneau@ens-= lyon.fr> wrote: > >=C2=A0=C2=A0=C2=A0=C2=A0 Hi list, > >=C2=A0=C2=A0=C2=A0=C2=A0 I'm wondering how one should compile ocaml= doc custom generators using >=C2=A0=C2=A0=C2=A0=C2=A0 ocamlbuild. > >=C2=A0=C2=A0=C2=A0=C2=A0 First, the ocamlbuild manual >=C2=A0=C2=A0=C2=A0=C2=A0 (https://githu= b.com/gasche/manual-ocamlbuild/blob/master/manual.md#basic-tags-) >=C2=A0=C2=A0=C2=A0=C2=A0 says that the [use_ocamldoc] tag is deprecated= ; and that a corresponding >=C2=A0=C2=A0=C2=A0=C2=A0 ocamlfind package should be used instead. Is t= here such a package for ocamldoc? >=C2=A0=C2=A0=C2=A0=C2=A0 I did not found one. > >=C2=A0=C2=A0=C2=A0=C2=A0 Then, I did not manage to build the plugin int= o .cma/.cmxs files directly using >=C2=A0=C2=A0=C2=A0=C2=A0 ocamlbuild. My command line was something alon= g these lines: > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ocamlbuild -use-ocamlfind -t= ag use_ocamldoc -package compiler-libs plugin.cmxs > >=C2=A0=C2=A0=C2=A0=C2=A0 When trying to build plugin.cma/plugin.cmxs, o= camlbuild complained that "Cannot >=C2=A0=C2=A0=C2=A0=C2=A0 find file ocamldoc.cma/ocamldoc.cmxa" (re= spectively). However, I can build >=C2=A0=C2=A0=C2=A0=C2=A0 plugin.cmo/plugin.cmx using the same command l= ine, then create the .cma/.cmxs >=C2=A0=C2=A0=C2=A0=C2=A0 manually using ocamlc/ocamlopt - which I ended= up doing. > >=C2=A0=C2=A0=C2=A0=C2=A0 Is there a better way to do so? If the whole p= rocess can be improved (how?), I >=C2=A0=C2=A0=C2=A0=C2=A0 would be happy to write the required patches/d= ocumentation. > >=C2=A0=C2=A0=C2=A0=C2=A0 =E2=80=94 Arma=C3=ABl > >



--001a1140a722b7f2bd0527330875--