Boost logo

Boost-Build :

Subject: [Boost-build] Directory caching interferes with path.exists/glob when the filesystem is modified during Jamfile parsing
From: Matthew Chambers (matthew.chambers_at_[hidden])
Date: 2009-09-15 18:14:34


A simple test case:

import common path ;
.TOUCH = [ common.file-touch-command ] ;
echo Before touch ;
if [ path.exists foo ] { echo Foo exists! ; } # should not exist

SHELL "$(.TOUCH) foo" ;

echo After touch ;
if [ path.exists foo ] { echo Foo exists! ; } # should exist

With this code, the last if statement doesn't pass because it's working
off the cached directory list. If directory caching is desirable during
or before parsing all the Jamfiles, then one solution might be to use
system calls to monitor the cached directories and refresh them when a
modification is detected. Windows has such a call, dunno about other
platforms. Another solution might be to have a native rule that can
invalidate the cache for a given directory passed to the rule.

This issue also seems to affect source file binding and scanning.

-Matt


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk