Subject: Very strange behaviour of LFS and TMPFS
To: None <netbsd-help@NetBSD.org>
From: Aleksey Cheusov <cheusov@tut.by>
List: netbsd-help
Date: 11/14/2007 20:30:25
NetBSD chen.chizhovka.net 4.0_RC4 NetBSD 4.0_RC4 (GENERIC) #0: Sun Nov 11 14:06:32 EET 2007  cheusov@chen.chizhovka.net:/srv/obj/sys/arch/i386/compile/GENERIC i386

LFS and TMPFS seems broken to me.
'make' program works very strangely.

/dev/wd1f on /srv type lfs (noatime, local):
tmpfs on /tmp type tmpfs (local)

Both these partisions work the same way (incorrectly).

     0 trtr>cat Makefile                                      
     file1 : file0
        cat file0 > $@

     file2 : file1
        cat file1 > $@

     file3 : file2
        cat file2 > $@
     0 trtr>touch file0
     0 trtr>make file3
     cat file0 > file1
     cat file1 > file2
     cat file2 > file3
     0 trtr>touch file0 
     0 trtr>make file3  
     cat file0 > file1
     `file3' is up to date.
     0 trtr>make file3 
     cat file0 > file1
     `file3' is up to date.
     0 trtr>make file3 
     cat file0 > file1
     `file3' is up to date.
     0 trtr>make file3 
     cat file0 > file1
     `file3' is up to date.
     0 trtr>

Why file3 is not rebuilt after I touch file0?

I also played with EXT2FS (the same Makefile)

     0 trtr>touch file0; make file3 
     cat file0 > file1
     cat file1 > file2
     cat file2 > file3
     0 trtr>touch file0; make file3 
     cat file0 > file1
     `file3' is up to date.
     0 trtr>touch file0; make file3 
     cat file0 > file1
     cat file1 > file2
     cat file2 > file3
     0 trtr>touch file0; make file3 
     cat file0 > file1
     cat file1 > file2
     cat file2 > file3
     0 trtr>touch file0; make file3 
     `file3' is up to date.
     0 trtr>

After toching file0, file3 is rebuilt NOT ALWAYS. Why?

-- 
Best regards, Aleksey Cheusov.