Boost logo

Boost-Build :

Subject: [Boost-build] Symbolic links and timestamps
From: Phil Bass (Phil.Bass_at_[hidden])
Date: 2008-10-01 07:44:41


I'm converting an unwieldy set of make files to broadly equivalent jam
files. Among other things the make files build an executable, load data
into a database and make symbolic links to the executable and some data
files. The jam files try to ensure that the data is loaded into the
database before the symbolic links are created to ensure that the
application runs correctly when invoked via the symlink. A timestamp
file is used to record the time the data was loaded.

The symlink depends on the executable and the data-loaded timestamp
file. Doing a build from scratch produces files in the order:
data-loaded timestamp file, executable file, symbolic link to
executable. Naturally, telling bjam to re-build the symbolic link at
this point results in no actions. However, if the data-loaded timestamp
file is removed using bjam --clean and the system built again,
subsequent builds always trigger the creation of the symbolic link.

This seems to be because bjam is using the timestamp of the executable
as the timestamp of the symlink. Here's a fragment of a build with -d+3
as evidence:

     make -- <pRunTime/ROWT/bin/gcc-x86/debug/link-static>Main
     make -- <pRunTime/ROWT/bin/gcc-x86/debug/link-static>Main
     bind -- <pRunTime/ROWT/bin/gcc-x86/debug/link-static>Main:
RunTime/ROWT/Main
     time -- <pRunTime/ROWT/bin/gcc-x86/debug/link-static>Main:
Tue Sep 30 12:59:31 2008
     make -- <pROWT_Gui/bin/gcc-x86/debug/link-static>Main
     make -- <pROWT_Gui/bin/gcc-x86/debug/link-static>Main
     bind -- <pROWT_Gui/bin/gcc-x86/debug/link-static>Main:
ROWT_Gui/bin/gcc-x86/debug/link-static/Main
     time -- <pROWT_Gui/bin/gcc-x86/debug/link-static>Main:
Tue Sep 30 12:59:31 2008
     . . .
     made stable <pROWT_Gui/bin/gcc-x86/debug/link-static>Main
     made+ old <pRunTime/ROWT/bin/gcc-x86/debug/link-static>Main

In this snippet RunTime/ROWT/Main is the symlink and ROWT_Gui/.../Main
is the executable. The timestamp on the data-loaded timestamp file was
2008-10-01 11:31, i.e. newer than the executable, but older than the
symlink.

So, my question is, can bjam be persuaded to use the timestamp of a
symlink file instead of the file it points to? Alternatively, is there a
better way of achieving my objectives?

-- 
Phil Bass (pab_at_[hidden])
     The views expressed in this e-mail/posting are those of the author
     and do not necessarily reflect those of Isotek Electronics Ltd.

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