caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlbuild's symlink behavior
@ 2008-03-03 18:04 Eric Cooper
  2008-03-04  1:26 ` [Caml-list] " Ashish Agarwal
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Cooper @ 2008-03-03 18:04 UTC (permalink / raw)
  To: caml-list

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.

-- 
Eric Cooper             e c c @ c m u . e d u


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] ocamlbuild's symlink behavior
  2008-03-03 18:04 ocamlbuild's symlink behavior Eric Cooper
@ 2008-03-04  1:26 ` Ashish Agarwal
  2008-03-04  9:00   ` Nicolas Pouillard
  0 siblings, 1 reply; 4+ messages in thread
From: Ashish Agarwal @ 2008-03-04  1:26 UTC (permalink / raw)
  To: caml-list

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

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.
>
> --
> Eric Cooper e c c @ c m u . e d u
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] ocamlbuild's symlink behavior
  2008-03-04  1:26 ` [Caml-list] " Ashish Agarwal
@ 2008-03-04  9:00   ` Nicolas Pouillard
  2008-03-04  9:36     ` Berke Durak
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pouillard @ 2008-03-04  9:00 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: caml-list

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

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.

-- 
Nicolas Pouillard aka Ertai

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] ocamlbuild's symlink behavior
  2008-03-04  9:00   ` Nicolas Pouillard
@ 2008-03-04  9:36     ` Berke Durak
  0 siblings, 0 replies; 4+ messages in thread
From: Berke Durak @ 2008-03-04  9:36 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: Ashish Agarwal, caml-list

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.
-- 
Berke DURAK


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-03-04  9:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-03 18:04 ocamlbuild's symlink behavior Eric Cooper
2008-03-04  1:26 ` [Caml-list] " Ashish Agarwal
2008-03-04  9:00   ` Nicolas Pouillard
2008-03-04  9:36     ` Berke Durak

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).