gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r332799 - in /gump/branches/Gump3: ./ fixture/metadata/ fixture/metadata/projects/ant.apache.org/ fixture/metadata/projects/gump.apache.org-fixture-svn/ fixture/metadata/repositories/ pygump/python/gump/ pygump/python/gump/engine/ pygump/py...
Date Sat, 12 Nov 2005 16:52:25 GMT
Author: leosimons
Date: Sat Nov 12 08:52:13 2005
New Revision: 332799

URL: http://svn.apache.org/viewcvs?rev=332799&view=rev
Log:
Fix a bunch of bugs in the new persistence code, and change the log reporter to report on
them properly. Also update the 'fixture' metadata with a basic bootstrapped ant package which
is used for running the <ant commands. The persistence stuff now seems to work properly
on this fixture.

Added:
    gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/
      - copied from r332780, gump/branches/Gump3/metadata/projects/ant.apache.org/
    gump/branches/Gump3/fixture/metadata/repositories/ant.xml
      - copied unchanged from r332780, gump/branches/Gump3/metadata/repositories/ant.xml
Removed:
    gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/ant.xml
Modified:
    gump/branches/Gump3/fixture/metadata/profile.xml
    gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/bootstrap-ant.xml
    gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/module.xml
    gump/branches/Gump3/fixture/metadata/projects/gump.apache.org-fixture-svn/gump-fixture-svn-project-ant-based-1.xml
    gump/branches/Gump3/giraffe-settings.sh
    gump/branches/Gump3/pygump/python/gump/config.py
    gump/branches/Gump3/pygump/python/gump/engine/loader.py
    gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
    gump/branches/Gump3/pygump/python/gump/engine/persistence.py
    gump/branches/Gump3/pygump/python/gump/model/util.py
    gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py
    gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py

Modified: gump/branches/Gump3/fixture/metadata/profile.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/fixture/metadata/profile.xml?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/fixture/metadata/profile.xml (original)
+++ gump/branches/Gump3/fixture/metadata/profile.xml Sat Nov 12 08:52:13 2005
@@ -15,6 +15,7 @@
 -->
 <profile name="gump3-test-fixture">
     <repositories>
+        <repository href="repositories/ant.xml"/>
         <repository href="repositories/gump.apache.org-fixture-cvs.xml"/>
         <repository href="repositories/gump.apache.org-fixture-svn.xml"/>
     </repositories>
@@ -25,6 +26,8 @@
         <module name="gump-fixture-svn" path="svnprojects">
             <repository name="gump-fixture-svn"/>
         </module>
+
+        <module href="projects/ant.apache.org/module.xml"/>
     </modules>
     <projects>
         <!-- please keep this list in "dependency order" for now -->

Modified: gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/bootstrap-ant.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/bootstrap-ant.xml?rev=332799&r1=332780&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/bootstrap-ant.xml (original)
+++ gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/bootstrap-ant.xml Sat Nov
12 08:52:13 2005
@@ -14,24 +14,12 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-  <project name="bootstrap-ant">
-    <!-- TODO: See http://issues.apache.org/jira/browse/GUMP-139 -->
+<project name="ant">
     <module name="ant"/>
-
+    <!-- introduce problem -->
     <script name="bootstrap"/>
-
-    <option project="jaxp"/>
-
     <home nested="bootstrap"/>
     <jar name="lib/ant.jar"/>
     <jar name="lib/ant-launcher.jar" id="ant-launcher"/>
-
-    <nag from="Gump Integration Build &lt;general@gump.apache.org&gt;"
-         to="dev@ant.apache.org"
-         subject="Bootstrap Failure - Ant">
-      <regexp pattern="/error/"/>
-      <regexp pattern="/Failed/"/>
-      <regexp />
-    </nag>
-  </project>
+</project>
 

Modified: gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/module.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/module.xml?rev=332799&r1=332780&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/module.xml (original)
+++ gump/branches/Gump3/fixture/metadata/projects/ant.apache.org/module.xml Sat Nov 12 08:52:13
2005
@@ -21,9 +21,8 @@
     Java based build tool
   </description>
 
-  <cvs repository="ant"/>
+  <repository name="ant"/>
 
-  <project href="projects/ant.apache.org/ant.xml"/>
   <project href="projects/ant.apache.org/bootstrap-ant.xml"/>
 </module>
 

Modified: gump/branches/Gump3/fixture/metadata/projects/gump.apache.org-fixture-svn/gump-fixture-svn-project-ant-based-1.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/fixture/metadata/projects/gump.apache.org-fixture-svn/gump-fixture-svn-project-ant-based-1.xml?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/fixture/metadata/projects/gump.apache.org-fixture-svn/gump-fixture-svn-project-ant-based-1.xml
(original)
+++ gump/branches/Gump3/fixture/metadata/projects/gump.apache.org-fixture-svn/gump-fixture-svn-project-ant-based-1.xml
Sat Nov 12 08:52:13 2005
@@ -21,6 +21,7 @@
     
     <ant target="gump" buildfile="ant.xml"/>
 
+    <depend project="ant" inherit="runtime"/>    
     <depend project="gump-fixture-svn-project-3"/>
     <depend project="gump-fixture-svn-project-dir-management-1"/>
 </project>

Modified: gump/branches/Gump3/giraffe-settings.sh
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/giraffe-settings.sh?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/giraffe-settings.sh (original)
+++ gump/branches/Gump3/giraffe-settings.sh Sat Nov 12 08:52:13 2005
@@ -6,6 +6,6 @@
 if [[ "$cygwin" == "true" ]]; then
   export JAVA_HOME=/cygdrive/c/j2sdk1.4.2_08
 else
-  export JAVA_HOME=/usr/lib/j2se/1.5
+  export JAVA_HOME=/usr/lib/j2se/1.4
 fi
 

Modified: gump/branches/Gump3/pygump/python/gump/config.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/config.py?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/config.py (original)
+++ gump/branches/Gump3/pygump/python/gump/config.py Sat Nov 12 08:52:13 2005
@@ -233,7 +233,8 @@
         if name == 'paths_pygump':
             return os.path.join(self.paths_home, "pygump")
         if name == 'paths_metadata':
-            return os.path.join(self.paths_home, "metadata")
+            return os.path.dirname(self.paths_workspace)
+            # nononono....return os.path.join(self.paths_home, "metadata")
         if name == 'do_mail':
             return self.mail_server and self.mail_server_port and self.mail_to and self.mail_from
         

Modified: gump/branches/Gump3/pygump/python/gump/engine/loader.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/loader.py?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/loader.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/loader.py Sat Nov 12 08:52:13 2005
@@ -76,9 +76,9 @@
     its parent and appended to the dropped_nodes list.
     """
     if node.getAttribute('type') == 'maven':
-	href = _parse_maven_projects( node, download_func, get_vfs )
+        href = _parse_maven_projects( node, download_func, get_vfs )
     else:
-    	href = node.getAttribute('href')
+            href = node.getAttribute('href')
     if href in found_hrefs:
         raise EngineError, \
               """Recursive inclusion because files refer to each other. This href leads to

Modified: gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/objectifier.py?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/objectifier.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/objectifier.py Sat Nov 12 08:52:13 2005
@@ -425,7 +425,7 @@
         command = Maven(project, target, buildfile=buildfile, basedir=basedir)
         _create_properties(command, cmd, log=log)
         _enable_debug(command, cmd)
-	project.add_command(command)
+        project.add_command(command)
 
 def _create_outputs(project, project_definition):    
     _create_work_outputs(project, project_definition)

Modified: gump/branches/Gump3/pygump/python/gump/engine/persistence.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/persistence.py?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/persistence.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/persistence.py Sat Nov 12 08:52:13 2005
@@ -64,6 +64,7 @@
 
 from gump.model import Workspace, Repository, Module, Project, Jar, Path
 from gump.model.util import get_project_directory, check_failure, check_skip
+from gump.model.util import mark_previous_build
 import os
 import shutil
 import copy
@@ -89,10 +90,14 @@
         
     def store_previous_builds(self, workspace):
         for project in workspace.projects.values():
-            if not check_failure(project) and not check_skip(project):
-                self.log.debug(
+            if check_failure(project) or\
+               check_skip(project) or \
+               hasattr(project, "use_atts_when_stopping_to_use_previous_build"):
+                    continue
+                
+            self.log.debug(
 "Project %s built okay, storing as the new 'last successful build'..." % project)
-                self.store_previous_build(project)
+            self.store_previous_build(project)
     
     def store_previous_build(self, project):
         if getattr(project, "failed", False):
@@ -111,6 +116,7 @@
         # okay we can shelve this...
         self.log.debug("Storing previous build for %s..." % project)
         storeable_project = self.extract_storeable_project(project)
+        mark_previous_build(storeable_project)
         
         # save files...
         self.store_previous_build_files(storeable_project)
@@ -147,8 +153,14 @@
             newproject.add_output(output)
         
         dontadd = ["module", "name", "path", "homedir", "dependencies", "dependees", "outputs",
\
-                   "commands", "shelf_dependencies", "has_stale_prereqs"]
-        for x in [x for x in dir(oldproject) if not x in dontadd]:
+                   "commands", "shelf_dependencies", "has_stale_prereqs", "failure_cause",
"stale_prereqs"]
+        for x in dir(oldproject):
+            if x in dontadd:
+                continue
+            if x.startswith("_"):
+                continue
+            if self.is_special_previous_build_attr(x):
+                continue
             att = getattr(oldproject, x)
             if callable(att):
                 continue
@@ -177,22 +189,24 @@
         project.previous_build = self.shelf[str(project.name)]
         
         # and include in the "new" tree
-        project.previous_build.module = project.module
-        ws = project.repository.module.workspace
+        #project.previous_build.module = project.module
+        #ws = project.module.repository.workspace
         
+        # The below causes the topsort to fail -- the number of indegrees
+        # changes improperly. ouch!
         # and link up dependencies
-        for depname in project.previous_build.shelf_dependencies:
+        #for depname in project.previous_build.shelf_dependencies:
             # note we create a situation here where an "old" project seems to depend
             # on a "new" one. This can sort-of be detected by the dependee belonging
             # to a different workspace, except we just changed that, above! So, lets
             # flag this dependency as "one from the past", at least...
-            if ws.projects.has_key(depname):
-                project.previous_build.add_dependency(ws.projects[depname])
-                setattr(project.previous_build.dependencies[-1], "previous_build", True)
-            else:
-                self.log.warn(
-"Previous build %s depends on project %s, which no longer exists! We're going to try and
ignore this..." % (
-    project.previous_build, depname))
+            #if ws.projects.has_key(depname):
+            #    project.previous_build.add_dependency(ws.projects[depname])
+            #    setattr(project.previous_build.dependencies[-1], "previous_build", True)
+            #else:
+            #    self.log.warn(
+#"Previous build %s depends on project %s, which no longer exists! We're going to try and
ignore this..." % (
+    #project.previous_build, depname))
 
     def has_previous_build(self, project):
         """Determine if information from a previous build was stored for this project."""
@@ -209,6 +223,9 @@
                         "use_atts_when_stopping_to_use_previous_build",
                         "previous_build"]
     
+    def is_not_a_previous_build_attr(self, name):
+        return name in ["module", "dependencies", "dependees"]
+    
     def use_previous_build(self, project):
         # algorithm should check this!
         assert self.has_previous_build(project)
@@ -230,35 +247,39 @@
     
         # we'll replace all current members with the "old" members
         import inspect
-        members = inspect.getmembers(project)
+        newmembers = inspect.getmembers(project)
         oldmembers = inspect.getmembers(project.previous_build)
         
         # remember...
-        project.use_atts_when_stopping_to_use_previous_build = members
+        project.use_atts_when_stopping_to_use_previous_build = newmembers
     
         # we'll delete all current members that weren't there before
         temporarily_delete_attrs = []
-        for (newname, newvalue) in members:
+        for (newname, newvalue) in newmembers:
+            if self.is_not_a_previous_build_attr(newname):
+                continue
             found_in_old = False
             for (oldname, oldvalue) in oldmembers:
                 if oldname == newname:
                     found_in_old = True
                     break
             
-            if not found_in_old and not is_special_previous_build_attr(attname):
-                delattr(project, attname)
+            if not found_in_old and not self.is_special_previous_build_attr(newname):
+                delattr(project, newname)
         
         # we'll have to remove the members on the old project but not
         # on the new one
         temporarily_add_attrs = []
         for (oldname, oldvalue) in oldmembers:
+            if self.is_not_a_previous_build_attr(newname):
+                continue
             found_in_new = False
             for (newname, newvalue) in newmembers:
                 if newname == oldname:
                     found_in_new = True
                     break
             
-            if not found_in_new and not is_special_previous_build_attr(attname):
+            if not found_in_new and not self.is_special_previous_build_attr(oldname):
                 temporarily_add_attrs += oldname
         
         # the "failed" member is a special case since we set it below
@@ -270,7 +291,9 @@
     
         # move all old project members to the new one
         for (name, value) in oldmembers:
-            if is_special_previous_build_attr(name):
+            if self.is_not_a_previous_build_attr(newname):
+                continue
+            if self.is_special_previous_build_attr(name):
                 continue
             setattr(project, name, value)
             

Modified: gump/branches/Gump3/pygump/python/gump/model/util.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/model/util.py?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/model/util.py (original)
+++ gump/branches/Gump3/pygump/python/gump/model/util.py Sat Nov 12 08:52:13 2005
@@ -74,6 +74,16 @@
     assert isinstance(model_element, Project)
     return getattr(model_element, "has_stale_prereqs", False)
 
+def mark_previous_build(model_element):
+    """MArk whether a project is a "previous build"."""
+    assert isinstance(model_element, Project)
+    setattr(model_element, "previous_build", True)
+
+def check_previous_build(model_element):
+    """Determine whether a project is a "previous build"."""
+    assert isinstance(model_element, Project)
+    return getattr(model_element, "previous_build", False)
+
 def mark_failure(model_element, cause):
     """Mark a model element as "failed"."""
     assert isinstance(model_element, ModelObject)
@@ -81,6 +91,14 @@
     if not hasattr(model_element, "failure_cause"):
         model_element.failure_cause = []
     model_element.failure_cause.append(cause)
+
+def mark_stale_prereq(model_element, stale_prereq):
+    """Mark a project with "stale prereq"."""
+    assert isinstance(model_element, Project)
+    model_element.has_stale_prereqs = True
+    if not hasattr(model_element, "stale_prereqs"):
+        model_element.stale_prereqs = []
+    model_element.stale_prereqs.append(stale_prereq)
 
 def check_failure(model_element):
     """Determine whether a model element has "failed"."""

Modified: gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/java/builder.py Sat Nov 12 08:52:13 2005
@@ -47,8 +47,8 @@
         self.debug = debug
 
     def _do_maven(self, project, maven):
-	# pass
-	#environment
+        # pass
+        #environment
         maven.env['CLASSPATH'] = os.pathsep.join(maven.classpath)
         self.log.debug("        CLASSPATH is '%s%s%s'" % \
                        (ansicolor.Blue, maven.env['CLASSPATH'], ansicolor.Black))
@@ -56,13 +56,13 @@
         maven.env['PATH'] = maven.path
         self.log.debug("        PATH is '%s%s%s'" % \
                        (ansicolor.Blue, maven.env['PATH'], ansicolor.Black))
-	# working directory
+        # working directory
         projectpath = get_project_directory(project)
         if maven.basedir:
             projectpath = os.path.join(projectpath, maven.basedir)
-	#command line
-	args = ["maven"]
-	if maven.target: args += [maven.target] 
+        #command line
+        args = ["maven"]
+        if maven.target: args += [maven.target] 
         self._do_run_command(maven, args, projectpath, no_cleanup=True)
         
 class AntPlugin(BuilderPlugin):

Modified: gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py?rev=332799&r1=332798&r2=332799&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py Sat Nov 12 08:52:13 2005
@@ -19,7 +19,7 @@
 
 from gump.plugins import AbstractPlugin
 from gump.model import Module, Project, Dependency, Command
-from gump.model.util import check_skip, check_failure, check_installed_package
+from gump.model.util import check_skip, check_failure, check_installed_package, check_previous_build
 from gump.model.util import check_stale_prereq, get_failure_causes, get_root_cause
 from gump.engine.algorithm import ExceptionInfo
 from gump.util import ansicolor
@@ -116,6 +116,8 @@
             self.wr('  Run started:  %s' % workspace.run_start)
             self.wr('  Run finished: %s' % workspace.run_end)
             self.wr('')
+            
+        unvisited = getattr(workspace, "unvisited", [])
         
         failed        = 0
         prereq_failed = 0
@@ -123,8 +125,11 @@
         packaged      = 0
         success       = 0
         cycled        = 0
-        total = len(workspace.projects)
+        total = len(workspace.projects) + len(unvisited)
         for project in workspace.projects.values():
+            if project in unvisited:
+                cycled += 1
+                continue
             if check_failure(project):
                 prereq_fail = False
                 for cause in get_failure_causes(project):
@@ -142,10 +147,6 @@
             if check_installed_package(project):
                 packaged += 1
                 continue
-            if hasattr(workspace, "unvisited"):
-                if project in workspace.unvisited:
-                    cycled += 1
-                    continue
             if check_stale_prereq(project):
                 prereq_failed += 1
                 continue
@@ -199,20 +200,10 @@
                 self.wr('  %s%s: CYCLIC DEPENDENCY%s' % (ansicolor.Bright_Red, project, ansicolor.Black))
  
     def visit_project(self, project):
-        if check_skip(project):
-            self.wr('  %s%s: SKIPPED%s' % (ansicolor.Blue, project, ansicolor.Black))
-            return
-        
-        if check_installed_package(project):
-            self.wr('  %s%s: PACKAGED%s' % (ansicolor.Purple, project, ansicolor.Black))
-            return
-        
-        if not check_failure(project):
-            if check_stale_prereq(project):
-                self.wr('  %s%s: STALE PREREQ%s' % (ansicolor.Yellow, project, ansicolor.Black))
-            else:
-                self.wr('  %s%s: OK%s' % (ansicolor.Green, project, ansicolor.Black))
-        else:
+        if check_failure(project):
+            if check_previous_build(project):
+                project = project.previous_buid
+
             firsterror = '  %s%s: FAIL%s' % (ansicolor.Red, project, ansicolor.Black+ansicolor.Black)
 
             causes = get_failure_causes(project)
@@ -247,6 +238,21 @@
                         self.wr("%s%s caused by %s%s" % (ansicolor.Yellow, indent, real_elem,
ansicolor.Black))
                         
                     indent += "  "
+            return
+            
+        if check_skip(project) and not check_previous_build(project):
+            self.wr('  %s%s: SKIPPED%s' % (ansicolor.Blue, project, ansicolor.Black))
+            return
+        
+        if check_installed_package(project) and not check_previous_build(project):
+            self.wr('  %s%s: PACKAGED%s' % (ansicolor.Purple, project, ansicolor.Black))
+            return
+        
+        if check_stale_prereq(project):
+            self.wr('  %s%s: STALE PREREQ%s' % (ansicolor.Yellow, project, ansicolor.Black))
+            return
+        
+        self.wr('  %s%s: OK%s' % (ansicolor.Green, project, ansicolor.Black))
                     
     def finalize(self, workspace):
         self.wr('  ======================================================================================')



Mime
View raw message