Boost logo

Boost-Commit :

From: troy_at_[hidden]
Date: 2008-06-08 14:04:01


Author: troy
Date: 2008-06-08 14:04:00 EDT (Sun, 08 Jun 2008)
New Revision: 46251
URL: http://svn.boost.org/trac/boost/changeset/46251

Log:

- Add cmake variables reported to server when in build-slave mode:
  BOOST_BUILD_SLAVE_DETAILS_FILE (various details)
  BOOST_BUILD_SLAVE_CONTACT_INFO (email address to contact with questions
                                  about the build)

- Change 'hostname' to better 'fqdn'

- Report wallclock time per build step

- Execute build steps as PYTHON_EXECUTABLE script.py ...
  Instead of via hash-bang, for configurability of python and windows
  compatibility.

Text files modified:
   branches/CMake/release/tools/build/CMake/BoostBuildSlave.cmake | 22 ++++++++++++++--------
   branches/CMake/release/tools/build/CMake/BoostTesting.cmake | 6 +++---
   branches/CMake/release/tools/build/CMake/boost_build_slave.py.in | 16 +++++++++++++++-
   branches/CMake/release/tools/build/CMake/info.py.in | 14 ++++++++------
   branches/CMake/release/tools/build/CMake/marshal.py.in | 13 ++++++++-----
   branches/CMake/release/tools/build/CMake/start.py.in | 8 +++++---
   6 files changed, 53 insertions(+), 26 deletions(-)

Modified: branches/CMake/release/tools/build/CMake/BoostBuildSlave.cmake
==============================================================================
--- branches/CMake/release/tools/build/CMake/BoostBuildSlave.cmake (original)
+++ branches/CMake/release/tools/build/CMake/BoostBuildSlave.cmake 2008-06-08 14:04:00 EDT (Sun, 08 Jun 2008)
@@ -17,6 +17,12 @@
 set(BOOST_BUILD_SLAVE_TIMEOUT 120
   CACHE STRING "Seconds until build slave times out any individual build step")
 
+set(BOOST_BUILD_SLAVE_DETAILS_FILE "slave-description.txt"
+ CACHE FILEPATH "Path to file, absolute or relative to build directory, containing descriptive text about the build (configuration peculiarities, etc) to be reported to the server")
+
+set(BOOST_BUILD_SLAVE_CONTACT_INFO "buildmeister_at_[hidden]"
+ CACHE STRING "Contact information regarding this build")
+
 message(STATUS "Configuring test/compile drivers")
   
 if(CMAKE_VERBOSE_MAKEFILE)
@@ -53,16 +59,16 @@
   # Redirect various build steps
   #
   set(CMAKE_CXX_COMPILE_OBJECT
- "${BOOST_TEST_DRIVER} <CMAKE_CURRENT_BINARY_DIR> cxx_compile_object <OBJECT> ${CMAKE_CXX_COMPILE_OBJECT}")
+ "${PYTHON_EXECUTABLE} ${BOOST_TEST_DRIVER} <CMAKE_CURRENT_BINARY_DIR> cxx_compile_object <OBJECT> ${CMAKE_CXX_COMPILE_OBJECT}")
 
   set(CMAKE_CXX_CREATE_SHARED_LIBRARY
- "${BOOST_TEST_DRIVER} <CMAKE_CURRENT_BINARY_DIR> create_shared_library <TARGET> ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
+ "${PYTHON_EXECUTABLE} ${BOOST_TEST_DRIVER} <CMAKE_CURRENT_BINARY_DIR> create_shared_library <TARGET> ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
     
   set(CMAKE_CXX_CREATE_STATIC_LIBRARY
- "${BOOST_TEST_DRIVER} <CMAKE_CURRENT_BINARY_DIR> create_static_library <TARGET> ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
+ "${PYTHON_EXECUTABLE} ${BOOST_TEST_DRIVER} <CMAKE_CURRENT_BINARY_DIR> create_static_library <TARGET> ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
 
   set(CMAKE_CXX_LINK_EXECUTABLE
- "${BOOST_TEST_DRIVER} <CMAKE_CURRENT_BINARY_DIR> link_executable <TARGET> ${CMAKE_CXX_LINK_EXECUTABLE}")
+ "${PYTHON_EXECUTABLE} ${BOOST_TEST_DRIVER} <CMAKE_CURRENT_BINARY_DIR> link_executable <TARGET> ${CMAKE_CXX_LINK_EXECUTABLE}")
 
   #
   # Custom targets for talking to the server via xmlrpc
@@ -72,7 +78,7 @@
   # Get us a new build id from the server
   #
   add_custom_target(slave-start
- COMMAND ${BOOST_BUILD_SLAVE_PYTHONPATH}/start.py
+ COMMAND ${PYTHON_EXECUTABLE} ${BOOST_BUILD_SLAVE_PYTHONPATH}/start.py
     COMMENT "Slave starting build"
     )
 
@@ -80,7 +86,7 @@
   # Tell server we're done... it'll update finish time in the db.
   #
   add_custom_target(slave-finish
- COMMAND ${BOOST_BUILD_SLAVE_PYTHONPATH}/finish.py
+ COMMAND ${PYTHON_EXECUTABLE} ${BOOST_BUILD_SLAVE_PYTHONPATH}/finish.py
     COMMENT "Slave finishing build"
     )
 
@@ -88,7 +94,7 @@
   # Local only: show what we report to server (our platform description, toolset, etc)
   #
   add_custom_target(slave-info
- COMMAND ${BOOST_BUILD_SLAVE_PYTHONPATH}/info.py
+ COMMAND ${PYTHON_EXECUTABLE} ${BOOST_BUILD_SLAVE_PYTHONPATH}/info.py
     COMMENT "Print slave info"
     )
 
@@ -103,7 +109,7 @@
   if(BOOST_BUILD_SLAVE)
     add_custom_command(TARGET ${PARENT_TARGET}
       POST_BUILD
- COMMAND ${BOOST_BUILD_SLAVE_PYTHONPATH}/post.py ${PROJECT_NAME_} ${PARENT_TARGET} ${BUILD_OR_TEST} ${LOGDIR}
+ COMMAND ${PYTHON_EXECUTABLE} ${BOOST_BUILD_SLAVE_PYTHONPATH}/post.py ${PROJECT_NAME_} ${PARENT_TARGET} ${BUILD_OR_TEST} ${LOGDIR}
       COMMENT "Submitting results for '${BUILD_OR_TEST}' of ${PARENT_TARGET} in ${PROJECT_NAME_}"
       )
     set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${LOGDIR}/Log.marshal)

Modified: branches/CMake/release/tools/build/CMake/BoostTesting.cmake
==============================================================================
--- branches/CMake/release/tools/build/CMake/BoostTesting.cmake (original)
+++ branches/CMake/release/tools/build/CMake/BoostTesting.cmake 2008-06-08 14:04:00 EDT (Sun, 08 Jun 2008)
@@ -219,7 +219,7 @@
       add_custom_target(${BOOST_TEST_TESTNAME})
 
       set(THIS_TEST_PREFIX_ARGS
- ${BOOST_TEST_DRIVER} ${CMAKE_CURRENT_BINARY_DIR} ${BOOST_TEST_TAG} ${testname}
+ ${PYTHON_INTERPRETER} ${BOOST_TEST_DRIVER} ${CMAKE_CURRENT_BINARY_DIR} ${BOOST_TEST_TAG} ${testname}
         )
 
       add_custom_command(TARGET ${BOOST_TEST_TESTNAME}
@@ -285,7 +285,7 @@
     endforeach(DIR ${BOOST_TEST_INCLUDE_DIRS})
 
     set(THIS_TEST_PREFIX_ARGS
- ${BOOST_TEST_DRIVER} ${CMAKE_CURRENT_BINARY_DIR} ${BOOST_TEST_TAG} ${testname}
+ ${PYTHON_INTERPRETER} ${BOOST_TEST_DRIVER} ${CMAKE_CURRENT_BINARY_DIR} ${BOOST_TEST_TAG} ${testname}
       )
   
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BOOST_TEST_TESTNAME}.${CMAKE_CXX_OUTPUT_EXTENSION}
@@ -333,7 +333,7 @@
   if(BOOST_TEST_OKAY)
 
     set(THIS_TEST_PREFIX_ARGS
- ${BOOST_TEST_DRIVER} ${CMAKE_CURRENT_BINARY_DIR} test_link ${testname}
+ ${PYTHON_INTERPERTER} ${BOOST_TEST_DRIVER} ${CMAKE_CURRENT_BINARY_DIR} test_link ${testname}
       )
     
     #

Modified: branches/CMake/release/tools/build/CMake/boost_build_slave.py.in
==============================================================================
--- branches/CMake/release/tools/build/CMake/boost_build_slave.py.in (original)
+++ branches/CMake/release/tools/build/CMake/boost_build_slave.py.in 2008-06-08 14:04:00 EDT (Sun, 08 Jun 2008)
@@ -17,11 +17,13 @@
 repo_path = "@CMAKE_SOURCE_DIR@"
 client = pysvn.Client()
 svn_entry = client.info(repo_path)
-hostname = socket.gethostname()
+fqdn = socket.getfqdn()
 uname = os.uname()
 toolset = "@BOOST_TOOLSET@"
 
 timeout_seconds = @BOOST_BUILD_SLAVE_TIMEOUT@
+slave_details_file = "@BOOST_BUILD_SLAVE_DETAILS_FILE@"
+contact_info = "@BOOST_BUILD_SLAVE_CONTACT_INFO@"
 
 xmlrpc_url = "@BOOST_BUILD_SLAVE_SUBMIT_URL@"
 
@@ -39,4 +41,16 @@
     f.write(str(build_id))
     f.close()
 
+def details():
+ if os.path.isabs(slave_details_file):
+ thefile = slave_details_file
+ else:
+ thefile = os.path.join("@CMAKE_BINARY_DIR@", slave_details_file)
+
+ if os.path.exists(thefile):
+ f = open(thefile)
+ txt = f.read()
+ else:
+ txt = "Build slave details file @BOOST_BUILD_SLAVE_DETAILS_FILE@ not found."
 
+ return txt

Modified: branches/CMake/release/tools/build/CMake/info.py.in
==============================================================================
--- branches/CMake/release/tools/build/CMake/info.py.in (original)
+++ branches/CMake/release/tools/build/CMake/info.py.in 2008-06-08 14:04:00 EDT (Sun, 08 Jun 2008)
@@ -15,10 +15,12 @@
 sys.path.append("@BOOST_BUILD_SLAVE_PYTHONPATH@")
 from boost_build_slave import *
 
-print 'Url:', svn_entry.url, "at rev", svn_entry.revision.number
-print 'Hostname:', hostname
-print 'Uname:', uname
-print 'Toolset:', toolset
-print 'Build ID:', build_id
-
+print ' Url:', svn_entry.url, "at rev", svn_entry.revision.number
+print ' FQDN:', fqdn
+print ' Uname:', uname
+print ' Toolset:', toolset
+print ' Build ID:', build_id
+print ' Contact:', contact_info
+pref = '\n '
+print ' Details: ' + pref.join(details().splitlines()), '\n\n'
 

Modified: branches/CMake/release/tools/build/CMake/marshal.py.in
==============================================================================
--- branches/CMake/release/tools/build/CMake/marshal.py.in (original)
+++ branches/CMake/release/tools/build/CMake/marshal.py.in 2008-06-08 14:04:00 EDT (Sun, 08 Jun 2008)
@@ -33,13 +33,13 @@
 returncode = None
 ex = None
 try:
- start = datetime.datetime.now()
+ starttime = datetime.datetime.now()
     subproc = Popen(argv, stdout=PIPE, stderr=PIPE)
     returncode = subproc.poll()
     while returncode is None:
         time.sleep(1)
         now = datetime.datetime.now()
- if (now - start).seconds > timeout_seconds:
+ if (now - starttime).seconds > timeout_seconds:
             os.kill(subproc.pid, signal.SIGKILL)
             os.waitpid(-1, os.WNOHANG)
             e = OSError()
@@ -52,11 +52,13 @@
 except EnvironmentError, e:
     ex = e
 
+duration = datetime.datetime.now() - starttime
+
 #
-# Collect, possibly xmlize, and print subprocess return info
+# Collect and store subprocess info
 #
-
-result = { 'expect_fail' : expect_fail }
+result = { 'expect_fail' : expect_fail,
+ 'wallclock_duration' : duration.seconds + duration.microseconds * 10**-6 }
 
 if not ex:
     
@@ -69,6 +71,7 @@
         print "*** stderr:" + result['stderr']
         
 else:
+
     result['errno'] = ex.errno
     result['filename'] = ex.filename
     result['message'] = ex.message

Modified: branches/CMake/release/tools/build/CMake/start.py.in
==============================================================================
--- branches/CMake/release/tools/build/CMake/start.py.in (original)
+++ branches/CMake/release/tools/build/CMake/start.py.in 2008-06-08 14:04:00 EDT (Sun, 08 Jun 2008)
@@ -16,7 +16,7 @@
 from boost_build_slave import *
 
 print 'Url:', svn_entry.url, "at rev", svn_entry.revision.number
-print 'Hostname:', hostname
+print 'FQDN:', fqdn
 print 'Uname:', uname
 print 'Toolset:', toolset
 
@@ -30,7 +30,9 @@
                                    'sys_release' : uname[2],
                                    'sys_version' : uname[3],
                                    'sys_machine' : uname[4],
- 'hostname' : hostname,
- 'toolset' : toolset})
+ 'fqdn' : fqdn,
+ 'toolset' : toolset,
+ 'contact' : contact_info,
+ 'details' : details() })
 
 set_build_id(build_id)


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