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 993025D6 for ; Wed, 14 Aug 2019 19:09:13 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.64,386,1559512800"; d="scan'208";a="395433184" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 14 Aug 2019 21:09:12 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 80DDD7EF18; Wed, 14 Aug 2019 21:09:12 +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 184707EF07 for ; Wed, 14 Aug 2019 21:09:04 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=rixed@happyleptic.org; spf=Pass smtp.mailfrom=rixed@happyleptic.org; spf=Pass smtp.helo=postmaster@out2-smtp.messagingengine.com IronPort-PHdr: =?us-ascii?q?9a23=3AqLe/whBFv95KvTxyGFnGUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSPv7ocbcNUDSrc9gkEXOFd2Cra4d0ayP6fGrBz1IyK3CmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+?= =?us-ascii?q?KPjrFY7OlcS30P2594HObwlSizexfK1+IA+roQnPssQajopvJ6IswRbVv3VEfP?= =?us-ascii?q?hby3l1LlyJhRb84cmw/J9n8ytOvv8q6tBNX6bncakmVLJUFDspPXw7683trhnD?= =?us-ascii?q?UBCA5mAAXWUMkxpHGBbK4RfnVZrsqCT6t+592C6HPc3qSL0/RDqv47t3RBLulS?= =?us-ascii?q?wKMSMy/mPKhcxqlK9VpxyuqBN8zYHWboGbOvpwcL3Ac9wGXmdBQtpdWjZdDo6m?= =?us-ascii?q?dYYDE+wMNvtYoYnnoFsOqAOzBROtBOLg1DBHm2T73a0g3OQ5CQHH3AggEMwWsH?= =?us-ascii?q?TIrdX6KL0eUeevzKnHyzjIcvBY2S/l5YXJcx0tu+yAUa9tfcbLxkQjDR3Jg1SW?= =?us-ascii?q?pIf4JT2azP4NvHKe7+d4VeKglWonqwZprzio28cslpfFipsOylDB6SV52Jw5Jd?= =?us-ascii?q?imR05get6rCpRQtyCcN4t5XMwiRW5ouCc8yrIYo5K0YC8KyJE/yx7ebfyIbZSI?= =?us-ascii?q?7wriWeuQOzt0mW9pdK+lixu960Ss1OzxWtGx0FlQrypFltfMtmoK1xzW8sWHUP?= =?us-ascii?q?p9/0i/1jmSzA3T6vtLIVgslavbL54u3KYwloYSsUvfBCP2n1/2jKCOekU+5ueo?= =?us-ascii?q?8/jnYqnhppKEK4B7kAT+MqA3lsy7AOQ4KRQOUnOA+eW80b3j5Vf2TK9Ljv0wiK?= =?us-ascii?q?nZsYrVKd4Vpq6jBQJez5gu6xKiDze9zNQXg2MHIk9EeBOGkYfkI03Cc7jECqK0?= =?us-ascii?q?ilGo1TNq3OzuP7v7A5yLIGKQvq3meONn6l5RxCIzxMhH9pZZEq0AK7T0QECi55?= =?us-ascii?q?TjEhYlPlnskK7cA9Jn29ZGAD/dMuqiKKrX9GSwyKcvLu2LP9ZHvyvhcb0+4uL2?= =?us-ascii?q?y3o0gkQUcqiv0pYRZ3G+E7JtJEDLOCO90OdEKn8Du08FdMKvjVSDVTBJYHPrAP?= =?us-ascii?q?A87ykjGYarFZvCTcaqmrPThX7nTK0TXXhPDxW3KVmtb5+NAqheaCuKOt5lnyQY?= =?us-ascii?q?VLPnTJUuh0mj?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AVDwB5W1RdhxoEb0JmHQEBBQEHBQGBZ?= =?us-ascii?q?4FpgRxSMiqNGoYQgWIImzEJAQMBDBsUAQGBS4J0AoMNHAYBBDQTAQQBAQQBAQQ?= =?us-ascii?q?BAwcBEwEBAQoLCQgphS4Mgjoigm8DA0ABATgPC0YsKzICgwcBggqqK4IlgnoBA?= =?us-ascii?q?QWCPINMgSoJgTSEdIIcghSCRReBf4ERJwyBYX4+iieMLBsmh1iIXo4uCYgjYIk?= =?us-ascii?q?EhEUhgjAvixaKSKM/gkOBZ4F5fUMugj4Jgjkag1iFFIVBPQECMI9EAQE?= X-IPAS-Result: =?us-ascii?q?A0AVDwB5W1RdhxoEb0JmHQEBBQEHBQGBZ4FpgRxSMiqNGoY?= =?us-ascii?q?QgWIImzEJAQMBDBsUAQGBS4J0AoMNHAYBBDQTAQQBAQQBAQQBAwcBEwEBAQoLC?= =?us-ascii?q?QgphS4Mgjoigm8DA0ABATgPC0YsKzICgwcBggqqK4IlgnoBAQWCPINMgSoJgTS?= =?us-ascii?q?EdIIcghSCRReBf4ERJwyBYX4+iieMLBsmh1iIXo4uCYgjYIkEhEUhgjAvixaKS?= =?us-ascii?q?KM/gkOBZ4F5fUMugj4Jgjkag1iFFIVBPQECMI9EAQE?= X-IronPort-AV: E=Sophos;i="5.64,386,1559512800"; d="scan'208";a="395433146" X-MGA-submission: =?us-ascii?q?MDEyOT3aFJJ2Qn2VWtsH8W5Jo9ABXd7amjQjfg?= =?us-ascii?q?OYXK+bBGDeVuMz4OrewJ4s6TYent8NPoOBo9dYdsGf25sIBDjA7agyFg?= =?us-ascii?q?JmdOpoIxIbN8+GOfG+dnRtoPJ9QwDC8WetzFHIblGEp5+mf1iriVVi86?= =?us-ascii?q?tIQnxyKi+9SmrLTN3A5ILEoQ=3D=3D?= Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 21:09:02 +0200 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7F1D722128 for ; Wed, 14 Aug 2019 15:09:00 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Wed, 14 Aug 2019 15:09:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=happyleptic.org; h=mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm1; bh=21HLGjYTdPFqfUDCrc+S2ssKYSyriXh tbrADis6X/R4=; b=qSI8FOngVECoAJFUavcuCM98eP91+0CCDd687YZfUQaaxa9 tCS51sQrPbITRzNmVYJW36aaW40vfoL8mkO7AU7Mccm6iQoISnF/S0bluhSbq96K lYWShEN0QuyfZAW3wmhwPwpz3u9uP/RyYGSyqx8LkB8hZ1I1tkTG0ZfslHB6gY6x MFa0gVrRDDqW6FIspG0n6QGwGKHh89bLFAMWN7GWMQfwlz1QyqN9+mtLlQyoc4KI 9QKoxY4Fv6gdSCTtjn5PFLFyOpL2HZpbUv3h0x+Xy9TGRr5fGGdw+AFt3knV5B7R W5rOtKBZaT8s0QZHBZED5dxSImSt68FMjseeuVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=21HLGj YTdPFqfUDCrc+S2ssKYSyriXhtbrADis6X/R4=; b=In6b9eSworICTuejOtkERX HcwyRpj+iv0NsZHc/71R3y8HlZmue2Uhl7sTKdDXb0kf17zPNR9tPCQKh3Vljfy+ It0sSi6WJMc5aSeb/ts9NTSOs41nwhnFTGm7cmWwRW39ArZ/+UPPQ/NQ3MSWvT7R K8SvQT8XpksTc/NZzUVAOyaL8cjM8kwPGZ0FVDX5m5t5sQ1yfPEAnmS/GnJX2SAm Y/rWhIOXG7BnOWthrKB7yXFnoYvK8cIP2thRg4iK6Qj6S8TwQRoFa3hL5OTmTH8O YIyPYqxYH96rj47IBj03s/r0S8vo/XdOyhwToqAhROXtXC+tnA+DYb1ddHvFANpg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddruddvledgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderredtnecuhfhrohhmpehrihigvggusehhrghpphihlhgvphhtihgtrdhorhhgnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehrihigvggusehhrghpphihlhgvphhtihgtrdhorh hgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E3360E00AB; Wed, 14 Aug 2019 15:08:59 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-869-g2d94aad-fmstable-20190814v1 Mime-Version: 1.0 Message-Id: <04bdbadb-82bb-4539-9b42-03ea96e5aabd@www.fastmail.com> In-Reply-To: <8D32A371-FD47-434F-928A-C07D002BB712@uca.fr> References: <8D32A371-FD47-434F-928A-C07D002BB712@uca.fr> Date: Wed, 14 Aug 2019 21:08:59 +0200 From: rixed@happyleptic.org To: caml-list@inria.fr Content-Type: text/plain Subject: Re: [Caml-list] A (silly ?) question about opam and ocamlfind Reply-To: rixed@happyleptic.org X-Loop: caml-list@inria.fr X-Sequence: 17766 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: Hello! 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. 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. 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). 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`. 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). 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). 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. 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. 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.