[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dart
Subject:    [Dart] Shared source trees
From:       Amitha Perera <perera () cs ! rpi ! edu>
Date:       2002-01-22 0:48:09
Message-ID: 20020121194809.F2632 () cs ! rpi ! edu
[Download RAW message or body]

Hi all

[I apologise if this is the wrong forum for this message; please let me
know which would be a better forum.]

I've made a small change to the client to allow builds to share the
source trees while maintaining the update information. Basically, one
build will be the "primary" build, and will execute the cvs
commands. The other builds will simply copy the Update.xml from the
primary build, and assume the source tree matches that. This means
that each model should probably have its own source tree, but
different OS/compiler combinations for a given model can share the
source.

[The way I have it, it's okay to share the source over different
models, too, as long as all the builds for one model complete before
the primary build for another model starts. Otherwise, the source
trees won't be in sync.]

My tests seem to indicate that nothing breaks, and the change is
compatible with older clients and servers.

To use shared sources, one simply sets
SHARED_SOURCE_PRIMARY_BUILD_BASE to the primary build directory, and
everything goes from there.

I've included the relevant diffs to the bottom of this email. If it is
seen as worthy, could someone do the appropriate patching? (Or else
grant me write access to patch it myself.)

Amitha.


Index: DashboardManager.tcl
===================================================================
RCS file: /Dart/cvsroot/Dart/Source/Client/DashboardManager.tcl,v
retrieving revision 1.49
diff -u -r1.49 DashboardManager.tcl
--- DashboardManager.tcl	2002/01/18 18:47:16	1.49
+++ DashboardManager.tcl	2002/01/22 00:42:18
@@ -73,6 +73,9 @@
 # Turn buffering off, because I'm too lazy to add flush commands
 fconfigure stdout -buffering none
 
+# So that older configurations don't break
+set Dart(SharedSourcePrimaryBuildBase) ""
+
 set Usage {usage: $argv0 <config file> <Model> <Command1> [Command2]...}
 if { $argc < 3 } \
 {
@@ -170,23 +173,53 @@
       # If we don't have an existing update, make one
       if { ![file exists [file join $BuildStampDir Update.xml]] } \
       {
-	# Actually do the update
-	# If the Model is Experimental or Continuous, will do an update 
-        # against the latest sources
-	# If the Model is Nightly, will update to the previous day's nightly snapshot.
-        puts "\tBuilding Update.xml"
-	set updateStatus [catch {exec $TclshCommand [file join $UtilitiesDir Update.tcl] \
[lindex $argv 0] $Model $NightlyDateTimeStamp Client > [file join $BuildStampDir XML \
                Update.xml]} updateResult]
-	#puts $updateStatus
-	#puts $updateResult
-
-	# If model is Continuous and no code changes are detected, then skip
-	# the rest of the commands
-	if { $Model == "Continuous" } {
-	    if {$updateStatus == 1} {
-		puts "\tNo files changed, skipping remaining commands."
-		exit 1
-	    }
-	}
+        # If we have a shared source build, use the update information from
+        # the last build, and assume the source files match that update.
+        # Otherwise, actually do the update.
+        set lastUpdateFile [file join $TestingBaseDir "LastUpdate-${Model}.xml"]
+        if { $Dart(SharedSourcePrimaryBuildBase) != "" } \
+        {
+          # If the file doesn't exist, assume the last update returned
+          # status 1 (no files updated).
+          if { [file exists [file join $Dart(SharedSourcePrimaryBuildBase) \
$lastUpdateFile]] } \ +          {
+            puts "\tCopying Update.xml from $Dart(SharedSourcePrimaryBuildBase)"
+            file copy [file join $Dart(SharedSourcePrimaryBuildBase) \
$lastUpdateFile] [file join $BuildStampDir XML Update.xml] +            set \
updateStatus 0 +          } \
+          else \
+          {
+            puts "\tNo latest update in $Dart(SharedSourcePrimaryBuildBase). \
Assuming no update." +            set updateStatus 1
+          }
+        } \
+        else \
+        {
+          # If the Model is Experimental or Continuous, will do an update 
+          # against the latest sources
+          # If the Model is Nightly, will update to the previous day's nightly \
snapshot. +          puts "\tBuilding Update.xml"
+          set updateStatus [catch {exec $TclshCommand [file join $UtilitiesDir \
Update.tcl] [lindex $argv 0] $Model $NightlyDateTimeStamp Client > [file join \
$BuildStampDir XML Update.xml]} updateResult] +          #puts $updateStatus
+          #puts $updateResult
+
+          # Copy the last update in case this is the primary build and some
+          # other build is sharing the same sources.
+          if {$updateStatus != 1} {
+            file copy [file join $BuildStampDir XML Update.xml] $lastUpdateFile
+          } else {
+            file delete $lastUpdateFile
+          }
+        }
+
+        # If model is Continuous and no code changes are detected, then skip
+        # the rest of the commands
+        if { $Model == "Continuous" } {
+            if {$updateStatus == 1} {
+                puts "\tNo files changed, skipping remaining commands."
+                exit 1
+            }
+        }
       }
     }
     DashboardStart \

Index: Utility.conf.in
===================================================================
RCS file: /Dart/cvsroot/Dart/Source/Client/Utility.conf.in,v
retrieving revision 1.21
diff -u -r1.21 Utility.conf.in
--- Utility.conf.in	2002/01/16 19:57:57	1.21
+++ Utility.conf.in	2002/01/22 00:42:18
@@ -93,6 +93,12 @@
 
 SetPathConfiguration Xalan [list [file join @DART_ROOT@ Source Server xalan \
xalan.jar]]  
+# If multiple builds are sharing the same source tree, unset this in
+# the primary build and set it in all the secondary builds. The primary
+# build will do the real update, and the secondary builds will copy the
+# update data, and won't execuate any cvs commands.
+SetPathConfiguration SharedSourcePrimaryBuildBase [list \
@SHARED_SOURCE_PRIMARY_BUILD_BASE@] +
 SetConfiguration Motd [list @MOTD@] 
 
 set XMLHeader {<?xml version="1.0" encoding="UTF-8"?>}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic