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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 1D1067EF29 for ; Fri, 18 Dec 2015 20:14:37 +0100 (CET) IronPort-PHdr: 9a23:21b20BA+DYcbdURnh3FPUyQJP3N1i/DPJgcQr6AfoPdwSP7zocbcNUDSrc9gkEXOFd2CrakU1ayO6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6MyZzvn8mJuLTtICxwzAKnZr1zKBjk5S7wjeIxxbVYF6Aq1xHSqWFJcekFjUlhJFaUggqurpzopM0r221qtvkg789NV7nhN+R9FOQATWduD2dgy8ThrxjOSUO07XsRSGgM2k5HCgLf7Rz+GIz6sibgu/BV1yyTPMmwRrcxD2eM9aBuHTbyjS6EMwkW7eDRh8VtxPZSuheoqhg5zJPZZoycKdJzeLiYecIdQyxPRJACBGR6HoqgYt5XXKI6NuFCoty4/gNWoA== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=armael.gueneau@ens-lyon.fr; spf=Pass smtp.mailfrom=armael.gueneau@ens-lyon.fr; spf=None smtp.helo=postmaster@labbe.ens-lyon.fr Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of armael.gueneau@ens-lyon.fr) identity=pra; client-ip=140.77.167.222; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="armael.gueneau@ens-lyon.fr"; x-sender="armael.gueneau@ens-lyon.fr"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of armael.gueneau@ens-lyon.fr designates 140.77.167.222 as permitted sender) identity=mailfrom; client-ip=140.77.167.222; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="armael.gueneau@ens-lyon.fr"; x-sender="armael.gueneau@ens-lyon.fr"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@labbe.ens-lyon.fr) identity=helo; client-ip=140.77.167.222; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="armael.gueneau@ens-lyon.fr"; x-sender="postmaster@labbe.ens-lyon.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CrAACXWnRWnN6nTYxehAxtvWaBYyOFagKBPDoSAQEBAQEBAQEQAQEBAQEGDQkJIS6CLYIIAQEEI1UBEAkCGAkWCwICCQMCAQIBRQYNBgIBAReIFAQKjkCdNpFbAQEBAQEFAQEBAQEaBIpOgQaHd4FJBZZ/hTuRNZQBAikGgkYWB4FXcYUZAQEB X-IPAS-Result: A0CrAACXWnRWnN6nTYxehAxtvWaBYyOFagKBPDoSAQEBAQEBAQEQAQEBAQEGDQkJIS6CLYIIAQEEI1UBEAkCGAkWCwICCQMCAQIBRQYNBgIBAReIFAQKjkCdNpFbAQEBAQEFAQEBAQEaBIpOgQaHd4FJBZZ/hTuRNZQBAikGgkYWB4FXcYUZAQEB X-IronPort-AV: E=Sophos;i="5.20,447,1444687200"; d="scan'208,217";a="193037110" Received: from labbe.ens-lyon.fr ([140.77.167.222]) by mail2-smtp-roc.national.inria.fr with ESMTP; 18 Dec 2015 20:14:36 +0100 Received: from localhost (localhost [127.0.0.1]) by labbe.ens-lyon.fr (Postfix) with ESMTP id 35A98320597; Fri, 18 Dec 2015 20:14:36 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.10.1 (20141025) (Debian) at ens-lyon.fr Received: from labbe.ens-lyon.fr ([127.0.0.1]) by localhost (labbe.ens-lyon.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u0kmI2_DE8TX; Fri, 18 Dec 2015 20:14:35 +0100 (CET) Received: from [192.168.0.13] (rab81-1-78-217-174-105.fbx.proxad.net [78.217.174.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by labbe.ens-lyon.fr (Postfix) with ESMTPSA id DA435320596; Fri, 18 Dec 2015 20:14:34 +0100 (CET) To: Gabriel Scherer References: <567430DC.6020009@ens-lyon.fr> Cc: caml users , Gerd Stolpmann From: =?UTF-8?Q?Arma=c3=abl_Gu=c3=a9neau?= Message-ID: <56745B1C.7090904@ens-lyon.fr> Date: Fri, 18 Dec 2015 20:14:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------080503050404090107000408" Subject: Re: [Caml-list] OCamldoc plugins & ocamlbuild This is a multi-part message in MIME format. --------------080503050404090107000408 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 = "compiler-libs" version = "[distributed with Ocaml]" description = "ocamldoc support library" directory= "^ocamldoc" archive(byte) = "ocamldoc.cma" archive(native) = "ocamldoc.cmxa" Le 18/12/2015 18:06, Gabriel Scherer a écrit : > So I just tried¹, 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 > > ¹: The most time-consuming part was finding the code of a ocamldoc plugin to compile, as the documentation examples are incomplete. Next time, feel free to provide a tarball with a minimal example to reproduce. > > On Fri, Dec 18, 2015 at 5:14 PM, Armaël Guéneau 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-tags-) > says that the [use_ocamldoc] tag is deprecated; and that a corresponding > ocamlfind package should be used instead. Is there such 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, ocamlbuild 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. > > — Armaël > > --------------080503050404090107000408 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit 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 = "compiler-libs"
version = "[distributed with Ocaml]"
description = "ocamldoc support library"
directory= "^ocamldoc"
archive(byte) = "ocamldoc.cma"
archive(native) = "ocamldoc.cmxa"

Le 18/12/2015 18:06, Gabriel Scherer a écrit :
> So I just tried¹, 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 > > ¹: The most time-consuming part was finding the code of a ocamldoc plugin to compile, as the documentation examples are incomplete. Next time, feel free to provide a tarball with a minimal example to reproduce. > > On Fri, Dec 18, 2015 at 5:14 PM, Armaël Guéneau <armael.gueneau@ens-lyon.fr> 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-tags-) >     says that the [use_ocamldoc] tag is deprecated; and that a corresponding >     ocamlfind package should be used instead. Is there such 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, ocamlbuild 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. > >     — Armaël > >


--------------080503050404090107000408--