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 D696B7FCCB for ; Mon, 13 Apr 2015 21:27:25 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ivg@ieee.org) identity=pra; client-ip=209.85.218.49; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="ivg@ieee.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of ivg@ieee.org designates 209.85.218.49 as permitted sender) identity=mailfrom; client-ip=209.85.218.49; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="ivg@ieee.org"; 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-oi0-f49.google.com) identity=helo; client-ip=209.85.218.49; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="postmaster@mail-oi0-f49.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CeAgCKFyxVnDHaVdFcg15cAQSDELApBoMMK41uM4FOhgECgTUHORMBAQEBAQEBEQEBAQEBBg0JCRQuhB8BAQEDARIRBEcLBQsLCw0NHQICIhIBBQEKEgYTCAoQh3QDCQgNqns+MYs4kHADhScBAQEBAQEBAwEBAQEBARwKhgaFG4QqAQFMBAeCaIFFBYUSCo9pgiyDaoEdOo9IggMSI4EVgX2CMCIxgQuBOAEBAQ X-IPAS-Result: A0CeAgCKFyxVnDHaVdFcg15cAQSDELApBoMMK41uM4FOhgECgTUHORMBAQEBAQEBEQEBAQEBBg0JCRQuhB8BAQEDARIRBEcLBQsLCw0NHQICIhIBBQEKEgYTCAoQh3QDCQgNqns+MYs4kHADhScBAQEBAQEBAwEBAQEBARwKhgaFG4QqAQFMBAeCaIFFBYUSCo9pgiyDaoEdOo9IggMSI4EVgX2CMCIxgQuBOAEBAQ X-IronPort-AV: E=Sophos;i="5.11,571,1422918000"; d="scan'208";a="134203541" Received: from mail-oi0-f49.google.com ([209.85.218.49]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 13 Apr 2015 21:27:24 +0200 Received: by oica37 with SMTP id a37so12705364oic.0 for ; Mon, 13 Apr 2015 12:27:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=AEjzYB7r8NyEZsOoXc2JCPHlnqycWmAGF660DWmdrAQ=; b=CN+K6k4OX3eskY3INW7Gpk7lVEvkb7GsjIVcd7d/7YkMziBM+iMfExp7oraf2Ux19z UP9ape1TVsOldddfnOqiymoVdTHJikSROTTjxVcok6rNa93h+Qf+0raIeXu5goA3gY/t BRnJJCGrG+2dHq3qbpIJAzc5xZZ5zC1i9h4iF/ugkvpyL2Pezgh122RaEu3UfLN6CnUT T19O9XQ2dykADGCfpuZ3PZNCY8zsCsfng94pcFZQZjaip+OgOgAV9C39rVcKLdsoCcKf ieCNHz/moZQ80GwtEExZWz3sze5K4qvof+ZyRNMYnH168JJOqHcOO3fvC35AvCs8mx6b VraQ== X-Gm-Message-State: ALoCoQlrPF94ZGY9r778dR3VulwKCVVLo7+r5/DLILJ+Wu+dLO0lZnTUO3CmdiAkmzASXFf3GaSI MIME-Version: 1.0 X-Received: by 10.182.107.131 with SMTP id hc3mr13367397obb.68.1428953243251; Mon, 13 Apr 2015 12:27:23 -0700 (PDT) Received: by 10.202.85.76 with HTTP; Mon, 13 Apr 2015 12:27:23 -0700 (PDT) In-Reply-To: <54F6D731.3090004@cea.fr> References: <54F5B3F7.3030705@cea.fr> <1425394551.4056.1.camel@thinkpad.lan.sumadev.de> <54F6D731.3090004@cea.fr> Date: Mon, 13 Apr 2015 15:27:23 -0400 Message-ID: From: Ivan Gotovchits To: =?UTF-8?Q?Fran=C3=A7ois_Bobot?= Cc: Gerd Stolpmann , OCaml Mailing List Content-Type: multipart/alternative; boundary=089e01293fae7715760513a01aa7 Subject: Re: [Caml-list] Dependencies between plugins --089e01293fae7715760513a01aa7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Are there any movement in this direction, or this patches will die? On Wed, Mar 4, 2015 at 4:58 AM, Fran=C3=A7ois Bobot wrote: > On 03/03/2015 15:55, Gerd Stolpmann wrote: > >> Am Dienstag, den 03.03.2015, 14:15 +0100 schrieb Fran=C3=A7ois Bobot: >> >>> Gerd, do you think that something that does that could be added to >>> ocamlfind? One tricky thing is to >>> know the library statically linked (ie. `Ocsigen_config.builtin_package= s`), >>> perhaps ocamlfind can >>> during linking add this information. >>> >> >> I think so. For toploops, there is already code that tracks libraries >> already linked into the executable (i.e. if you ocamlmktop your >> toploop). >> > > All was already in place indeed! It was easy to add. I kept caml-list in > CC for discussing the big picture in order to get comments from people. Is > mail still your preferred way of receiving patch? > > I kept it simple, no hack (no automatic: cmxa -> cmxs) because I prefer > problems in library META to be found than to be paper over. > > The first patch adds: > - A library `findlib.dynlink` that depends on `findlib` and `dynlink` > - During linking (using `ocamlfind ocaml*`) if `-package findlib.dynlink` > and `-linkpkg` are used then a module `Findlib_initl...` is linked after > all packages and it stores the names of packages linked in > `Findlib.linked_packages`. > - In the main program `Fl_dynlink.load_packages ["yojson"]` can be used to > dynlink packages > > The second patch forbids to run `Fl_dynlink.load_packages` during the > initialization of packages (statically or dynamically linked), because > `Findlib_initl...` is not yet run and because if you want to load a packa= ge > that depend on a statically linked package not yet initialized, there is = no > sane semantic. > > Problems: > - The package is named `findlib.dynlink`, the archive `findlib_dynlink.cm= *` > and the module `Fl_dynlink` ... > - If you don't use `-linkall` static packages could only be partially > linked, and you can't link the remaining part later. So perhaps `-linkall` > must be automatically added if `findlib.dynlink` is used. > - If you define `archive(native)` and not `archive(native,plugin)` the > error is not nice (in Dynlink.Error). Perhaps I should add a > `Package_not_dynamically_loadable of string` error, that should catch the > loading of something else than `*.cmxs`. > - Often you link your binary with your own library without using > `-package` (the library is not yet installed), and plugins for your tools > depend on your library. Currently you should do before any > `Fl_dynlink.load_packages`: `Findlib.linked_packages :=3D > "mylib"::Findlib.linked_packages`. For simplicity, I don't know if I > should add a function `Fl_dynlink.add_linked_packages`, or an option to > ocamlfind `-additional-package-statically-linked `. > - During the initialization of your own library (linked without -package) > you should not use `Fl_dynlink.load_packages`, but the library doesn't > protect you against this error. > > Choices: > - If you don't link with `findlib.dynlink` or use `create_toploop`, the > variables `Findlib.linked_packages` and `Findlib.linked_predicates` are > empty because I don't wanted to add backward change by adding > `Findlib_initl...` when `findlib` is linked. > > > Remains to do: > - Fix problems > - Documentations (add `plugin` in the list of standard predicates, ...) > > > Gerg, what do you think of this first version of the patch? Of the way to > fix the problems? > > Thanks, > > > Regards, > > -- > Fran=C3=A7ois > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --089e01293fae7715760513a01aa7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Are there any movement in this direction, or this patches = will die?

On= Wed, Mar 4, 2015 at 4:58 AM, Fran=C3=A7ois Bobot <francois.bobot@cea.= fr> wrote:
On 03/03/2015 15:55, Gerd Stolpmann wrote:
Am Dienstag, den 03.03.2015, 14:15 +0100 schrieb Fran=C3=A7ois Bobot:
Gerd, do you think that something that does that could be added to ocamlfin= d? One tricky thing is to
know the library statically linked (ie. `Ocsigen_config.builtin_pack= ages`), perhaps ocamlfind can
during linking add this information.

I think so. For toploops, there is already code that tracks libraries
already linked into the executable (i.e. if you ocamlmktop your
toploop).

All was already in place indeed! It was easy to add. I kept caml-list in CC= for discussing the big picture in order to get comments from people. Is ma= il still your preferred way of receiving patch?

I kept it simple, no hack (no automatic: cmxa -> cmxs) because I prefer = problems in library META to be found than to be paper over.

The first patch adds:
- A library `findlib.dynlink` that depends on `findlib` and `dynlink`
- During linking (using `ocamlfind ocaml*`) if `-package findlib.dynlink` a= nd `-linkpkg` are used then a module `Findlib_initl...` is linked after all= packages and it stores the names of packages linked in `Findlib.linked_pac= kages`.
- In the main program `Fl_dynlink.load_packages ["yojson"]` can b= e used to dynlink packages

The second patch forbids to run `Fl_dynlink.load_packages` during the initi= alization of packages (statically or dynamically linked), because `Findlib_= initl...` is not yet run and because if you want to load a package that dep= end on a statically linked package not yet initialized, there is no sane se= mantic.

Problems:
- The package is named `findlib.dynlink`, the archive `findlib_dynlink.cm*` and the module= `Fl_dynlink` ...
- If you don't use `-linkall` static packages could only be partially l= inked, and you can't link the remaining part later. So perhaps `-linkal= l` must be automatically added if `findlib.dynlink` is used.
- If you define `archive(native)` and not `archive(native,plugin)` the erro= r is not nice (in Dynlink.Error). Perhaps I should add a `Package_not_dynam= ically_loadable of string` error, that should catch the loading of s= omething else than `*.cmxs`.
- Often you link your binary with your own library without using `-package`= (the library is not yet installed), and plugins for your tools depend on y= our library. Currently you should do before any `Fl_dynlink.load_packages`:= `Findlib.linked_packages :=3D "mylib"::Findlib.linked_pac= kages`. For simplicity, I don't know if I should add a function `Fl_dyn= link.add_linked_packages`, or an option to ocamlfind `-additional-pa= ckage-statically-linked `.
- During the initialization of your own library (linked without -package) y= ou should not use `Fl_dynlink.load_packages`, but the library doesn't p= rotect you against this error.

Choices:
- If you don't link with `findlib.dynlink` or use `create_toploop`, the= variables `Findlib.linked_packages` and `Findlib.linked_predicates` are em= pty because I don't wanted to add backward change by adding `Findlib_in= itl...` when `findlib` is linked.


Remains to do:
- Fix problems
- Documentations (add `plugin` in the list of standard predicates, ...)


Gerg, what do you think of this first version of the patch? Of the way to f= ix the problems?

Thanks,


Regards,

--
Fran=C3=A7ois

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners<= /a>
Bug reports:
http://caml.inria.fr/bin/caml-bugs

--089e01293fae7715760513a01aa7--