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 29FEF7EEFD for ; Fri, 2 Oct 2015 11:33:09 +0200 (CEST) IronPort-PHdr: 9a23:gC/KrxOSeUkTsmCbsokl6mtUPXoX/o7sNwtQ0KIMzox0KPT7rarrMEGX3/hxlliBBdydsKIYzbSK+Pm4EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35jxibz5osWbSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6LoJvvRNWqTifqk+UacQTHF/azh0t4XXskzmRASJ+2BUbmUbiBxJBQeNuBTzUZHsqQPmtudn3iicMovxV79iChq46KI+cw7sli4GMXYd/Sn4g8h0xPZAsRa/rh1564rZJY6cMP44eK7BK4BJDVFdV9pcAnQSSri3aJECWq9YZb5V Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=sylvain@le-gall.net; spf=Pass smtp.mailfrom=gildor478@gmail.com; spf=None smtp.helo=postmaster@mail-wi0-f180.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of sylvain@le-gall.net) identity=pra; client-ip=209.85.212.180; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gildor478@gmail.com"; x-sender="sylvain@le-gall.net"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gildor478@gmail.com designates 209.85.212.180 as permitted sender) identity=mailfrom; client-ip=209.85.212.180; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gildor478@gmail.com"; x-sender="gildor478@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f180.google.com) identity=helo; client-ip=209.85.212.180; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gildor478@gmail.com"; x-sender="postmaster@mail-wi0-f180.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AsAQCpTg5WlLTUVdFEGoN7aAa+CIF9hXeBOTkTAQEBAQEBAQEQAQEBAQcLCwkfMIIdggcBAQEDARIRBFIFCwkCCw0qAgIiEgEFARwGExsHiAQICAU7mSmPRoEwPjGLR5RJCwEBAR4KhW6FeYJugTwRAU2CdIFDBZV8hReHf4FTR4NxjQ9yEAaDT4IjNYEXERICgk8dgVQ+MwGIN4FAAQEB X-IPAS-Result: A0AsAQCpTg5WlLTUVdFEGoN7aAa+CIF9hXeBOTkTAQEBAQEBAQEQAQEBAQcLCwkfMIIdggcBAQEDARIRBFIFCwkCCw0qAgIiEgEFARwGExsHiAQICAU7mSmPRoEwPjGLR5RJCwEBAR4KhW6FeYJugTwRAU2CdIFDBZV8hReHf4FTR4NxjQ9yEAaDT4IjNYEXERICgk8dgVQ+MwGIN4FAAQEB X-IronPort-AV: E=Sophos;i="5.17,622,1437429600"; d="scan'208";a="149375944" Received: from mail-wi0-f180.google.com ([209.85.212.180]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 02 Oct 2015 11:33:07 +0200 Received: by wiclk2 with SMTP id lk2so23193836wic.1 for ; Fri, 02 Oct 2015 02:33:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=ha7RYDqeIZFhkkSbO7JWHMQp1zYv4+pfT5UPHo+3ejw=; b=kNl8uADwfDdbqH3a92OYVyneIbgFw03hIB6wrqgjHXStbCJoPN6klOJkvitM5wQman A4tD3I2fDNciwIXggG0bWbz2HxgdwXQ9zhPS/r8fKVpGZDta8spWxBU3KSTy+i9MDC5A vyDHwMqEAR75g7zB1NXszx0pOsaKRpMFmm1I3jUhU3iFlbjDBuh/yd34gwBU8DQb3Yna KNciBYdK+6MNUzB5pHPukgl+OVq7Uc3oESdqnOCPkgF0j/M2HH0cWdhFdLwsHI2Ppuj5 Vl2gBZRcuCF6FkvH4CmfJTrznErb3pHqdjrnEsYMlxNRUPgx1I1XoJQYp1BqhXYJNL56 xI3w== X-Received: by 10.194.52.106 with SMTP id s10mr14385035wjo.35.1443778387366; Fri, 02 Oct 2015 02:33:07 -0700 (PDT) MIME-Version: 1.0 References: <20150922211237.GA22711@tatooine> <20150923081916.GE22004@sobel.cipherstone.com> <20150923085405.GG22004@sobel.cipherstone.com> <20150923094414.GB25229@sobel.cipherstone.com> <20150930114947.GA21728@sobel.cipherstone.com> <20151001072345.GA9809@sobel.cipherstone.com> In-Reply-To: <20151001072345.GA9809@sobel.cipherstone.com> From: Sylvain Le Gall Date: Fri, 02 Oct 2015 09:32:56 +0000 Message-ID: To: Magnus Therning Cc: Gabriel Scherer , Anil Madhavapeddy , OCaml List Content-Type: multipart/alternative; boundary=047d7b873ac2e9dbe005211bd9b3 Subject: Re: [Caml-list] oasis building out-of-src and camlp4 --047d7b873ac2e9dbe005211bd9b3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le jeu. 1 oct. 2015 =C3=A0 09:23, Magnus Therning a = =C3=A9crit : > On Thu, Oct 01, 2015 at 06:46:55AM +0000, Sylvain Le Gall wrote: > > Hello, > > > > Le mer. 30 sept. 2015 =C3=A0 13:49, Magnus Therning a > > =C3=A9crit : > > > > > On Tue, Sep 29, 2015 at 10:59:49PM +0000, Sylvain Le Gall wrote: > > > > Please consider adding more comments to the following bug, which > seems > > > > close to what you are discussing: > > > > > > > > > > > > https://forge.ocamlcore.org/tracker/index.php?func=3Ddetail&aid=3D1473&gr= oup_id=3D54&atid=3D291 > > > > > > > > I must admit that I totally miss the whole point of the discussion, > > > > probably if you can make a summary of what you precisely need in the > > > > BTS, I will be able to understand the problem better. > > > > > > Unfortunately I don't know enough about `oasis` to understand that bug > > > report :( > > > > > > I'll try to explain how I'd like to use oasis/buildtool by looking how > > > Haskell's Cabal lets me do it: > > > > > > - Configure without generating anything in the current dir: > > > > > > % runhaskell Setup.hs --builddir /tmp/my_build_dir > > > > > > - Build using the just generated configuration, again without putting > > > anything in the current dir: > > > > > > % runhaskell Setup.hs --builddir /tmp/my_build_dir > > > > > > Comparing this to oasis/buildtool (assuming I've a pre-existing > > > `setup.ml` generated with `oasis setup -setup-update dynamic` to > > > minimize the amount of build-related stuff in the project): > > > > > > - Configure > > > > > > % ocaml setup.ml -configure > > > > > > This generates a file, `setup.data` in the current dir. I've found > no > > > way to have it generated in a dedicated build dir. > > > > > > - Build > > > > > > % ocaml setup.ml -build -build-dir /tmp/my_build_dir -no-links > > > > > > This builds in the mentioned dir, but it also generates a `setup.lo= g` > > > in the current dir! > > > > > > I thought that `-C` could offer a way to achieve this, but it doesn't: > > > > > > % mkdir /tmp/my_build_dir; cd /tmp/my_build_dir > > > % ocaml /path/to/setup.ml -h > > > Exception: Sys_error "_oasis: No such file or directory". > > > File "/path/to/setup.ml", line 1: > > > Error: Reference to undefined global `OASISDynRun' > > > > > > I'm not convinced `-C` *should* be the way to achieve what I want. > > > > > > Hopefully this makes it clearer what I mean. > > > > > > > > First, why not just copy everything in the new directory: > > % cp -R . /tmp/my_build_dir; cd /tmp/my_build_dir > > % ocaml setup.ml -configure > > % ocaml setup.ml -build > > > > Maybe I miss some context to understand why this simple solution is not > > enough. > > > > Going back at the other points. There are 3 categories of files: > > - the ones that are really generated at build time: setup.log, setup.da= ta > > -> they probably need to follow the indication provided -C. This is a > bug > > - the ones that are generated by the underlying build system: _build > > (ocamlbuild) > > -> as you wrote "-build -build-dir /tmp/my_build_dir -no-links" should > be > > enough > > - the ones that are generated by the dynamic mode, which is a hack to > > prevent adding the files that other tools need: > > -> these ones are tricky because they should have been in the source > > directory right from the beginning and being able to apply -C to them is > > equivalent to make sure that "ocamlfind"/"ocamlbuild"/other build tools > > will use -C and the source directory... This is clearly not trivial to > > assume that all tools will do. > > > > My initial proposal to "cp" the files and build from the copy would > > probably solve your problem without assuming that all tools comply > > with -C. Tell me if it solves your problem. > > Sure, that is a solution. > > Maybe I was unclear to begin with. I wanted a way to use *only* > oasis/buildtool to achieve my goal. That is, I didn't want to involve > system-specific tools to copy the source from the project source dir > into the build dir before building. I couldn't find a way to use > oasis/buildtool to achieve that, so I sent an email to the list. *I* > consider the lack of a way to do that a deficiency in oasis/buildtool. > > (Do note that it's completely acceptable to just say that this use case > isn't one that you see any value in and that the hack of copying the > source is the way to achieve a build that doesn't leave *anything* > behind in the source dir.) > > OASIS is mostly a glue system that mixes various systems, including system tools. Under the hood, the setup.ml generated by OASIS will anyway use "cp" or any ther system tools: https://github.com/ocaml/oasis/blob/master/src/oasis/OASISFileUtil.ml#L124 I acknowledge that there is a value in your use case, but right now it is a corner case for my personal usage. The hack should be enough to unblock you. If you have an idea how to solve it without the hack, I will be glad to merge a pull request: https://github.com/ocaml/oasis Regards Sylvain > /M > > -- > Magnus Therning OpenPGP: 0xAB4DFBA4 > email: magnus@therning.org jabber: magnus@therning.org > twitter: magthe http://therning.org/magnus > > Failure is not an option. It comes bundled with the software. > --047d7b873ac2e9dbe005211bd9b3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Le=C2= =A0jeu. 1 oct. 2015 =C3=A0=C2=A009:23, Magnus Therning <magnus@therning.org> a =C3=A9crit=C2=A0:
<= /div>
On Thu, Oct 01, 2015 at 06:46:55AM +000= 0, Sylvain Le Gall wrote:
> Hello,
>
> Le mer. 30 sept. 2015 =C3=A0 13:49, Magnus Therning <magnus@therning.org> a
> =C3=A9crit :
>
> > On Tue, Sep 29, 2015 at 10:59:49PM +0000, Sylvain Le Gall wrote:<= br> > > > Please consider adding more comments to the following bug, w= hich seems
> > > close to what you are discussing:
> > >
> > >
> > https://forge.ocamlcore.org/tracker/index.php?func=3Ddetai= l&aid=3D1473&group_id=3D54&atid=3D291
> > >
> > > I must admit that I totally miss the whole point of the disc= ussion,
> > > probably if you can make a summary of what you precisely nee= d in the
> > > BTS, I will be able to understand the problem better.
> >
> > Unfortunately I don't know enough about `oasis` to understand= that bug
> > report :(
> >
> > I'll try to explain how I'd like to use oasis/buildtool b= y looking how
> > Haskell's Cabal lets me do it:
> >
> > - Configure without generating anything in the current dir:
> >
> >=C2=A0 =C2=A0 =C2=A0% runhaskell Setup.hs --builddir /tmp/my_build= _dir
> >
> > - Build using the just generated configuration, again without put= ting
> >=C2=A0 =C2=A0anything in the current dir:
> >
> >=C2=A0 =C2=A0 =C2=A0% runhaskell Setup.hs --builddir /tmp/my_build= _dir
> >
> > Comparing this to oasis/buildtool (assuming I've a pre-existi= ng
> > `setup.ml` generated with `oasis setup -setup-update dynamic` to
> > minimize the amount of build-related stuff in the project):
> >
> > - Configure
> >
> >=C2=A0 =C2=A0 =C2=A0% ocaml setup.ml -configure
> >
> >=C2=A0 =C2=A0This generates a file, `setup.data` in the current di= r.=C2=A0 I've found no
> >=C2=A0 =C2=A0way to have it generated in a dedicated build dir.
> >
> > - Build
> >
> >=C2=A0 =C2=A0 =C2=A0% ocaml setup.ml -build -build-dir /tmp/my_build_dir= -no-links
> >
> >=C2=A0 =C2=A0This builds in the mentioned dir, but it also generat= es a `setup.log`
> >=C2=A0 =C2=A0in the current dir!
> >
> > I thought that `-C` could offer a way to achieve this, but it doe= sn't:
> >
> >=C2=A0 =C2=A0 =C2=A0% mkdir /tmp/my_build_dir; cd /tmp/my_build_di= r
> >=C2=A0 =C2=A0 =C2=A0% ocaml /path/to/setup.ml -h
> >=C2=A0 =C2=A0 =C2=A0Exception: Sys_error "_oasis: No such fil= e or directory".
> >=C2=A0 =C2=A0 =C2=A0File "/path/to/setup.ml", line 1:
> >=C2=A0 =C2=A0 =C2=A0Error: Reference to undefined global `OASISDyn= Run'
> >
> > I'm not convinced `-C` *should* be the way to achieve what I = want.
> >
> > Hopefully this makes it clearer what I mean.
> >
> >
> First, why not just copy everything in the new directory:
> % cp -R . /tmp/my_build_dir; cd /tmp/my_build_dir
> % ocaml setup.ml -configure
> % ocaml setup.ml -build
>
> Maybe I miss some context to understand why this simple solution is no= t
> enough.
>
> Going back at the other points. There are 3 categories of files:
> - the ones that are really generated at build time: setup.log, setup.d= ata
>=C2=A0 =C2=A0-> they probably need to follow the indication provided= -C. This is a bug
> - the ones that are generated by the underlying build system: _build > (ocamlbuild)
>=C2=A0 =C2=A0-> as you wrote "-build -build-dir /tmp/my_build_d= ir -no-links" should be
> enough
> - the ones that are generated by the dynamic mode, which is a hack to<= br> > prevent adding the files that other tools need:
>=C2=A0 =C2=A0-> these ones are tricky because they should have been = in the source
> directory right from the beginning and being able to apply -C to them = is
> equivalent to make sure that "ocamlfind"/"ocamlbuild&qu= ot;/other build tools
> will use -C and the source directory... This is clearly not trivial to=
> assume that all tools will do.
>
> My initial proposal to "cp" the files and build from the cop= y would
> probably solve your problem without assuming that all tools comply
> with -C. Tell me if it solves your problem.

Sure, that is a solution.

Maybe I was unclear to begin with.=C2=A0 I wanted a way to use *only*
oasis/buildtool to achieve my goal.=C2=A0 That is, I didn't want to inv= olve
system-specific tools to copy the source from the project source dir
into the build dir before building. I couldn't find a way to use
oasis/buildtool to achieve that, so I sent an email to the list. *I*
consider the lack of a way to do that a deficiency in oasis/buildtool.

(Do note that it's completely acceptable to just say that this use case=
isn't one that you see any value in and that the hack of copying the
source is the way to achieve a build that doesn't leave *anything*
behind in the source dir.)


OASIS is mostly a glue system that mix= es various systems, including system tools. Under the hood, the setup.ml generated by OASIS will anyway use "cp&q= uot; or any ther system tools:

=
I acknowledge that there is a value in your use case, but right = now it is a corner case for my personal usage. The hack should be enough to= unblock you. If you have an idea how to solve it without the hack, I will = be glad to merge a pull request:

Rega= rds
Sylvain
=C2=A0
/M

--
Magnus Therning=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 OpenPGP: 0xAB4DFBA4
email: magnus@ther= ning.org=C2=A0 =C2=A0jabber: magnus@therning.org
twitter: magthe=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0http= ://therning.org/magnus

Failure is not an option. It comes bundled with the software.
--047d7b873ac2e9dbe005211bd9b3--