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

List:       kde-commits
Subject:    playground/devtools/waf/wafadmin
From:       Thomas Nagy <tnagyemail-mail () yahoo ! fr>
Date:       2006-07-12 18:19:54
Message-ID: 1152728394.803022.14957.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 561615 by tnagy:

Do not rebuild the same files again.


 M  +18 -6     Build.py  
 M  +24 -11    Task.py  


--- trunk/playground/devtools/waf/wafadmin/Build.py #561614:561615
@@ -155,7 +155,7 @@
 			dto.reset()
 			dto.update_build(self)
 
-		self.dump()
+		#self.dump()
 			
 	# store the data structures on disk, retrieve with self._load()
 	def _store(self):
@@ -183,6 +183,9 @@
 		os.chdir(self.m_bdir)
 
 		Object.flush()
+
+		#self.dump()
+
 		if Params.g_maxjobs <=1:
 			generator = Runner.JobGenerator(self)
 			executor = Runner.Serial(generator)
@@ -199,7 +202,7 @@
 		#finally:
 		#	os.chdir( self.m_srcnode.abspath() )
 
-		self.dump()
+		#self.dump()
 
 		os.chdir( self.m_srcnode.abspath() )
 		return ret
@@ -340,6 +343,8 @@
 				files = self._scan_path(src_dir_node, sub_path, src_dir_node.m_build, variant)
 				src_dir_node.m_build = files
 			except OSError:
+				debug("osError on " + sub_path)
+
 				# listdir failed, remove all sigs of nodes
 				dict = self.m_tstamp_variants[variant]
 				for node in src_dir_node.m_build:
@@ -347,6 +352,7 @@
 						dict.__delitem__(node)
 				os.makedirs(sub_path)
 				src_dir_node.m_build = []
+		self.m_scanned_folders.append(src_dir_node)
 
 
 	# tell if a node has changed, to update the cache
@@ -404,8 +410,8 @@
 					break
 				i += 1
 			if i < l_len:
-				if i>1:
-					l_names = l_names[:i-1]+l_names[i+1:]
+				if i>0:
+					l_names = l_names[:i]+l_names[i+1:]
 				else:
 					l_names = l_names[1:]
 
@@ -462,8 +468,8 @@
 					break
 				i += 1
 			if i < l_len:
-				if i>1:
-					l_names = l_names[:i-1]+l_names[i+1:]
+				if i>0:
+					l_names = l_names[:i]+l_names[i+1:]
 				else:
 					l_names = l_names[1:]
 			else:
@@ -471,6 +477,12 @@
 
 		# remove the stamps of the nodes that no longer exist in the build dir
 		for node in l_rm:
+
+			print "\nremoving the timestamp of ", node, node.m_name
+			print node.m_parent.m_build
+			print l_names_read
+			print l_names
+
 			# TODO remove this check in the future
 			if not i_variant in self.m_tstamp_variants: self.m_tstamp_variants[i_variant] = \
{}  if node in self.m_tstamp_variants[i_variant]:
--- trunk/playground/devtools/waf/wafadmin/Task.py #561614:561615
@@ -89,6 +89,9 @@
 	def update_stat(self):
 		tree = Params.g_build
 		env  = self.m_env
+
+		s = self.signature()
+
 		for node in self.m_outputs:
 			#trace("updating_stat of node "+node.abspath())
 			#node.m_tstamp = os.stat(node.abspath()).st_mtime
@@ -97,10 +100,9 @@
 			if node in node.m_parent.m_files: variant = 0
 			else: variant = self.m_env.m_variant
 
-			Params.g_build.m_tstamp_variants[variant][node] = \
                Params.h_file(node.abspath(env))
-
-			if node.get_sig() == self.signature():
-				error("NODE ALREADY TAGGED - GRAVE ERROR")
+			if node in tree.m_tstamp_variants[variant]:
+				print "variant is ", variant
+				print "self sig is ", Params.vsig(tree.m_tstamp_variants[variant][node])
 			tree.m_tstamp_variants[variant][node] = self.signature()
 		self.m_executed=1
 
@@ -119,16 +121,27 @@
 		self.m_dep_sig = self.get_deps_signature()
 		sg = self.signature()
 
+		node = self.m_outputs[0]
+
+		if node in node.m_parent.m_files: variant = 0
+		else: variant = self.m_env.m_variant
+
+
+		if not node in Params.g_build.m_tstamp_variants[variant]:
+			debug("task must run, node does not exist"+str(node))
+			return 1
+
+		outs = Params.g_build.m_tstamp_variants[variant][node]
+
+		a1 = Params.vsig(sg)
+		a2 = Params.vsig(outs)
+		
 		# DEBUG
-		#error("signature is "+str(sg)+" while node signature is \
"+str(self.m_outputs[0].get_sig())) +		debug("task must run ? signature is %s while \
node signature is %s" % (a1, a2))  
-		# check if the file actually exists - expect a moderate slowdown
-		for f in self.m_outputs:
-			if not os.path.exists(f.bldpath(self.m_env)):
-				return 1
+		if sg != outs:
+			print "task must run"
 
-		if sg != self.m_outputs[0].get_sig():
-			trace("task %s must run %s %s" % (str(self.m_idx), Params.vsig(sg), \
Params.vsig(self.m_outputs[0].get_sig()) ))  return 1
 		return 0
 


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

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