[Omake] Odd trouble with file-exists

Aleksey Nogin nogin at metaprl.org
Wed Apr 18 11:07:21 PDT 2007


Jared,

The results of stat operations (including the file-exists tests) are 
normally cached by OMake. Before the rule was executed, the stat was 
already taken (and OMake cached the fact that the file is not there). 
After the rule is executed, the cache is reset for the rule's target and 
OMake will know the file exists, however during the rule execution, the 
cache might be stale.

If you need to have a test that bypasses the cache, use the
"$(test -e $(patchfile)))"

Aleksey

On 18.04.2007 10:03, Jared C. Davis wrote:

> Hi,
> 
> Am I doing something wrong, or is this a bug?
> 
> Notice that says file-exists is false, even though it gets created and
> ls believes it exists:
> 
> bash-3.1$ ls
> OMakefile  OMakeroot
> 
> bash-3.1$ cat OMakefile
> .DEFAULT: worse-termp-patch.lisp
> 
> worse-termp-patch.lisp:
>    section
>        patchfile = $(file worse-termp-patch.lisp)
>        touch $(patchfile)
>        ls -lah $(patchfile)
>        println(File exists is $(file-exists $(patchfile)))
> 
> bash-3.1$ cat OMakeroot
> .SUBDIRS: .
> 
> bash-3.1$ omake
> *** omake: reading OMakefiles
> *** omake: finished reading OMakefiles (0.0 sec)
> - build . worse-termp-patch.lisp
> + sequence
>     patchfile = $(file ("worse-termp-patch.lisp"))
>     shell(("touch ", $(patchfile)))
>     shell(("ls -lah ", $(patchfile)))
>     println(("File exists is ", $(file-exists $(patchfile))))
>     cancel-export
> -rw-r--r-- 1 jared grad 0 Apr 18 12:01 worse-termp-patch.lisp
> File exists is false
> *** omake: done (0.2 sec, 0/0 scans, 1/1 rules, 3/15 digests)
> 
> bash-3.1$ omake --version
> OMake 0.9.8 (release 2):
>     build [Thu Jan 25 10:45:53 2007]
>     on lego.cs.utexas.edu
> 
> Default library directory : /lusr/opt/omake-0.9.8/lib/omake
> 
> Thanks!
>   Jared
> 



More information about the Omake mailing list