caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sylvain Le Gall <sylvain@le-gall.net>
To: Magnus Therning <magnus@therning.org>
Cc: Gabriel Scherer <gabriel.scherer@gmail.com>,
	Anil Madhavapeddy <anil@recoil.org>,
	 OCaml List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] oasis building out-of-src and camlp4
Date: Fri, 02 Oct 2015 09:32:56 +0000	[thread overview]
Message-ID: <CAOCAUGOaB0JFfZFv-osEyT3JUrrf1VpyWAt9j-DmAGTpBOcyYg@mail.gmail.com> (raw)
In-Reply-To: <20151001072345.GA9809@sobel.cipherstone.com>

[-- Attachment #1: Type: text/plain, Size: 5462 bytes --]

Le jeu. 1 oct. 2015 à 09:23, Magnus Therning <magnus@therning.org> a écrit :

> On Thu, Oct 01, 2015 at 06:46:55AM +0000, Sylvain Le Gall wrote:
> > Hello,
> >
> > Le mer. 30 sept. 2015 à 13:49, Magnus Therning <magnus@therning.org> a
> > écrit :
> >
> > > 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=detail&aid=1473&group_id=54&atid=291
> > > >
> > > > 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.log`
> > >   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.data
> >   -> 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.
>

[-- Attachment #2: Type: text/html, Size: 7813 bytes --]

  reply	other threads:[~2015-10-02  9:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 21:12 Magnus Therning
2015-09-23  7:48 ` Anil Madhavapeddy
2015-09-23  8:19   ` Magnus Therning
2015-09-23  8:38     ` Gabriel Scherer
2015-09-23  8:54       ` Magnus Therning
2015-09-23  9:19         ` Gabriel Scherer
2015-09-23  9:44           ` Magnus Therning
2015-09-29 22:59             ` Sylvain Le Gall
2015-09-30 11:49               ` Magnus Therning
2015-10-01  6:46                 ` Sylvain Le Gall
2015-10-01  7:23                   ` Magnus Therning
2015-10-02  9:32                     ` Sylvain Le Gall [this message]
2015-10-02  9:38                       ` Magnus Therning
2015-09-23  7:56 ` Anil Madhavapeddy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOCAUGOaB0JFfZFv-osEyT3JUrrf1VpyWAt9j-DmAGTpBOcyYg@mail.gmail.com \
    --to=sylvain@le-gall.net \
    --cc=anil@recoil.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=gabriel.scherer@gmail.com \
    --cc=magnus@therning.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).