List Info

Thread: make Configure more friendly to lndir directories




make Configure more friendly to lndir directories
user name
2007-08-27 00:21:21
For a long time, Ive used lndir to clone bleadperl to a
workspace
and then start hacking.

This works quite well in general, but if I rerun Configure,
several important files in the ../bleadperl directory are
updated/mangled,
corrupting the baseline in ../bleadperl


Relevant timestamp ordering of orig (before re-Configuring
cloned dir)

(todays date: Sun Aug 26 13:35:21 MDT 2007)

-r--r--r--  1 jimc jimc   33654 Aug 24 20:29 AUTHORS
-rw-rw-r--  1 jimc jimc   28525 Aug 25 01:24 config.sh
-rw-rw-r--  1 jimc jimc  139811 Aug 25 01:24 config.h
-rwxrwxr-x  1 jimc jimc     728 Aug 25 01:24 makedir
-rwxrwxr-x  1 jimc jimc    6479 Aug 25 01:24 makedepend
-rwxr-xr-x  1 jimc jimc    3190 Aug 25 01:24 makeaperl
-rwxr-xr-x  1 jimc jimc    3250 Aug 25 01:24 cflags
-rwxr-xr-x  1 jimc jimc    1774 Aug 25 01:24 writemain
-rw-rw-r--  1 jimc jimc    5550 Aug 25 01:24 Policy.sh
-r--r--r--  1 jimc jimc  212461 Aug 25 01:24 opmini.c
-rwxr-xr-x  1 jimc jimc    2107 Aug 25 01:24 myconfig
-rw-rw-r--  1 jimc jimc   34854 Aug 25 01:24 Makefile
-rw-rw-r--  1 jimc jimc    4539 Aug 25 01:24 perlmain.c
-rw-rw-r--  1 jimc jimc   34854 Aug 25 01:24 makefile.old
-rw-rw-r--  1 jimc jimc  292350 Aug 25 01:24 makefile
-rw-rw-r--  1 jimc jimc   48492 Aug 25 01:25 miniperlmain.o
-rw-rw-r--  1 jimc jimc  187272 Aug 25 01:25 gv.o

after reconfig, the orig files have been changed:

-rw-rw-r--  1 jimc jimc   72992 Aug 25 01:25 DynaLoader.o
-rwxrwxr-x  1 jimc jimc 4949261 Aug 25 01:25 perl
-rw-rw-r--  1 jimc jimc 6773210 Aug 25 01:25 libperl.a
-rw-rw-r--  1 jimc jimc       0 Aug 25 01:25 ext.libs
-rw-rw-r--  1 jimc jimc       0 Aug 26 13:04 uni.data
-rw-rw-r--  1 jimc jimc   28478 Aug 26 13:33 config.sh
-rw-rw-r--  1 jimc jimc    5550 Aug 26 13:33 Policy.sh
-rwxr-xr-x  1 jimc jimc    2315 Aug 26 13:33 myconfig
-rw-rw-r--  1 jimc jimc   34854 Aug 26 13:33 Makefile
-rw-rw-r--  1 jimc jimc  139811 Aug 26 13:33 config.h
-rw-rw-r--  1 jimc jimc    4539 Aug 26 13:33 perlmain.c


After patch is applied to cloned-dir, and re-Configured, I
get
(in dest/cloned dir)

lrwxrwxrwx  1 jimc jimc     20 Aug 26 18:48 av.o ->
../../bleadperl/av.o
lrwxrwxrwx  1 jimc jimc     20 Aug 26 18:48 av.h ->
../../bleadperl/av.h
lrwxrwxrwx  1 jimc jimc     20 Aug 26 18:48 av.c ->
../../bleadperl/av.c
lrwxrwxrwx  1 jimc jimc     26 Aug 26 18:48 autodoc.pl ->

../../bleadperl/autodoc.pl
lrwxrwxrwx  1 jimc jimc     23 Aug 26 18:48 AUTHORS -> 
../../bleadperl/AUTHORS
drwxrwxr-x  3 jimc jimc   4096 Aug 26 18:48 apollo
-r--r--r--  1 jimc jimc  28525 Aug 26 18:49 config.sh
-rwxr-xr-x  1 jimc jimc   1774 Aug 26 18:49 writemain
-rw-rw-r--  1 jimc jimc   5550 Aug 26 18:49 Policy.sh
-rwxr-xr-x  1 jimc jimc   2107 Aug 26 18:49 myconfig
-rw-rw-r--  1 jimc jimc  34894 Aug 26 18:49 Makefile
-rwxrwxr-x  1 jimc jimc    728 Aug 26 18:49 makedir
-rwxrwxr-x  1 jimc jimc   6479 Aug 26 18:49 makedepend
-rwxr-xr-x  1 jimc jimc   3190 Aug 26 18:49 makeaperl
-rw-rw-r--  1 jimc jimc 139811 Aug 26 18:49 config.h
-rwxr-xr-x  1 jimc jimc   3250 Aug 26 18:49 cflags
drwxrwxr-x  2 jimc jimc   4096 Aug 26 18:50 x2p
-rw-rw-r--  1 jimc jimc  34894 Aug 26 18:50 makefile.old
-rw-rw-r--  1 jimc jimc 302280 Aug 26 18:50 makefile



Im aware of -Dmksymlinks, which avoids this problem by only
building
links for files in MANIFEST, but using lndir is faster - all
the objects
are symlinked too, so theyre not rebuilt unless the
corresponding sources
have been modified.  This reduces compile time, and storage
needed.


The problem is due to `echo foo > file` writing thru the
link,
updating the ../bleadperl/file instead of creating a new
one.
The attached patch fixes this, at least for my use-case and
platform.
FWIW, make regen in clone-dir also leaves ../bleadperl
alone.

- the patch is incomplete (no Win32Its probably not portable
( do all 
shells support -L filetest ? ),
but since its at least partly a Configure patch, it needs
meta-work anyway.
- Ive renamed the files to <file>.link, I think this
is safe for Win32
(which uses .lnk suffixes for links ??) but thats probably
unnecessary 
anyway.

Lemme know if there are corner cases you think Ive missed.

thanks
jimc

  
Re: make Configure more friendly to lndir directories
user name
2007-08-27 08:12:17
On Sun, 26 Aug 2007, Jim Cromie wrote:

> 
> For a long time, Ive used lndir to clone bleadperl to a
workspace
> and then start hacking.
[ . . . ]
> Im aware of -Dmksymlinks, which avoids this problem by
only building
> links for files in MANIFEST, but using lndir is faster
- all the objects
> are symlinked too, so theyre not rebuilt unless the
corresponding sources
> have been modified.  This reduces compile time, and
storage needed.

> The problem is due to `echo foo > file` writing thru
the link,
> updating the ../bleadperl/file instead of creating a
new one.
> The attached patch fixes this, at least for my use-case
and platform.
> FWIW, make regen in clone-dir also leaves ../bleadperl
alone.
> 
> - the patch is incomplete (no Win32Its probably not
portable ( do all shells
> support -L filetest ? ),

No.  Another common option is 'test -h'.  Fortunately,
Configure already 
tests for likely variations.  If you want to do this at all
(a question on 
which I have no informed opinion at the moment), you should
use 
Configure's $issymlink variable.

-- 
    Andy Dougherty		dougheralafayette.edu

Re: make Configure more friendly to lndir directories
user name
2007-08-27 04:46:07
Jim Cromie <jim.cromiegmail.com> wrote:
:+if test -L config.sh ; then
:+    mv config.sh config.sh.link
:+    cp config.sh.link config.sh
:+fi
[etc]

Wouldn't it be easier, and as effective, to rm the file
before writing
the new version?

Hugo

Re: make Configure more friendly to lndir directories
user name
2007-08-30 13:22:49
Andy Dougherty wrote:
> On Sun, 26 Aug 2007, Jim Cromie wrote:
>
>   
>> For a long time, Ive used lndir to clone bleadperl
to a workspace
>> and then start hacking.
>>     
> [ . . . ]
>   
>> Im aware of -Dmksymlinks, which avoids this problem
by only building
>> links for files in MANIFEST, but using lndir is
faster - all the objects
>> are symlinked too, so theyre not rebuilt unless the
corresponding sources
>> have been modified.  This reduces compile time, and
storage needed.
>>     
> tests for likely variations.  If you want to do this at
all (a question on 
> which I have no informed opinion at the moment), you
should use 
> Configure's $issymlink variable.
>
>   


While testing, I cloned a threaded build dir, and added a
-Uusethreads, 
and things went boom. (some 'getthreadspecific' err IIRC)

So obviously somethings not ready for prime-time.
Maybe its time to just use -Dmksymlinks 

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )