fix: don't regenrate resources for WINSCW fix
authortimothy.murphy@nokia.com
Wed, 07 Apr 2010 18:33:12 +0100
branchfix
changeset 466 b9e5cf94aac3
parent 465 d5ccdec632f8
child 467 04060c70e4fc
fix: don't regenrate resources for WINSCW
sbsv2/raptor/RELEASE-NOTES.txt
sbsv2/raptor/lib/flm/resource.flm
sbsv2/raptor/test/smoke_suite/resource.py
sbsv2/raptor/test/smoke_suite/test_resources/resource/dependentresource.rss
sbsv2/raptor/test/smoke_suite/test_resources/resource/test.cpp
--- a/sbsv2/raptor/RELEASE-NOTES.txt	Tue Apr 06 19:08:28 2010 +0100
+++ b/sbsv2/raptor/RELEASE-NOTES.txt	Wed Apr 07 18:33:12 2010 +0100
@@ -17,6 +17,7 @@
 - SF Bug 2134 - [Raptor] Raptor does not pass overridden make variables into its makefiles
 - Fix: do not allow data to be paged implicitly
 - Fix: Makefile Parse Performance in Resource stage is poor. Large size of included dependency files is a factor. In --no-depend-generate mode, create dependency files which only refer to other rsg/mbg files that are yet to be built - store no other dependencies.
+- Fix: Poor performance: resources are rebuilt for winscw even if they were already preprocessed and compiled for an arm build. Change tactics - create resources once in an intermediate build directory, then copy to platform specific dirs (rather than creating directly in each destination). Thus when winscw build is done, only a copy is needed.
 
 
 version 2.12.5
--- a/sbsv2/raptor/lib/flm/resource.flm	Tue Apr 06 19:08:28 2010 +0100
+++ b/sbsv2/raptor/lib/flm/resource.flm	Wed Apr 07 18:33:12 2010 +0100
@@ -59,7 +59,7 @@
         # which produces the header.
         HEADLANG:=$(lastword $(LANGUAGES:SC=sc))
 else
-	HEADLANG:=
+        HEADLANG:=
     RESOURCEHEADER:=
 endif
 
@@ -119,7 +119,7 @@
 
 # We intend to generate the resource in an intermediate locationand copy to the final destination to
 # ensure that when the "same" resource is built into separare locations it is 
-RSCCOPYDIRS:=$(RESBASE)
+RSCCOPYDIRS:=$(RSCDIR)
 # additional binary resource copies performed based on BINCOPYDIRS
 ifneq ($(BINCOPYDIRS),)
         RSCCOPYDIRS:=$(RSCCOPYDIRS) $(subst //,/,$(patsubst %,%/$(if $(TARGETPATH),/z/$(TARGETPATH),),$(BINCOPYDIRS)))
@@ -136,20 +136,22 @@
 
   ifeq ($(TARGET_$(call sanitise,$1)),)
     TARGET_$(call sanitise,$1):=1
-    $(if $(FLMDEBUG),$(info preprocessresource: $(1) for $(2) LANG:$(3)))
+    $(if $(FLMDEBUG),$(info <debug>preprocessresource: $(1) for $(2) LANG:$(3)</debug>))
 
 
-  # Correct dependency information when a header file can't be found:
-  # assume its in epoc32\include
-
-  ifneq ($(NO_DEPEND_GENERATE),)
-  # This version minimises the size of dependency files, to contain only enough information
-  # to allow the ordering to be correct.
-    DEPENDENCY_CORRECTOR:={ $(GNUSED) -n -r '1 p;\# [^ \/]+\.((rsg)|(mbg))#I {s#([^ \/]+\.((rsg)|(mbg)))(.*[\\\\])?$$$$$$$$# $(EPOCROOT)\/epoc32\/include\/\1 [\\\\]#ig; p}' && echo "" ; }
-  else
-  # Generate full dependency information with correction only
-    DEPENDENCY_CORRECTOR:=$(GNUSED)  -r 's% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig'
-  endif
+    # Correct dependency information when a header file can't be found.
+    # If the c preprocessor can't find a dependency it appears as it did in the #include statement
+    # e.g. "filename.mbg" or "filename.rsg" in the dependency file.
+    # we can correct the dependencies by assuming that the file will be in epoc32\include as this is the default
+    ifneq ($(NO_DEPEND_GENERATE),)
+      # This version minimises the size of dependency files, to contain only .mbg and .rsg deps.
+      # It allows resources to be built in the right order but doesn't impose the weight of
+      # of full dependency information which can overwhelm make in large builds.
+      DEPENDENCY_CORRECTOR:={ $(GNUSED) -n -r '1 p;\% [^ \/]+\.((rsg)|(mbg))%I {s% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig; p}' && echo "" ; }
+    else
+      # Generate full dependency information
+      DEPENDENCY_CORRECTOR:=$(GNUSED)  -r 's% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig'
+    endif
 
 
     RESOURCE_DEPS:: $(1).d
@@ -176,7 +178,7 @@
       ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
         ifeq "$(filter RESOURCE_DEPS,$(call uppercase,$(MAKECMDGOALS)))" ""
           -include $(DEPENDFILE)
-	endif
+        endif
       endif
     endif
 
@@ -234,6 +236,8 @@
 #       are any new copies to be made for this variant. e.g. winscw requires that we make
 #       some extra copies.
 
+        $(if $(FLMDEBUG),$(info <debug>resource copies of $(notdir $1) in: $(RSCCOPYDIRS)</debug>))
+        $(foreach F,$(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS))),$(call copyresource,$(1),$(F)))
         $(foreach F,$(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS))),$(call copyresource,$(1),$(F)))
 
         # individual source file compilation
@@ -252,7 +256,7 @@
 
         ifeq ($(TARGET_$(call sanitise,$1)),)
                 TARGET_$(call sanitise,$1):=1
-                $(if $(FLMDEBUG),$(info resourceheader: $(1) from $(2) LANG:$(3)))
+                $(if $(FLMDEBUG),$(info <debug>resourceheader: $(1) from $(2) LANG:$(3)</debug>))
 
                 RESOURCE:: $(1)
 
--- a/sbsv2/raptor/test/smoke_suite/resource.py	Tue Apr 06 19:08:28 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/resource.py	Wed Apr 07 18:33:12 2010 +0100
@@ -43,10 +43,10 @@
 
 	t.addbuildtargets('smoke_suite/test_resources/simple_gui/Bld.inf', [
 		"helloworld_exe/helloworld.mbm_bmconvcommands",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp.d",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp.d"])
+		"helloworld_exe/helloworld_sc.rpp",
+		"helloworld_exe/helloworld_sc.rpp.d",
+		"helloworld_reg_exe/helloworld_reg_sc.rpp",
+		"helloworld_reg_exe/helloworld_reg_sc.rpp.d"])
 
 	t.mustnotmatch = ["HelloWorld.rss.* warning: trigraph"]
 	
@@ -57,10 +57,16 @@
 	t.name =  "no_depend_gen_resource"
 	t.usebash = True
 	t.description =  """Check that dependent resources still build correctly even when we turn dependency generation off.  This
-			    test cannot reliably ensure that the dependencies are correct
+			    test cannot really do this reliably, if you think about it, since it can't force make to try building resources
+			    in the 'wrong' order.  What it does attempt is to check that 
+			    the ultimately generated dependency file is ok.
+			    N.B.  It also attempts to ensure that the dependency file is 'minimal'  i.e. that it only references .mbg and .rsg files
+			    that might come from other parts of the same build.  This is important for performance in situations where --no-depend-generate
+			    is used because the weight of 'complete' dependency information would overwhelm make.
 			 """
 	buildLocation = ReplaceEnvs("$(EPOCROOT)/epoc32/build/") + BldInfFile.outputPathFragment('smoke_suite/test_resources/resource/group/bld.inf')
-	res_depfile= buildLocation+"/dependentresource_/dependentresource_resource_dependentresource_sc.rpp.d"
+	#res_depfile= buildLocation+"/dependentresource_/dependentresource_resource_dependentresource_sc.rpp.d"
+	res_depfile= buildLocation+"/dependentresource_/dependentresource_sc.rpp.d"
 
 	t.targets = [
 		"$(EPOCROOT)/epoc32/include/testresource.rsg",
@@ -74,17 +80,20 @@
 		]
 
 	t.addbuildtargets('smoke_suite/test_resources/resource/group/bld.inf', [	
-		"testresource_/testresource_resource_testresource2_sc.rpp.d",
-		"testresource_/testresource_resource_testresource3_02.rpp",
-		"testresource_/testresource_resource_testresource3_02.rpp.d",
-		"testresource_/testresource_resource_testresource3_sc.rpp",
-		"testresource_/testresource_resource_testresource3_sc.rpp.d",
-		"testresource_/testresource_resource_testresource_01.rpp",
-		"testresource_/testresource_resource_testresource_01.rpp.d",
-		"testresource_/testresource_resource_testresource_sc.rpp",
-		"testresource_/testresource_resource_testresource_sc.rpp.d"])
+		"testresource_/testresource_02.rpp",
+		"testresource_/testresource_02.rpp.d",
+		"testresource_/testresource_01.rpp",
+		"testresource_/testresource_01.rpp.d",
+		"testresource_/testresource_sc.rpp",
+		"testresource_/testresource_sc.rpp.d"])
 
-	t.command = "sbs -b smoke_suite/test_resources/resource/group/bld.inf  -c arm.v5.urel.gcce4_4_1 reallyclean ; sbs --no-depend-generate -j 16 -b smoke_suite/test_resources/resource/group/bld.inf -c arm.v5.urel.gcce4_4_1 -f ${SBSLOGFILE} -m ${SBSMAKEFILE} && grep 'epoc32.include.testresource.rsg' %s " % (res_depfile)
+	t.command = "sbs -b smoke_suite/test_resources/resource/group/bld.inf  -c armv5_urel reallyclean ; sbs --no-depend-generate -j 16 -b smoke_suite/test_resources/resource/group/bld.inf -c armv5_urel -f ${SBSLOGFILE} -m ${SBSMAKEFILE} && grep 'epoc32.include.testresource.rsg' %s && wc -l %s " % (res_depfile, res_depfile)
+
+	t.mustnotmatch = []
+
+	t.mustmatch = [
+			"3 .*.dependentresource_.dependentresource_sc.rpp.d"
+		      ]
 
 	t.run()
 	return t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/resource/dependentresource.rss	Wed Apr 07 18:33:12 2010 +0100
@@ -0,0 +1,333 @@
+/*
+* Copyright (c) 2003-2009 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: 
+* LOGWRAP.RSS
+*
+*/
+
+
+#include <testresource_badef.rh>
+#include <e32capability.h>
+
+#include "../inc/testresource.rh"
+#include "../inc/testresource.hrh"
+#include "testresource.rls"
+
+#include "testresource.mbg"
+#include <testresource.rsg>
+
+// MACRO statements in .mmp files should be reflected in resource preprocessing
+#ifndef SHOULD_BE_DEFINED
+#error "mmp MACRO SHOULD_BE_DEFINED is not defined!"
+#endif
+
+// Initial configuration
+RESOURCE CONFIG r_log_initial_config
+	{
+	size = 1000; // Maximum number of events
+	recent = 20; // Maximum size of recent lists
+	age = 2592000; // 30 days
+	}
+
+  RESOURCE ARRAY r_log_initial_events
+   	{
+   	items = 
+   		{
+  		ETYPE { uid = KLogCallEventType; description = LOG_CALL_EVENT_TYPE; },
+  		ETYPE { uid = KLogDataEventType; description = LOG_DATA_EVENT_TYPE; },
+  		ETYPE { uid = KLogFaxEventType; description = LOG_FAX_EVENT_TYPE; },
+  		ETYPE { uid = KLogShortMessageEventType; description = LOG_SHORT_MESSAGE_EVENT_TYPE; },
+  		ETYPE { uid = KLogTaskSchedulerEventType; description = LOG_TASK_SCHEDULER_EVENT_TYPE; },
+  		ETYPE { uid = KLogPacketDataEventType; description = LOG_PACKET_DATA_EVENT_TYPE; },
+
+
+  		ETYPE { uid = KLogLbsSelfLocateEventType; description = LOG_LBS_SELF_LOCATE_EVENT_TYPE; },
+  		ETYPE { uid = KLogLbsExternalLocateEventType; description = LOG_LBS_EXTERNAL_LOCATE_EVENT_TYPE; },
+ 		ETYPE { uid = KLogLbsTransmitLocationEventType; description = LOG_LBS_TRANSMIT_LOCATION_EVENT_TYPE; },
+ 		ETYPE { uid = KLogLbsNetworkLocateEventType; description = LOG_LBS_NETWORK_LOCATE_EVENT_TYPE; },
+ 		ETYPE { uid = KLogLbsAssistanceDataEventType; description = LOG_LBS_ASSISTANCE_DATA_EVENT_TYPE; }
+
+   		};
+   	}
+
+
+
+RESOURCE ARRAY r_log_security
+//
+// [See logwrap.rh for the definitions of SECURITY and CAPABILITY.]
+//
+// This structure defines settings for platform security in the Log engine.
+// All event types defined above in 'r_log_initial_events' need to be policed.
+// The server must always determine whether a client thread has the required
+// capability to read/write a log event(s) of a built-in type.  Each operation
+// may have from one to seven capabilities defined for it.  All operations on 
+// built in types _MUST_ have an associated security policy defined here.  If no
+// security is required, then use 'cap=ECapability_None'.  The CAPABILITY values
+// defined here will provide constructor arguments for TSecurityPolicy objects.
+// The maximum number of CAPABILITY(s) for each read or write operation is 7.
+// ( a read_caps or a write_caps { contains <= 7 CAPABILITY{}   statements }  )
+// Note that SID-based security isn't supported in the Log Engine.
+//
+	{
+	items = 
+		{
+		SECURITY 
+			{ 
+			uid = KLogCallEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogDataEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogFaxEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogShortMessageEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogTaskSchedulerEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapability_None; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogPacketDataEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsSelfLocateEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsExternalLocateEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsTransmitLocationEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsNetworkLocateEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsAssistanceDataEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			}
+		};
+	}
+
+
+// Index entries
+RESOURCE ARRAY r_log_indexes
+	{
+	items =
+		{
+		INDEX
+			{
+			name = "Index1"; // do not translate
+			table = "Event"; // do not translate
+			keys = 
+				{
+				KEY { col = "Id"; } // do not translate
+				};
+			},
+		INDEX
+			{
+			name = "Index2"; // do not translate
+			table = "Event"; // do not translate
+			keys =
+				{
+				KEY { col = "ETime"; } // do not translate
+				};
+			},
+		INDEX
+			{
+			name = "Index3"; // do not translate
+			table = "String"; // do not translate
+			keys = 
+				{
+				KEY { col = "Id"; } // do not translate
+				};
+			}
+		};
+	}
+
+// Recent list setup
+RESOURCE ARRAY r_log_recent
+	{
+	items =
+		{
+		RECENT
+			{
+			id = KLogRecentIncomingCalls;
+			duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField;
+			conditions = 
+				{
+				MATCH { field = ELogEventTypeField; value = KLogCallEventType; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_IN; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_IN_ALT; }
+				};
+			},
+		RECENT
+			{
+			id = KLogRecentOutgoingCalls;
+			duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField;
+			conditions = 
+				{
+				MATCH { field = ELogEventTypeField; value = KLogCallEventType; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_OUT; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_OUT_ALT; }
+				};
+			},
+		RECENT
+			{
+			id = KLogRecentMissedCalls;
+			duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField;
+			conditions = 
+				{
+				MATCH { field = ELogEventTypeField; value = KLogCallEventType; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_MISSED; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_MISSED_ALT; }
+				};
+			}
+		};
+	}
+
+
+// Direction
+RESOURCE LBUF r_log_dir_in { txt = LOG_DIR_IN; }
+RESOURCE LBUF r_log_dir_out { txt = LOG_DIR_OUT; }
+RESOURCE LBUF r_log_dir_in_alt { txt = LOG_DIR_IN_ALT; }
+RESOURCE LBUF r_log_dir_out_alt { txt = LOG_DIR_OUT_ALT; }
+RESOURCE LBUF r_log_dir_fetched { txt = LOG_DIR_FETCHED; }
+RESOURCE LBUF r_log_dir_missed { txt = LOG_DIR_MISSED; }
+RESOURCE LBUF r_log_dir_missed_alt { txt = LOG_DIR_MISSED_ALT; }
+
+
+// Delivery
+RESOURCE LBUF r_log_del_pending { txt = LOG_DEL_PENDING; }
+RESOURCE LBUF r_log_del_sent { txt = LOG_DEL_SENT; }
+RESOURCE LBUF r_log_del_failed { txt = LOG_DEL_FAILED; }
+/* R_LOG_DEL_NONE comes from the rsg that we're trying to depend on */
+RESOURCE LBUF r_log_del_none { txt = R_LOG_DEL_NONE; } 
+RESOURCE LBUF r_log_del_done { txt = LOG_DEL_DONE; }
+RESOURCE LBUF r_log_del_not_sent { txt = LOG_DEL_NOT_SENT; }
+RESOURCE LBUF r_log_del_scheduled { txt = LOG_DEL_SCHEDULED; }
+
+// Other
+RESOURCE LBUF r_log_remote_unknown { txt = LOG_REMOTE_UNKNOWN; }
+RESOURCE LBUF r_log_remote_multiple { txt = LOG_REMOTE_MULTIPLE; }
+RESOURCE LBUF r_log_subject_none { txt = LOG_SUBJECT_NONE; }
+RESOURCE LBUF r_log_subject_data_message { txt = LOG_SUBJECT_DATA_MESSAGE; }
+
+// Connection
+RESOURCE LBUF r_log_con_connected { txt = LOG_CON_CONNECTED; }
+RESOURCE LBUF r_log_con_connecting { txt = LOG_CON_CONNECTING; }
+RESOURCE LBUF r_log_con_disconnecting { txt = LOG_CON_DISCONNECTING; }
+RESOURCE LBUF r_log_con_disconnected{ txt = LOG_CON_DISCONNECTED; }
+RESOURCE LBUF r_log_con_suspended{ txt = LOG_CON_SUSPENDED; }
+
+// Delivery
+RESOURCE LBUF r_log_del_notified { txt = LOG_DEL_NOTIFIED; } 
+RESOURCE LBUF r_log_del_expired { txt = LOG_DEL_EXPIRED; }  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/resource/test.cpp	Wed Apr 07 18:33:12 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2009 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: 
+*
+*/
+#include "e32def.h" // intentional  include
+
+char test[]="Resource test";
+
+
+TInt E32Main()
+{
+	return 0;
+}