From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 00A077EF29 for ; Fri, 18 Dec 2015 18:07:19 +0100 (CET) IronPort-PHdr: 9a23:moUUzRxlFZ0ZQBPXCy+O+j09IxM/srCxBDY+r6Qd0eMUIJqq85mqBkHD//Il1AaPBtWFrakZwLuI+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStCU1Jn8hr760qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYCgJ45jCrxzKzg/HyWadVGgfj1IcChLA5Rz+GJjsvy33v/dV1S+BeMnnSrZyVy70vIlxTxq9py4NLT809Cnsgcx9lq9B6EaurhZlwoPQJpqeNPdkc7n1ctYTRG4HVcFUAX8SSrigZpcCWrJSdd1TqJPw8h5X9UOz Authentication-Results: mail2-smtp-roc.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-ig0-f176.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.213.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.213.176 as permitted sender) identity=mailfrom; client-ip=209.85.213.176; receiver=mail2-smtp-roc.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 (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ig0-f176.google.com) identity=helo; client-ip=209.85.213.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ig0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A3AAAJPHRWlLDVVdFeg1g0bQarf4cLikYBDYFiI4VqAoEzBzgUAQEBAQEBAQEQAQEBAQcLCwkfMIItgggBAQMBEhEEGQEbHQEDAQsGBQs3AgIiAREBBQEcBhMbB4d3AQMKCA6de4ExPjGLSIFqgnmIDwoZJw1Wgz8BAQEBAQUBAQEBAQEBARUBBQ6GSIN4gQaFCIJvgUkFln+FO4gPgiWZNxIkgRcRDwEBgkYNFgeBVz00AYUQAQEB X-IPAS-Result: A0A3AAAJPHRWlLDVVdFeg1g0bQarf4cLikYBDYFiI4VqAoEzBzgUAQEBAQEBAQEQAQEBAQcLCwkfMIItgggBAQMBEhEEGQEbHQEDAQsGBQs3AgIiAREBBQEcBhMbB4d3AQMKCA6de4ExPjGLSIFqgnmIDwoZJw1Wgz8BAQEBAQUBAQEBAQEBARUBBQ6GSIN4gQaFCIJvgUkFln+FO4gPgiWZNxIkgRcRDwEBgkYNFgeBVz00AYUQAQEB X-IronPort-AV: E=Sophos;i="5.20,447,1444687200"; d="scan'208";a="193023649" Received: from mail-ig0-f176.google.com ([209.85.213.176]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 18 Dec 2015 18:07:17 +0100 Received: by mail-ig0-f176.google.com with SMTP id to4so40994314igc.0 for ; Fri, 18 Dec 2015 09:07:17 -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=fYkQdXYjCZBIoNFkc8Qj/SzliETCjUOWRwwOwP9GlQg=; b=kUNfoZIpRbTi1ZXLqIA4Pf/0HhPL5MP/aF19i53rKYG5LEYM521ophxArVSpQNnUCi //AOoFwW7G77kaEMylXsk4CaTW5iENSHZjlcS7o8u6kp/XYhtr+mMmxttuCI2ln35mat YgGdO4vXu7Omu631M4sfgdO4DnqpWdr1aOJ70rfG5JA6JjQyU6JdexCJdZsf+f3M7xi+ mBu/e4t980Z/iR3zzlIRFoi/OaABXX6hUiWrfOE1BhZjySC0JvlcLr8Nq4QjTbUDTh40 ytbc6JiPE0vnkZIk6BpRLRWQGFi4GHSj8ZwWUWgwUdCdIxLlvhbv0cTspmKffOBwG1Ns jABg== X-Received: by 10.50.55.4 with SMTP id n4mr4280085igp.37.1450458436944; Fri, 18 Dec 2015 09:07:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.27.205 with HTTP; Fri, 18 Dec 2015 09:06:37 -0800 (PST) In-Reply-To: <567430DC.6020009@ens-lyon.fr> References: <567430DC.6020009@ens-lyon.fr> From: Gabriel Scherer Date: Fri, 18 Dec 2015 18:06:37 +0100 Message-ID: To: =?UTF-8?B?QXJtYcOrbCBHdcOpbmVhdQ==?= Cc: caml users , Gerd Stolpmann Content-Type: multipart/alternative; boundary=e89a8f3b9b49e561fc05272f2b9d Subject: Re: [Caml-list] OCamldoc plugins & ocamlbuild --e89a8f3b9b49e561fc05272f2b9d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 plu= gin 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=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 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. > > =E2=80=94 Arma=C3=ABl > > --e89a8f3b9b49e561fc05272f2b9d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
So I just tried=C2=B9, and the fa= ilure is as follows:

$ ocamlbuild -tag use_ocamldoc test.cmxs
+ /= home/gasche/.opam/4.02.3/bin/ocamlopt.opt -shared -I +ocamldoc ocamldoc.cmx= a test.cmx -o test.cmxs
File "_none_", line 1:
Error: Canno= t find file ocamldoc.cmxa

It looks like the tag use_ocamldoc e= xpects a file ocamldoc.cmxa to exist, providing library support for ocamldo= c 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", wi= th ocamldoc libraries already linked inside ocamldoc.opt. So just using
=
=C2=A0 ocamlbuild -cflags -I,+ocamldoc test.cmxs

wor= ks and seems to do what you expect.

It goes without saying tha= t this is not a perfect long-term solution, as it assumes that ocamldoc lib= raries are distributed with the stdlib. It would be cleaner to have an ocam= ldoc package for them (just like ocamlbuild has a dummy ocamlfind package i= ndicating 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
=C2=A0 ocamlbuild -use-ocamlfind -package ocamldoc test.cmxs

=C2=B9: The most time-consuming par= t was finding the code of a ocamldoc plugin to compile, as the documentatio= n examples are incomplete. Next time, feel free to provide a tarball with a= minimal example to reproduce.

On Fri, De= c 18, 2015 at 5:14 PM, Arma=C3=ABl Gu=C3=A9neau <armael.gueneau@e= ns-lyon.fr> wrote:
=20=20 =20=20=20=20 =20=20
Hi list,

I'm wondering how one should compile ocamldoc custom generators using
ocamlbuild.

First, the ocamlbuild manual
(h= ttps://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:

=C2=A0=C2=A0 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 c= an 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=ABl


--e89a8f3b9b49e561fc05272f2b9d--