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 08D2C7F734 for ; Wed, 23 Sep 2015 11:20:39 +0200 (CEST) IronPort-PHdr: 9a23:ijK4YxwLdYvPO13XCy+O+j09IxM/srCxBDY+r6Qd0eIQIJqq85mqBkHD//Il1AaPBtWHra4ewLKH+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStKU0578j7H60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYCgJ45jOvBbFUBDH2nsRSGMXlBUAVw3M4xfnRb/tsibgsOt712+dJ8KgHp4uXjH3wK5hUh7ljG88PD406mzNwph/hahBoR+l4Qd0w4PObZu9O/93f6ebdtQfEzkSFv1NXjBMV9vvJ7AECPAMaKMB99Hw 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-io0-f170.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.223.170; 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.223.170 as permitted sender) identity=mailfrom; client-ip=209.85.223.170; 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-io0-f170.google.com) identity=helo; client-ip=209.85.223.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-io0-f170.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AdBABRbgJWlKrfVdFDGoN4YwYGsV2Ld4F6hXkCgT0HOhIBAQEBAQEBARABAQEBBwsLCR8wQQOBWYIHAQEBAwESER0BGw8OAQMBCwYFCw0CAiYCAiIBEQEFARwGExsHh3YBAwoICAU7qEWBMD4xi0aBbIJ5iW0KGScNVoQgAQEBAQEFAQEBAQEXAQUOgRSFUYR9hCoRAVEHgmmBQwWHL4Z+hzqFEod5gU9GkUkUg0uCIRIjgRcoCYI2DRyBVjwzAYN2hDeBPwEBAQ X-IPAS-Result: A0AdBABRbgJWlKrfVdFDGoN4YwYGsV2Ld4F6hXkCgT0HOhIBAQEBAQEBARABAQEBBwsLCR8wQQOBWYIHAQEBAwESER0BGw8OAQMBCwYFCw0CAiYCAiIBEQEFARwGExsHh3YBAwoICAU7qEWBMD4xi0aBbIJ5iW0KGScNVoQgAQEBAQEFAQEBAQEXAQUOgRSFUYR9hCoRAVEHgmmBQwWHL4Z+hzqFEod5gU9GkUkUg0uCIRIjgRcoCYI2DRyBVjwzAYN2hDeBPwEBAQ X-IronPort-AV: E=Sophos;i="5.17,577,1437429600"; d="scan'208";a="179040143" Received: from mail-io0-f170.google.com ([209.85.223.170]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 23 Sep 2015 11:20:38 +0200 Received: by ioii196 with SMTP id i196so38624404ioi.3 for ; Wed, 23 Sep 2015 02:20:37 -0700 (PDT) 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=k6m5P+stdWiaofWE6Rpnd3WzrNvZyyW7q1LwvcQPBeQ=; b=F8YYGhXkgw9eVcYiKOmxQ28wndSCgpxf6RJvxXvw/FHdCn1SzT+aSo/LoDM/2YdqDT IKYFKFQbqvBfKuBJtF+z7Gr6J6mv7MnScxePrCQwPT1b+1AqpAO3lGeAiz7pLWAD7IN9 JxQV7vyydkIDJqkPpBglSkGTeXYgfuyt7rQyquVEG1JDn9D+YSzNqYmA8ju/mukwuida aZOkBHCBrgrGxDkXvpzBVLfGSVC9QJxZOemz0qdmLIwWqjsvsvFpy2L/ZsMcs3IB8meS 4BsOV5ACvpymb/yKyty7wtfVwD16xD4gwksXLjnU9vGEdcd17SNRDvIVR4KzSjbPXbeA ltiA== X-Received: by 10.107.19.70 with SMTP id b67mr35544829ioj.144.1443000036962; Wed, 23 Sep 2015 02:20:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.19.68 with HTTP; Wed, 23 Sep 2015 02:19:57 -0700 (PDT) In-Reply-To: <20150923085405.GG22004@sobel.cipherstone.com> References: <20150922211237.GA22711@tatooine> <20150923081916.GE22004@sobel.cipherstone.com> <20150923085405.GG22004@sobel.cipherstone.com> From: Gabriel Scherer Date: Wed, 23 Sep 2015 11:19:57 +0200 Message-ID: To: Magnus Therning Cc: Anil Madhavapeddy , OCaml List , Sylvain Le Gall Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] oasis building out-of-src and camlp4 > Indeed, the goal is to not contaminate the source directory *at all*. You could, in the "external build" command passed to CMake, wrap the build invocation with code to create the symlinks before the build, and remove them after the build. That said, If I understand oasis' philosophy correctly (but I'm far from an expert), the file that are generated by the oasis setup are not to be understood as "generated files never to be looked at", but rather *source* files that you may want to modify and customize yourself, and just contain some snippets produced by oasis. I would understand this as a kind of "we created the basic boilerplate structure of your project for you", rather than "those are hidden files only used during the build". In particular, you may be expected to include these files in your version-control repository (something I have been a bit reluctant to do myself; I think that the newish "dynamic" setup mode of oasis avoids versioning any cruft). (That said, many users never have to touch the oasis-generated files.) > Since the steps work on "simple" > code, but doesn't on code using `camlp4` I'm leaning towards calling > this a bug. I'll let oasis developers triage this issue, but it is not as clear as you describe. It's not that this oasis setup works in simple cases and breaks in other, but rather than oasis does not support this setup at all, yet sometimes ocamlbuild can do what it needs without any help whatsoever. One other option would be to enhance ocamlbuild to support the scenario where the build-description files it needs (_tags and myocamlbuild.ml) are located outside the source repository, which is a reasonable assumption if we assume they have been generated rather than user-written (your situation). We could add a (-config-dir $DIR) option for that, or separate options (-plugin-source /path/to/foo.ml) and (-tag-file /path/to/_tags). It strikes me as a bit odd to have a _tags file in another directory, that contains glob patterns relative to the source directory (in your case the _tags file will refer to ). But I like the idea and created a feature request to track it: http://caml.inria.fr/mantis/view.php?id=6997 But if you go this route, it means that you would have to wait for the next ocamlbuild release, so an oasis-level solution or workaround would currently be more helpful for you. On Wed, Sep 23, 2015 at 10:54 AM, Magnus Therning wrote: > On Wed, Sep 23, 2015 at 10:38:31AM +0200, Gabriel Scherer wrote: >> Thanks for the reproducible information. I just tried and could >> reproduce the issue. >> >> The problem comes from the fact that, with the command-line invocation >> you use oasis generates the build description files (_tags, >> myocamlbuild.ml, setup.data) in the build directory, not in the source >> directory, but ocamlbuild when invoked (from the source directory) >> will look for them in the source directory. In particular, I could >> "fix" the build by doing > > Indeed, the goal is to not contaminate the source directory *at all*. > >> ... >> ocaml setup.ml -C $PWD/../oasis-camlp4 -configure >> for f in {myocamlbuild.ml,_tags,setup.data}; do ln -s $PWD/$f >> ../oasis-camlp4; done >> ocaml setup.ml -C $PWD/../oasis-camlp4 -build -build-dir $PWD/build >> >> It looks like oasis's behavior with "-C $DIR -configure" is >> problematic: it should generate its files in $DIR -- except maybe >> setup.ml, or then people would have to run (ocaml $DIR/setup.ml -C >> $DIR ...). > > I've been playing around a bit with the various combinations of where I > run `ocaml /setup.ml` and `-C`. Since the steps work on "simple" > code, but doesn't on code using `camlp4` I'm leaning towards calling > this a bug. > >> TL;DR: this appear to be an oasis issue, rather than a issue with >> CMake or ocamlbuild. > > Yes, I'm guessing it's an issue in the code generated by `oasis` and how > it uses `ocamlbuild` and other build tools. > > /M > > -- > Magnus Therning OpenPGP: 0xAB4DFBA4 > email: magnus@therning.org jabber: magnus@therning.org > twitter: magthe http://therning.org/magnus > > The man who is denied the opportunity of taking decisions of > importance begins to regard as important the decisions he is allowed > to take. > -- C Northcote Parkinson