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 5799B7FCCB for ; Tue, 14 Apr 2015 14:45:52 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of francois.bobot@cea.fr) identity=pra; client-ip=132.167.192.145; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="francois.bobot@cea.fr"; x-sender="francois.bobot@cea.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of francois.bobot@cea.fr) identity=mailfrom; client-ip=132.167.192.145; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="francois.bobot@cea.fr"; x-sender="francois.bobot@cea.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@sainfoin-out.extra.cea.fr) identity=helo; client-ip=132.167.192.145; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="francois.bobot@cea.fr"; x-sender="postmaster@sainfoin-out.extra.cea.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CIAQCoCy1VnJHAp4Rcg15cxzyFQT4CgUE8EAEBAQEBAQERAQEBAQEICwkJFC6EHwEBAQMBMgEFQAEQCxgJFg8JAwIBAgFFBg0BBwIXiAcIDcspAQEBAQEBAQMBAQEBAQEBARYEiyuCZoIWB4QtBZUHjTCNVIQTbQWCPgEBAQ X-IPAS-Result: A0CIAQCoCy1VnJHAp4Rcg15cxzyFQT4CgUE8EAEBAQEBAQERAQEBAQEICwkJFC6EHwEBAQMBMgEFQAEQCxgJFg8JAwIBAgFFBg0BBwIXiAcIDcspAQEBAQEBAQMBAQEBAQEBARYEiyuCZoIWB4QtBZUHjTCNVIQTbQWCPgEBAQ X-IronPort-AV: E=Sophos;i="5.11,576,1422918000"; d="scan'208";a="111024427" Received: from sainfoin-out.extra.cea.fr ([132.167.192.145]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Apr 2015 14:45:51 +0200 Received: from pisaure.intra.cea.fr (pisaure.intra.cea.fr [132.166.88.21]) by sainfoin.extra.cea.fr (8.14.2/8.14.2/CEAnet-Internet-out-2.3) with ESMTP id t3ECjpT5008616; Tue, 14 Apr 2015 14:45:51 +0200 Received: from pisaure.intra.cea.fr (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id D856820C7B1; Tue, 14 Apr 2015 14:47:03 +0200 (CEST) Received: from muguet2.intra.cea.fr (muguet2.intra.cea.fr [132.166.192.7]) by pisaure.intra.cea.fr (Postfix) with ESMTP id CBAB620CB55; Tue, 14 Apr 2015 14:47:03 +0200 (CEST) Received: from [10.8.32.80] (is222783.intra.cea.fr [10.8.32.80]) by muguet2.intra.cea.fr (8.13.8/8.13.8/CEAnet-Intranet-out-1.2) with ESMTP id t3ECjonQ012076; Tue, 14 Apr 2015 14:45:50 +0200 Message-ID: <552D0BFE.7000904@cea.fr> Date: Tue, 14 Apr 2015 14:45:50 +0200 From: =?ISO-8859-15?Q?Fran=E7ois_Bobot?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: =?ISO-8859-15?Q?St=E9phane_Glondu?= CC: OCaml Mailing List References: <54F5B3F7.3030705@cea.fr> <1425394551.4056.1.camel@thinkpad.lan.sumadev.de> <54F6D731.3090004@cea.fr> <1428953391.22412.40.camel@e130.lan.sumadev.de> <552CD705.9000508@cea.fr> <552CE242.9050307@glondu.net> In-Reply-To: <552CE242.9050307@glondu.net> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Dependencies between plugins On 14/04/2015 11:47, Stéphane Glondu wrote: > Le 14/04/2015 10:59, François Bobot a écrit : >>>> Are there any movement in this direction, or this patches will die? >>> >>> Don't think so. Slowness on my side. >> >> On my side, I haven't yet written the documentation. My main impediment >> is to choose which predicates to use for the cmxs in the META file: >> 1) to keep archive(plugin,native) because it is the defacto standard >> 2) to move to something that is semantically right: >> archive(native_plugin) or archive(shared). > > Sorry, I didn't follow the whole discussion but... this looks like > hardcoding a special treatment of plugins for the native case, > forgetting the bytecode case. Would you introduce byte_plugin (or a > bytecode counterpart to "shared" which looks bad to me) as well? The fact is that native and bytecode are not symmetric: | byte | native static link | cmo | cmx dynamic link | cmo | cmxs So for bytecode we can still use `archive(byte)`. If someone wants its library to be loaded differently in static linking and dynamic linking e can use `archive(byte,plugin)`. You are right that I should give a full proposal (I'm going to go with `shared` instead of `native_plugin` because it is short and correspond to the ocamlopt option): 1. In META file: 1.1 use `archive(byte)` and `archive(native)` for the files to statically link 1.2 use `archive(byte,plugin)` for the files to dynamically link in bytecode if they are different from the static one 1.3 use `archive(shared)` for the files that are dynamically linked in native code 2. During dynamic loading: 2.1. in bytecode: look for variable `archive` with predicates `byte`,`plugin` and the other predicates used during compilation (`mt`, `mt_posix`, `mt_vm`, `gprof`, ...) 2.2 in native: look for variable `archive` with predicates `shared`, `plugin` and the other predicates used during static linking except `native` My goal is just that when you ask in native code "Does this library define files for dynamic linking" the answer is not "yes, it defines these cmx". There are other solutions (like asking that file to statically link are define with `archive(native,-plugin)`) but they seem to be less conservative. > Even > code using Dynlink should be as generic (w.r.t. native/bytecode) as > possible... The examples of tools that use dependencies between plugins gathered at the start of the discussion are already not generic (w.r.t. native/bytecode) : The following code makes a differences between bytecode and native code: https://github.com/ocsigen/ocsigenserver/blob/master/src/baselib/ocsigen_loader.ml#L165 https://github.com/zoggy/stog/blob/e83c363c83465a7bfd1595816b3d9bc8331af560/stog_dyn.ml#L119-L146 This one works only for native code, it seems: https://github.com/hammerlab/ketrew/blob/master/src/lib/pure/ketrew_plugin.ml#L52 The proposed modification is to replace (for example in ocsigen): ```ocaml (if Ocsigen_config.is_native then "native" else "byte") ``` by ```ocaml (if Ocsigen_config.is_native then "shared" else "byte") ``` -- François