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 c5ff346549e7 (Postfix) with ESMTPS id CF9BA5D6 for ; Thu, 15 Aug 2019 06:27:06 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.64,388,1559512800"; d="scan'208";a="395461701" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 15 Aug 2019 08:27:05 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 9A8F67EF07; Thu, 15 Aug 2019 08:27:05 +0200 (CEST) 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 D02517EF07 for ; Thu, 15 Aug 2019 08:26:57 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jocelyn.serot@uca.fr; spf=Pass smtp.mailfrom=jocelyn.serot@uca.fr; spf=None smtp.helo=postmaster@mta02.udamail.fr IronPort-PHdr: =?us-ascii?q?9a23=3A0XV69RSPUv2DAXwIg9WYh7dScdpsv+yvbD5Q0YIu?= =?us-ascii?q?jvd0So/mwa69YByN2/xhgRfzUJnB7Loc0qyK6vqmADdYqsnd+Fk5M7V0Hycfjs?= =?us-ascii?q?sXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6?= =?us-ascii?q?KfroEYDOkcu3y/qy+5rOaAlUmTaxe7x/IAiooQnLq8Ubj5duJqkzxxbGv3BFZ/?= =?us-ascii?q?lYyWR0KFyJgh3y/N2w/Jlt8yRRv/Iu6ctNWrjkcqo7ULJVEi0oP3g668P3uxbD?= =?us-ascii?q?SxCP5mYHXWUNjhVIGQnF4wrkUZr3ryD3q/By2CiePc3xULA0RTGv5LplRRP0lC?= =?us-ascii?q?sKMSMy/WfKgcJyka1bugqsqABwzIDJYI+aNvRwcKzec9MUW2RPWd1cVzBYAoO5?= =?us-ascii?q?c4cPD/YNMOZeooLgp1UOtxy+BQy0Ce3rzT9HmmH53ak60uQnCQ7IwRYnH8gJsH?= =?us-ascii?q?TIsd74M6USUeepw6bWyTXCb/VW1S3m6IfWaBAhpu2MUKltccXN00YjDQ3Fjk+J?= =?us-ascii?q?pIHjIjib1fwNvnCG4+dkW++jkWEqpgVrrjSy28shiJPFipwIxlzc9ih0w5w5Kc?= =?us-ascii?q?C5RUN0e9KpFIVcuzuEO4Z2Xs8vRXxjtjwgxb0co5G7eTAHyJQ5yB7bbPyKa42I?= =?us-ascii?q?4g75W+qNPzt0nm9ld6+liBa360egy+n8WtO60FZQtiZFk9/MuW4R1xHL98SKTv?= =?us-ascii?q?Vw8l2u1DuLzQzf9/xILEIumabFNpIt2rswmYASsUTHEC/2gkL2jKqOe0Um/ein?= =?us-ascii?q?9/roYrHmp5+aLYN0kR/xMr4pmsyjGuk4LxQBUHKB9eSyzr3v5Vf5T6lSjv0qjq?= =?us-ascii?q?nZt4jXKtgBqa68Bw9Zy4Ij6xekDze6y9kYhnkGLFddeB2dlYTpOlfOIOr5Dfil?= =?us-ascii?q?mVisni1rlLj6OejKC5DJZl3KkbPge7l56lVAgF44xNVbopZVEa0pIfTpW0a3us?= =?us-ascii?q?aOXTEjNAnh4eHsBdFs0LQl2HiIHufNMqTZvFuZ4KQ0LvOLeKcIsz+7JeJztK2m?= =?us-ascii?q?tmMwhVJIJfrh5pAQcn3tRq03cXXcWmLlh5I6KUlPuwM/SOLwj1jSAyNYbjC8Rf?= =?us-ascii?q?Blv2xpOMedFY7GA7uVrvmB0SO8R80EY3xPUgrKDHvhcoyFX7ECcnDKe5Mzonk/?= =?us-ascii?q?TbGkDrQZ+1S2rgaqmadsJ6za4H9AuA=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CACABO+lRdhxV1McFmHAEBAQQBAQcEA?= =?us-ascii?q?QGBZwKBZ4EcA4EBKo0bhhCBaiWDaJckCQEDAQwbFAEBgUuCdAKDDRsHAQQ0EwI?= =?us-ascii?q?EAQEEAQEBBAEDAwQBEwEBAQoLCQgphS4MQgEQAYFmIoJvAQICAUABATgECwtGV?= =?us-ascii?q?wYTGQKDBwGBexMBqUCCJYJ6AQEFgkeEawmBNAGEc4Z1ghaBEScME4FOfj6ERIM?= =?us-ascii?q?9giaMLEGHWJcMBwKBM2yGZIkEhGaCMC+KcCeKSKJNc4JDgS84gXl0TCoBgkEJN?= =?us-ascii?q?YIEGoUWiRc+ATGDTotbAQE?= X-IPAS-Result: =?us-ascii?q?A0CACABO+lRdhxV1McFmHAEBAQQBAQcEAQGBZwKBZ4EcA4E?= =?us-ascii?q?BKo0bhhCBaiWDaJckCQEDAQwbFAEBgUuCdAKDDRsHAQQ0EwIEAQEEAQEBBAEDA?= =?us-ascii?q?wQBEwEBAQoLCQgphS4MQgEQAYFmIoJvAQICAUABATgECwtGVwYTGQKDBwGBexM?= =?us-ascii?q?BqUCCJYJ6AQEFgkeEawmBNAGEc4Z1ghaBEScME4FOfj6ERIM9giaMLEGHWJcMB?= =?us-ascii?q?wKBM2yGZIkEhGaCMC+KcCeKSKJNc4JDgS84gXl0TCoBgkEJNYIEGoUWiRc+ATG?= =?us-ascii?q?DTotbAQE?= X-IronPort-AV: E=Sophos;i="5.64,388,1559512800"; d="scan'208";a="395461693" X-MGA-submission: =?us-ascii?q?MDGnl9bN54vLQ+bNkHSULgpdCNhaetxvB64w3x?= =?us-ascii?q?Qv/aeyPkMpS1wnFM+DMImYPJzhk8Lsyk6qGvLfHZ+mrA2SkWyZyUrKCF?= =?us-ascii?q?aiLMFbpyA+SRWhNsaAI6Fu9F86KTr3FbrCkdCXIyHCKeOequGsHgaAqE?= =?us-ascii?q?vaqcfBrUWu/arTCSVqzn6bHw=3D=3D?= Received: from mta02.udamail.fr ([193.49.117.21]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 08:26:57 +0200 Received: from mta02.udamail.fr (localhost.localdomain [127.0.0.1]) by mta02.udamail.fr (Postfix) with ESMTPS id 468Gh06xZWzBrLT for ; Thu, 15 Aug 2019 08:26:56 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mta02.udamail.fr (Postfix) with ESMTP id 468Gh06JgXzBrMv for ; Thu, 15 Aug 2019 08:26:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 mta02.udamail.fr 468Gh06JgXzBrMv DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uca.fr; s=72FD7F0C-5358-11E8-A3B7-17E0B3BFED1B; t=1565850416; bh=SNObLJOugFeYUZ8N/a6MgqNEaiSYFDuAqNAK7AlOyGg=; h=Mime-Version:From:Date:Message-Id:To; b=mTVHX/qQGZlBtcypZ7OAYYqircrHQRoqMH761RIUNF6SoXvJR2mnzno58n4wC+Avu J7Z9qfp2F1KlMnhUHBHZLB0aEEnx9xz1hqFEN3MVZbNq/WV/cbMFz/x7onydw5WCFl HbJtM2m/iRPNH66p75FGLBQ4f2Ai0VkUGRqsobHk= X-Virus-Scanned: amavisd-new at mta02.udamail.fr Received: from mta02.udamail.fr ([127.0.0.1]) by localhost (mta02.udamail.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id dXvWMthn5XA2 for ; Thu, 15 Aug 2019 08:26:56 +0200 (CEST) Received: from proxy01.udamail.fr (unknown [193.49.117.26]) by mta02.udamail.fr (Postfix) with ESMTPS id 468Gh05hs1zBrLT for ; Thu, 15 Aug 2019 08:26:56 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy01.udamail.fr (Postfix) with ESMTP id 468Gh04z5jzBnBY for ; Thu, 15 Aug 2019 08:26:56 +0200 (CEST) Received: from proxy01.udamail.fr ([127.0.0.1]) by localhost (proxy01.udamail.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id HGYzO7udf_IX for ; Thu, 15 Aug 2019 08:26:55 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy01.udamail.fr (Postfix) with ESMTP id 468Ggz4zm1zBnBw for ; Thu, 15 Aug 2019 08:26:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 proxy01.udamail.fr 468Ggz4zm1zBnBw DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uca.fr; s=72FD7F0C-5358-11E8-A3B7-17E0B3BFED1B; t=1565850415; bh=SNObLJOugFeYUZ8N/a6MgqNEaiSYFDuAqNAK7AlOyGg=; h=Mime-Version:From:Date:Message-Id:To; b=UQSA+gT+KvNZYtbmCmxRacowNywJRD07hQ7hIqIT/6XX7Uvm4v/YR6bjSWmr/skV+ tdNpoVIyQ3xeGOHlPqj11HwDad1Q0qGuQ+HgmqnhrTIciPrte/mjl1BBHeLXJgZTUD riWYzZ683Xgq6AoVPuy9Gu/5J++Z77R0dtWrHfMo= X-Virus-Scanned: amavisd-new at proxy01.udamail.fr Received: from proxy01.udamail.fr ([127.0.0.1]) by localhost (proxy01.udamail.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 6_GbACzVCsJV for ; Thu, 15 Aug 2019 08:26:55 +0200 (CEST) Received: from [192.168.0.42] (lav63-2-88-164-92-250.fbx.proxad.net [88.164.92.250]) by proxy01.udamail.fr (Postfix) with ESMTPSA id 468Ggz2F0dzBnBY for ; Thu, 15 Aug 2019 08:26:55 +0200 (CEST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: =?windows-1252?Q?Jocelyn_S=E9rot?= In-Reply-To: <04bdbadb-82bb-4539-9b42-03ea96e5aabd@www.fastmail.com> Date: Thu, 15 Aug 2019 08:26:57 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <09561F13-3BF9-4978-9984-82962C030488@uca.fr> References: <8D32A371-FD47-434F-928A-C07D002BB712@uca.fr> <04bdbadb-82bb-4539-9b42-03ea96e5aabd@www.fastmail.com> To: Caml Mailinglist X-Mailer: Apple Mail (2.1878.6) Subject: Re: [Caml-list] A (silly ?) question about opam and ocamlfind Reply-To: =?windows-1252?Q?Jocelyn_S=E9rot?= X-Loop: caml-list@inria.fr X-Sequence: 17767 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Thanks for the answer and the =AB historical =BB perspective.=20 In fact, I=92ve started to use dune a few weeks ago and this is a = problem with the transition from a package previously developed with = ocamlfind to dune which triggers my initial question. Anyway, after carefully re-reading the opam and dune documentation, i=92ve= finally fixed the problem. I=92m about to publish a small repository on github summerizing the = solution(s) with the hope that it can be useful to other programmers. Jocelyn Le 14 ao=FBt 2019 =E0 21:08, rixed@happyleptic.org a =E9crit : > Hello! >=20 > The more tools are added on top of each others to make life easier for = newcomers, and the harder it is to understand what's happening. >=20 > So let's get back to the beginning. I'm assuming you know already most = of this but I'd rather give a picture of the whole stack so that you = know which documentation you need to read to learn the details about = various steps. >=20 > OCaml compiler without any other helper tool knows very little about = where to find the files it needs. > Following the tradition, it just knows one directory, where the system = libraries are located. And it takes everything else from the command = line: the inputs (some .ml, .cmx, .cmxa, .o, .a, etc files, some = additional paths where to look for libraries if more are needed), and = the single output (-o somefile). >=20 > You can work only with this, that's very simple, but also quickly = cumbersome as the number of libraries you need grow, each requiring = other libraries and special options for the compiler, recursively. > So at some point, you want a package manager: something that organise = libraries in your local disk with some additional metadata about what = depends on what, so that you only have to say "I want to link with the = foobar, preferably the lwt variant". > This is ocamlfind. To play by the rules, you have to install all the = package in a given directory, with an additional small META file that = contains the dependencies and various options and other meta data such = as a unique name and a description. > If library authors play by the rules and provide that META file and = install their libraries in a standardized manner (which is greatly = simplified by ocamlfind command line tool) then everything become as = easy as `ocamlfind ocamlc -package 'foo bar baz' my_source.ml`. >=20 > This is great and nice, and by and large OCaml library authors have = played by the rules for a very long time now (such a tool, to be = successful, have to be reliable and _stable_ for a long time ; ocamlfind = have been very successful and essential to OCaml popularity, because it = has stayed the same for many years ; thank you so much to its = maintainers to resist the need to break backward compatibility). >=20 > There is still an important annoyance though: for the above to work, = you still need libraries foo, bar and baz to be downloaded, compiled, = and installed on your local machine. For this, you need a standard = package repository. This is OPAM. Opam also have it's small file with = metainfo about each package, except this one is called "opam" (or = "$package.opam") and states where to get the package from, what command = to run to build it, and how to install it. > Sounds familiar? Yes that's exactly what your Linux distribution does, = but it works also on non-linux systems and is also updated much quicker, = as there are less bureaucracy involved (notice it solves a human problem = not a technical problem here). >=20 > There is a bit of redundancy between ocamlfind and opam, because, = despite ocamlfind being used by >90% of packages, opam is ocamlfind = agnostic and can work, in theory, for non-ocamlfind packages (indeed, it = can also be used to deploy about anything not only OCaml packages). So = you have to give names, description, dependencies both to ocamlfind and = opam. > But that's only a minor annoyance. >=20 > If it really bothers you, then you can use another tool on top of all = that, such as dune, that will not only build your project but also write = the META and the opam file for you (and more). With the risk that, if = something fails at this point, you have all the above stack to unfold to = understand what's happening. >=20 > If you have read this far then maybe you are interested in the topic = of software packaging and deployment. > Then it must be mentioned that better, more sophisticated package = managers do exist, which solve this whole problem once and for all, such = as nix or guix, and that hopefully one day we will all abandon our = compartmentalised solutions that are popular today and move on to the = next level.