DPDEF142718 Incremental rebuild fails if dependent files deleted (resurrection through merge). fix
authorJon Chatten
Mon, 15 Feb 2010 15:17:20 +0000
branchfix
changeset 229 b719d614d652
parent 209 604f2aceff59 (diff)
parent 228 cfeb5b628048 (current diff)
child 230 3d05ccc51d1a
DPDEF142718 Incremental rebuild fails if dependent files deleted (resurrection through merge).
sbsv2/raptor/test/smoke_suite/basic_dependency.py
--- a/sbsv2/raptor/bin/sbs_filter.py	Thu Feb 11 11:47:39 2010 +0000
+++ b/sbsv2/raptor/bin/sbs_filter.py	Mon Feb 15 15:17:20 2010 +0000
@@ -71,7 +71,7 @@
 	while line:
 		line = sys.stdin.readline()
 		the_raptor.out.write(line)
-except:
+except Exception,e:
 	sys.stderr.write("error: problem while filtering: %s\n" % str(e))
 	traceback.print_exc()
 	sys.exit(1)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/python/plugins/filter_checkcomp.py	Mon Feb 15 15:17:20 2010 +0000
@@ -0,0 +1,70 @@
+#
+# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+# Filter class for doing a Check operation but also prints component information.
+#
+
+import os
+import sys
+import re
+import filter_interface
+import filter_what
+
+class FilterCheckComp(filter_what.FilterWhat):
+
+	def __init__(self):
+		super(FilterCheckComp, self).__init__()
+		self.check = True
+
+	def write(self, text):
+		"process some log text"
+		ok = True
+		
+		for line in text.splitlines():
+			ok = filter_what.FilterWhat.write(self, line)
+			if not ok:
+				break
+		self.ok = ok
+		return self.ok
+	
+	def start_bldinf(self, bldinf):
+		dir = None
+		if "win" in self.buildparameters.platform:
+			dir = os.path.dirname(bldinf.replace("/","\\"))
+			dir = os.path.splitdrive(dir)[1]
+		else:
+			dir = os.path.dirname(bldinf)
+
+		self.outfile.write("=== %s == %s\n" % (dir, dir))
+		self.outfile.write("=== check == %s\n" % (dir))
+		self.outfile.write("-- sbs_filter --filters=FilterCheckComp\n++ Started at Thu Feb 11 10:05:19 2010\nChdir %s\n" % dir)
+
+	def end_bldinf(self):
+		self.outfile.write("++ Finished at Thu Feb 11 10:05:20 2010\n")
+
+	def close(self):
+		self.outfile.write("++ Finished at Thu Feb 11 10:05:20 2010\n")
+		self.outfile.write("=== check finished Thu Feb 11 10:05:20 2010\n")
+
+	def open(self, build_parameters):
+		t = filter_what.FilterWhat.open(self, build_parameters)
+		if t:
+			self.outfile.write("\n===-------------------------------------------------\n")
+			self.outfile.write("=== check\n")
+			self.outfile.write("===-------------------------------------------------\n")
+			self.outfile.write("=== check started Thu Feb 11 10:02:21 2010\n")
+
+		self.path_prefix_to_strip = os.path.abspath(build_parameters.epocroot)
+		self.path_prefix_to_add_on = build_parameters.incoming_epocroot
+		return t
--- a/sbsv2/raptor/python/plugins/filter_what.py	Thu Feb 11 11:47:39 2010 +0000
+++ b/sbsv2/raptor/python/plugins/filter_what.py	Mon Feb 15 15:17:20 2010 +0000
@@ -34,19 +34,27 @@
 		"""Use chars between enclosing tags ("<>", "''", etc)
 				start = opening tag, so the line we need
 				actually starts at 'start + 1' """
+
+		abs_filename = line[(start + 1):end]
+		filename = abs_filename
+
+		# Adjust drive letters for case insensitivity on windows
+
+		path_prefix_to_strip = self.path_prefix_to_strip
 		if "win" in self.buildparameters.platform:
-			filename = line[(start + 1):end].replace("/","\\")
-		else:
-			filename = line[(start + 1):end]
+			filename = filename[0].upper()+filename[1:]
+			filename = filename.replace("/","\\")
 
-		if self.path_prefix_to_strip:
-			if filename.startswith(self.path_prefix_to_strip):
-				filename = filename[len(self.path_prefix_to_strip):]
+		if path_prefix_to_strip:
+			if "win" in self.buildparameters.platform:
+				path_prefix_to_strip = path_prefix_to_strip[0].upper()+path_prefix_to_strip[1:].replace("/","\\")
+			if filename.startswith(path_prefix_to_strip):
+				filename = filename[len(path_prefix_to_strip):]
 			if self.path_prefix_to_add_on != None:
 				filename = self.path_prefix_to_add_on + filename
 			
 		if self.check:
-			if not os.path.isfile(filename):
+			if not os.path.isfile(abs_filename):
 				print "MISSING:", filename
 				self.ok = False
 		else:
@@ -64,6 +72,7 @@
 	def open(self, build_parameters):
 		"initialise"
 		
+
 		self.buildparameters = build_parameters
 		if build_parameters.doCheck:
 			self.check = True
--- a/sbsv2/raptor/python/plugins/filter_whatcomp.py	Thu Feb 11 11:47:39 2010 +0000
+++ b/sbsv2/raptor/python/plugins/filter_whatcomp.py	Mon Feb 15 15:17:20 2010 +0000
@@ -24,7 +24,7 @@
 class FilterWhatComp(filter_what.FilterWhat):
 
         def __init__(self): 
-		super(filter_what.FilterWhat, self).__init__()
+		super(FilterWhatComp, self).__init__()
 
 	def write(self, text):
 		"process some log text"
--- a/sbsv2/raptor/python/raptor_data.py	Thu Feb 11 11:47:39 2010 +0000
+++ b/sbsv2/raptor/python/raptor_data.py	Mon Feb 15 15:17:20 2010 +0000
@@ -975,10 +975,10 @@
 
 	def isDerivedFrom(self, progenitor, cache):
 		self.Resolve(cache)
-		if len(self.variants) == 1:
-			return self.variants[0].isDerivedFrom(progenitor,cache)
-		else:
-			return False
+		for v in self.variants:
+			if v.isDerivedFrom(progenitor,cache):
+				return True
+		return False
 
 class AliasRef(Reference):
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/custom_options/dfsconfig/.sbs_init.xml	Mon Feb 15 15:17:20 2010 +0000
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<build xmlns="http://symbian.com/xml/build"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://symbian.com/xml/build build/2_0.xsd">
+
+	<var name="make_changes">
+	<set name="bitmap.selector.iface" value="\.(bitmap|extension|mifconv|akniconinterfaces|removegtfiles|skingenerator|cryptoprep|builder|help_files|version_update)$"/>
+		<set name="resource.selector.iface" value="\.(resource|extension|mif2cdlindex|nativejava|genericcopy)$"/>
+   <set name="default.selector.iface" value="\.(?!export$|bitmap$|resource$|mifconv$|mif2cdlindex$|nativejava$|akniconinterfaces$|removegtfiles$|genericcopy$|skingenerator$|cryptoprep$|builder$|help_files$|version_update$).*$"/>
+    <!-- 4.5 min -->
+	  <set name='TALON_TIMEOUT' value='540000'/> 
+  </var>
+
+	<!-- emake -->
+	<alias name="emake" meaning="emake_engine.make_changes"/>  
+
+	<!-- gnu make -->
+	<alias name="make" meaning="make_engine.make_changes"/>
+	<alias name="dfstestmake" meaning="make_engine.make_changes"/>
+
+	
+</build>
--- a/sbsv2/raptor/test/smoke_suite/exe_armv5.py	Thu Feb 11 11:47:39 2010 +0000
+++ b/sbsv2/raptor/test/smoke_suite/exe_armv5.py	Mon Feb 15 15:17:20 2010 +0000
@@ -104,7 +104,8 @@
 	t.run()	
 	if t.result == SmokeTest.FAIL:
 		result = SmokeTest.FAIL	
-		
+	
+
 	t.id = "0001c"
 	t.name = "exe_armv5_gcce"
 	t.command = command % "gcce_armv5"
@@ -117,10 +118,15 @@
 	if t.result == SmokeTest.FAIL:
 		result = SmokeTest.FAIL	
 
+
+	# Test for the Check Filter to ensure that it reports 
+	# missing files properly when used from sbs_filter.py:
+	import os
+	abs_epocroot = os.path.abspath(os.environ["EPOCROOT"])
 	t.id = "0001d"
 	t.command = "rm $(EPOCROOT)/epoc32/release/armv5/udeb/test.exe.map; sbs_filter  --filters=FilterCheck < ${SBSLOGFILE}"
 	t.targets = []
-	t.mustmatch = ["MISSING"]
+	t.mustmatch = ["MISSING:[ 	]+" + abs_epocroot.replace("\\","\\\\") + ".epoc32.release.armv5.udeb.test\.exe\.map.*"]
 	t.mustnotmatch = []
 	t.warnings = 1
 	t.returncode = 2
--- a/sbsv2/raptor/test/smoke_suite/input_validation.py	Thu Feb 11 11:47:39 2010 +0000
+++ b/sbsv2/raptor/test/smoke_suite/input_validation.py	Mon Feb 15 15:17:20 2010 +0000
@@ -36,9 +36,21 @@
 
 	t.id = "43562b"
 	t.mustmatch = ["Unable to use make engine: 'arm' is not a build engine \(it's a variant but it does not extend 'make_engine'"]
-	t.name = "validate_makeengine_is_a_non_makenegine_variant"
+	t.name = "validate_makeengine_is_a_non_makengine_variant"
 	t.command = base_command + " -e arm"
 	t.run()
+
+	# aliases can be of the form name='blah' meaning='x.y.z'  i.e. where the alias is for a sequence of variants
+	# this tests that we detect that at least one of these variants has make_engine as a parent
+	# it is possible for one of them not to and we mustn't bomb-out just because of that
+	t.id = "43562c"
+	t.mustmatch = []
+	t.name = "validate_real_dfs_modded_makeengine_alias"
+	t.command = "export HOME=$SBS_HOME/test/custom_options/dfsconfig;  " + base_command + " -e dfstestmake -c arm.v5.urel.gcce4_4_1"
+	t.errors = 0
+	t.warnings = 0
+	t.returncode = 0
+	t.run()
 	
 	t.id = "43562"
 	t.name = "input_validation"