Directory caching interferes with path.exists/glob when the filesystem is modified during Jamfile parsing

View: New views
2 Messages — Rating Filter:   Alert me  

Directory caching interferes with path.exists/glob when the filesystem is modified during Jamfile parsing

by Matthew Chambers-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Diff OS's config

by Anant Rao :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

If I have a line like:
ICU               = <some-dir>/IBM/ICU/4.0.1/linux/icu4c-4_0_1 ;

it's ok on 'linux'.

Now, on Windows, the corresponding lib dir could be somewhere else.

How do I handle such situation using Jamroot/Jamfile/user-config.jam  ?

Thanks so much,

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build