Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-07-09 04:06:29


Author: jurko
Date: 2008-07-09 04:06:29 EDT (Wed, 09 Jul 2008)
New Revision: 47260
URL: http://svn.boost.org/trac/boost/changeset/47260

Log:
Quick-fix for a Boost 1.36 accumulators library documentation build failing because Boost Jam treats different paths to the same target as two separate targets and attempts to build both. This patch simply makes mkdir commands not fail in case the target folder already exist. Should be removed once Boost Jam has been updated to correctly detect different paths to the same target.
Text files modified:
   trunk/tools/build/v2/tools/common.jam | 52 +++++++++++++++++++++++++++++++++++++++
   1 files changed, 51 insertions(+), 1 deletions(-)

Modified: trunk/tools/build/v2/tools/common.jam
==============================================================================
--- trunk/tools/build/v2/tools/common.jam (original)
+++ trunk/tools/build/v2/tools/common.jam 2008-07-09 04:06:29 EDT (Wed, 09 Jul 2008)
@@ -506,6 +506,34 @@
     }
     else
     {
+ # (todo)
+ # The following does not work on CYGWIN and needs to be fixed. On
+ # CYGWIN the $(nl) variable holds a Windows new-line \r\n sequence that
+ # messes up the executed export command which then reports that the
+ # passed variable name is incorrect. This is most likely due to the
+ # extra \r character getting interpreted as a part of the variable name.
+ #
+ # Several ideas pop to mind on how to fix this:
+ # * One way would be to separate the commands using the ; shell
+ # command separator. This seems like the quickest possible
+ # solution but I do not know whether this would break code on any
+ # platforms I I have no access to.
+ # * Another would be to not use the terminating $(nl) but that would
+ # require updating all the using code so it does not simply
+ # prepend this variable to its own commands.
+ # * I guess the cleanest solution would be to update Boost Jam to
+ # allow explicitly specifying \n & \r characters in its scripts
+ # instead of always relying only on the 'current OS native newline
+ # sequence'.
+ #
+ # Some code found to depend on this behaviour:
+ # * This Boost Build module.
+ # * __test__ rule.
+ # * path-variable-setting-command rule.
+ # * python.jam toolset.
+ # * xsltproc.jam toolset.
+ # * fop.jam toolset.
+ # (todo) (07.07.2008.) (Jurko)
         return "$(variable)=$(value)$(nl)export $(variable)$(nl)" ;
     }
 }
@@ -576,7 +604,14 @@
         $(<)-mkdir = true ;
 
         # Schedule the mkdir build action.
- MkDir1 $(<) ;
+ if [ os.name ] = NT
+ {
+ MkDir1-quick-fix-for-windows $(<) ;
+ }
+ else
+ {
+ MkDir1-quick-fix-for-unix $(<) ;
+ }
 
         # Prepare a Jam 'dirs' target that can be used to make the build only
         # construct all the target directories.
@@ -617,6 +652,21 @@
 }
 
 
+# (todo)
+# The following quick-fix actions should be replaced using the original MkDir1
+# action once Boost Jam gets updated to correctly detect different paths leading
+# up to the same filesystem target and triggers their build action only once.
+# (todo) (04.07.2008.) (Jurko)
+actions MkDir1-quick-fix-for-unix
+{
+ mkdir -p "$(<)"
+}
+actions MkDir1-quick-fix-for-windows
+{
+ if not exist "$(<)\\" mkdir "$(<)"
+}
+
+
 actions piecemeal together existing Clean
 {
     $(RM) "$(>)"


Boost-Commit 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