English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
ocamlbuild's symlink behavior
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-03-04 (09:36)
From: Berke Durak <berke.durak@e...>
Subject: Re: [Caml-list] ocamlbuild's symlink behavior
Nicolas Pouillard a écrit :
> Excerpts from Ashish Agarwal's message of Tue Mar 04 02:26:33 +0100 2008:
>> It is probably better to refer to the executables under _build in external
>> scripts.
>> On Mon, Mar 3, 2008 at 1:04 PM, Eric Cooper <ecc@cmu.edu> wrote:
>>> Ocamlbuild seems to create a symbolic link into the _build directory
>>> when you build a single target. But it removes that symlink if you
>>> build a different target, and it doesn't produce any symlinks if you
>>> build a *.otarget.
>>> Is there any rationale for this? It makes it difficult to use the
>>> resulting symlinks in any kind of build script.
> That's right, symlinks was more to explain the user where things are.

I have an idea.  Remove symlinks pointing to the _build directory *only*
if the basename of the symlink is the same as the basename of the target.

Hence, if I have toto.native in project/_build and toto.native in project
pointing to project/_build/toto.native, it would get deleted when ocamlbuild
is invoked without toto.native as a target.

However I can create a link project/toto.opt that links to project/_build/toto.native
and it wouldn't get deleted by myocamlbuild.

This would also be a way to respond to people who find the ".native" extension
too long - tell them that they would be better of creating their own symlinks anyway.