# HG changeset patch
# User Jon Chatten
# Date 1270640050 -3600
# Node ID 9bebdb95e0de318059c03ca0aae0c2ef90ee8429
# Parent 6cc6d1d59188f1c74b566e4f4c8a478ba3c1f52a# Parent d8edd94cd8e2f311f32f216c07639e63a2351ec1
merge 2.13.0 (candidate 2) from default
diff -r 6cc6d1d59188 -r 9bebdb95e0de .hgtags
--- a/.hgtags Tue Apr 06 11:42:16 2010 +0100
+++ b/.hgtags Wed Apr 07 12:34:10 2010 +0100
@@ -3,3 +3,5 @@
007900c31eef0363e705cf15d131740d4eeb6208 stable
007900c31eef0363e705cf15d131740d4eeb6208 stable
976aca38ffe5ce30d7753ea77a8de44e5cbd0dc8 stable
+976aca38ffe5ce30d7753ea77a8de44e5cbd0dc8 stable
+7006bcce52990f33d0c20c51bebc2b58ed36db60 stable
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/RELEASE-NOTES.html
--- a/sbsv2/raptor/RELEASE-NOTES.html Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/RELEASE-NOTES.html Wed Apr 07 12:34:10 2010 +0100
@@ -33,7 +33,17 @@
Defect Fixes
-- to be integrated
+- DPDEF143018 - Raptor doesn't handle spaces in GCCE installation directory correctly
+- DPDEF143101 - GCC-E isn't tested as part of the tool checking mechanism
+- DPDEF141195 - Raptor doesn't handle spaces in tool paths
+- SF Bug 2172 - [Raptor] Resource builds warn on encountering trigraph-like strings
+- SF Bug 2308 - [Raptor] PLUGIN3 TARGETTYPEs don't set resource output offsets correctly
+- Fix: in copylogfromannofile mode, ensure that the build id and duration are included in the log. These are not critical but are useful
+- Fix: remove unnecessary empty lines in log output in copylogfromannofile mode
+- SF Bug 1939 - [Raptor] PAGED keyword in MMP files should imply byte pair compressed
+- DPDEF144648 - Raptor failed to build tools_deb objects under Windows XP
+- SF Bug 2134 - [Raptor] Raptor does not pass overridden make variables into its makefiles
+- Fix : do not allow data to be paged implicitly
@@ -42,14 +52,15 @@
version 2.12.5
Defect Fixes:
-- Fix: Workaround for emake engine log corruption when clockskew errors occur (annofile2log).
-
+- Fix: Workaround for emake engine log corruption when clockskew errors occur (annofile2log).
Allow Raptor to obtain log from emake annotation file where it is uncorrupted. A new
- Make engine option "copyannofile2log" enables/disables this mode for emake. If this option is disabled
+ Make engine option "copylogfromannofile" enables/disables this mode for emake. If this option is disabled
or if no annotation file is specified for the build then Raptor reads logs directly as normal.
+- SF Bug 2125 - [Raptor] - tracecompiler what output incorrect if mmp basename contains '.' e.g. fred.prd.mmp
- SF Bug 2191 - [Raptor] - When forcesuccess is enabled, exit status for a failed recipe is "retry" but should be "failed"
- Fix: extend tracecompiler tests to Linux
- Fix: Amendment to SF Bug 1511 fix - removal of blanked DEFFILE keyword from e32abiv2ani.flm
+- Fix: improve robustness to bad -c options
version 2.12.4
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/arm.xml
--- a/sbsv2/raptor/lib/config/arm.xml Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/config/arm.xml Wed Apr 07 12:34:10 2010 +0100
@@ -1,51 +1,62 @@
-
+
-
-
-
+
+
-
+
+
+
-
-
-
+
-
-
-
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
@@ -57,16 +68,9 @@
-
-
-
-
-
-
-
-
-
+
+
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/gcc.xml
--- a/sbsv2/raptor/lib/config/gcc.xml Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/config/gcc.xml Wed Apr 07 12:34:10 2010 +0100
@@ -1,33 +1,33 @@
-
-
+
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
@@ -58,7 +56,6 @@
-
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/gcce.xml
--- a/sbsv2/raptor/lib/config/gcce.xml Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/config/gcce.xml Wed Apr 07 12:34:10 2010 +0100
@@ -1,15 +1,15 @@
-
-
+
+
+
+
-
-
@@ -123,6 +123,6 @@
-
+
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/gccxml.xml
--- a/sbsv2/raptor/lib/config/gccxml.xml Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/config/gccxml.xml Wed Apr 07 12:34:10 2010 +0100
@@ -1,21 +1,20 @@
-
+
-
+
+
+
+
-
-
+
-
-
+
+
-
-
-
-
+
@@ -51,11 +50,13 @@
-
+
+
+
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/locations.xml
--- a/sbsv2/raptor/lib/config/locations.xml Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/config/locations.xml Wed Apr 07 12:34:10 2010 +0100
@@ -108,7 +108,7 @@
-
+
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/msvc.xml
--- a/sbsv2/raptor/lib/config/msvc.xml Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/config/msvc.xml Wed Apr 07 12:34:10 2010 +0100
@@ -1,11 +1,11 @@
-
+
-
+
@@ -17,8 +17,14 @@
+
+
+
+
+
+
@@ -32,7 +38,6 @@
-
@@ -44,7 +49,7 @@
-
+
@@ -57,9 +62,6 @@
-
-
-
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/rvct.xml
--- a/sbsv2/raptor/lib/config/rvct.xml Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/config/rvct.xml Wed Apr 07 12:34:10 2010 +0100
@@ -1,68 +1,62 @@
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -71,25 +65,35 @@
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
@@ -97,10 +101,11 @@
+
-
-
+
+
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/variants.xml
--- a/sbsv2/raptor/lib/config/variants.xml Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/config/variants.xml Wed Apr 07 12:34:10 2010 +0100
@@ -91,37 +91,40 @@
-
+
+
-
+
+
-
+
+
-
-
-
+
+
+
-
+
@@ -143,13 +146,13 @@
-
-
-
+
+
+
-
+
@@ -173,13 +176,13 @@
-
-
-
+
+
+
-
+
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/config/winscw.xml
--- a/sbsv2/raptor/lib/config/winscw.xml Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/config/winscw.xml Wed Apr 07 12:34:10 2010 +0100
@@ -1,24 +1,31 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -45,97 +52,96 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/flm/e32abiv2.flm
--- a/sbsv2/raptor/lib/flm/e32abiv2.flm Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/flm/e32abiv2.flm Wed Apr 07 12:34:10 2010 +0100
@@ -580,8 +580,7 @@
# Targettype is some type of DLL or EXE (or derivative)
ifneq ($(LINK_TARGET),)
-escaped_located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(call ruleEscape,$(wildcard $(subst $(CHAR_SPACE),?,$(RVCTLIB)/*/$(L)))))
-quoted_located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(call dblquoteitem,$(wildcard $(RVCTLIB)/*/$(L))))
+located_ARMLIBS:=$(foreach L,$(ARMLIBS),$(wildcard $(RVCTLIB)/*/$(L)))
located_STATICLIBRARIES:=$(foreach L,$(STATICLIBRARY),$(STATIC_LIBRARY_DIR)/$(L).lib)
e32abiv2_LIBS:=$(EXPTARGET) $(LINKER_STUB_LIBRARY) $(if $(STATIC_RUNTIME_LIB),$(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB),) $(located_STATICLIBRARIES)
# DLLS and EXEs - These objects are linked by a linker
@@ -594,12 +593,10 @@
REDUCED_RUNTIME_LIBS_LIST:=$(subst $(TARGET).dso,,$(RUNTIME_LIBS_LIST))
ifeq ($(VARIANTTYPE),udeb)
- e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST))
+ e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS)
else
- e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST))
+ e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(addprefix $(RUNTIME_LIBS_PATH)/,$(REDUCED_RUNTIME_LIBS_LIST)) $(located_ARMLIBS)
endif
-quoted_e32abiv2_LIBS=$(e32abiv2_LIBS) $(quoted_located_ARMLIBS)
-escaped_e32abiv2_LIBS=$(e32abiv2_LIBS) $(escaped_located_ARMLIBS)
else
# NORMAL
@@ -612,19 +609,16 @@
ifeq ($(HAS_DEDICATED_OP_NEWDEL_LIB),1)
e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(NEWLIB))
endif
-quoted_e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(call addquotedprefix,$(STATIC_LIBS_PATH)/,$(STATIC_LIBS_LIST)) $(quoted_located_ARMLIBS)
-escaped_e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(addprefix $(call ruleEscape,$(STATIC_LIBS_PATH)/),$(STATIC_LIBS_LIST)) $(escaped_located_ARMLIBS)
+e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(RUNTIME_LIBS_PATH)/,$(RUNTIME_LIBS_LIST)) $(addprefix $(STATIC_LIBS_PATH)/,$(STATIC_LIBS_LIST)) $(located_ARMLIBS)
endif
else
# ARM RUNTIME LIBS
ifeq ($(VARIANTTYPE),udeb)
- e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG))
+ e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY_DEBUG)) $(located_ARMLIBS)
else
- e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY))
+ e32abiv2_LIBS:=$(e32abiv2_LIBS) $(addprefix $(IMPORTLIBPATH)/,$(LIBRARY)) $(located_ARMLIBS)
endif
-quoted_e32abiv2_LIBS=$(e32abiv2_LIBS) $(quoted_located_ARMLIBS)
-escaped_e32abiv2_LIBS=$(e32abiv2_LIBS) $(escaped_located_ARMLIBS)
endif
# NOTE: the groupin10 macro must be used before a call to the "startrule" macro
@@ -634,7 +628,7 @@
# outside the relevant tags but it is also unavoidable.
define linktarget_func
## The actual link target, dependencies and build step
-$(E32TARGET): $(POSTLINKDEFFILE) $(ELF2E32) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS),$(LINKOBJECTS)) $(escaped_e32abiv2_LIBS) $(LINKER_ENTRYPOINT_LIBDEP) $(if $(SUPPORTS_STDCPP_NEWLIB),$(CHECKLIB)) $(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACKFILE),) $(if $(HAVE_ORDERONLY),|,) $(EPOCROOT)/epoc32/build/TEM_LIB
+$(E32TARGET): $(POSTLINKDEFFILE) $(ELF2E32) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS),$(LINKOBJECTS)) $(e32abiv2_LIBS) $(LINKER_ENTRYPOINT_LIBDEP) $(if $(SUPPORTS_STDCPP_NEWLIB),$(CHECKLIB)) $(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACKFILE),) $(if $(HAVE_ORDERONLY),|,) $(EPOCROOT)/epoc32/build/TEM_LIB
$(if $(MULTIFILE_ENABLED),,@echo -n "" > $(VIAFILE);
$(call groupin10,$(LINKOBJECTS)) ;)
$(call startrule,linkandpostlink) \
@@ -654,7 +648,7 @@
$(if $(MULTIFILE_ENABLED),$(call dblquote,$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS)),$(COMMANDFILE_OPTION)$(call dblquote,$(VIAFILE))) \
$(if $(GENERATELINKERFEEDBACK),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \
$(if $(LINKER_ADD_STATIC_RUNTIME),$(if $(STATIC_RUNTIME_LIB),$(LINKER_GROUP_START_OPTION) $(STATIC_RUNTIME_DIR)/$(STATIC_RUNTIME_LIB) $(LINKER_GROUP_END_OPTION),)) \
- $(quoted_e32abiv2_LIBS) $(LINKER_DEFAULT_LIBS) && \
+ $(call dblquote,$(e32abiv2_LIBS)) $(LINKER_DEFAULT_LIBS) && \
$(ELF2E32) \
--sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \
--version=$(VERSION) \
@@ -795,7 +789,7 @@
$(if $(USE_PROFILER_FEEDBACK),--profile=$(call dblquote,$(ARM_PROFILER_FILE)),) \
$(call makemacrodef,-D,$(COMPILER_INTERWORK_DEFINES) $(CDEFS)) \
$(if $(PREINCLUDE),$(PREINCLUDE_OPTION) ,)$(call concat, $(PREINCLUDE_OPTION) ,$(call dblquote,$(PREINCLUDE)))\
- $(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquoteitem,$(RVCTINC)),),) \
+ $(if $(SET_ARMINC),$(if $(RVCTINC),$(COMPILER_SYSTEM_INCLUDE_OPTION)$(call dblquote,$(RVCTINC)),),) \
$(COMPILER_SYSTEM_INCLUDE_OPTION)$$(call dblquote,$$(
-
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/lib/flm/resource.flm
--- a/sbsv2/raptor/lib/flm/resource.flm Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/lib/flm/resource.flm Wed Apr 07 12:34:10 2010 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2007-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"
@@ -112,7 +112,7 @@
$(call makepath,$(INTERBASE))
# common pre-processor options
-CPPOPT:=-nostdinc -undef -D_UNICODE -include $(PRODUCT_INCLUDE)\
+CPPOPT:=-nostdinc -undef -Wno-trigraphs -D_UNICODE -include $(PRODUCT_INCLUDE)\
-I$(dir $(SOURCE)) $(foreach I, $(USERINCLUDE),-I$(I) ) -I- $(foreach J,$(SYSTEMINCLUDE),-I$(J) )
CREATABLEPATHS:=$(RSCDIR) $(RSGDIR) $(OUTPUTPATH)
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/license.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/license.txt Wed Apr 07 12:34:10 2010 +0100
@@ -0,0 +1,8 @@
+Copyright (c) 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".
+
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/generic_path.py
--- a/sbsv2/raptor/python/generic_path.py Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/python/generic_path.py Wed Apr 07 12:34:10 2010 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2006-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"
@@ -19,6 +19,7 @@
import sys
import re
import types
+import ctypes
# are we on windows, and if so what is the current drive letter
isWin = sys.platform.lower().startswith("win")
@@ -265,7 +266,37 @@
return self.path
+ def GetSpaceSafePath(self):
+ """Returns a version of the path where spaces don't interfere with shell interpretation.
+
+ This functionality only applies to Windows - paths containing spaces are assumed to be problematic
+ on non-Windows platforms.
+
+ On Windows, the path is returned in Windows-specific 8.3 short path form - tilde are used to replace
+ spaces and fit path elements within 8.3 requirements. As 8.3 format paths are not guaranteed to be
+ supported on all Windows installs, and can only be calculated if they exist, a newly formated path is
+ only returned if it is returned by the Windows API and tested to exist.
+ """
+
+ if not isWin:
+ return None
+
+ from ctypes.wintypes import DWORD, LPSTR, MAX_PATH
+ GetShortPathNameA = ctypes.windll.kernel32.GetShortPathNameA
+ GetShortPathNameA.restype = DWORD
+ GetShortPathNameA.argtypes = LPSTR, LPSTR, DWORD
+
+ buffer = ctypes.create_string_buffer(MAX_PATH)
+ GetShortPathNameA(self.path, buffer, MAX_PATH)
+
+ spacesafe = buffer.value
+
+ if not spacesafe or not os.path.exists(spacesafe):
+ return None
+
+ return spacesafe
+
# Module functions
def Join(*arguments):
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/plugins/filter_terminal.py
--- a/sbsv2/raptor/python/plugins/filter_terminal.py Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/python/plugins/filter_terminal.py Wed Apr 07 12:34:10 2010 +0100
@@ -161,7 +161,7 @@
# list of strings to catch recipe warnings (must be lowercase)
self.recipe_warning_expr = ["warning:"]
-
+
def isMakeWarning(self, text):
"""A simple test for warnings.
Can be extended do to more comprehensive checking."""
@@ -201,6 +201,9 @@
if self.raptor.quiet:
self.quiet = True
+ # the build configurations which were reported
+ self.built_configs = []
+
# keep count of errors and warnings
self.err_count = 0
self.warn_count = 0
@@ -393,7 +396,9 @@
self.recipeBody.append(text)
else:
self.recipelineExceeded += 1
-
+ elif text.startswith("Buildable configuration '"):
+ # Buildable configuration 'name'
+ self.built_configs.append(text[30:-8])
def logit(self):
""" log a message """
@@ -432,11 +437,14 @@
if self.warn_count > 0 or self.err_count > 0:
sys.stdout.write("\n%s : warnings: %s\n" % (raptor.name,
self.warn_count))
- sys.stdout.write("%s : errors: %s\n" % (raptor.name,
+ sys.stdout.write("%s : errors: %s\n\n" % (raptor.name,
self.err_count))
else:
- sys.stdout.write("\nno warnings or errors\n")
+ sys.stdout.write("\nno warnings or errors\n\n")
+ for bc in self.built_configs:
+ sys.stdout.write("built " + bc + "\n")
+
sys.stdout.write("\nRun time %d seconds\n" % self.raptor.runtime);
sys.stdout.write("\n")
return True
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor.py
--- a/sbsv2/raptor/python/raptor.py Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/python/raptor.py Wed Apr 07 12:34:10 2010 +0100
@@ -42,7 +42,6 @@
import sys
import types
import time
-import re
import traceback
import pluginbox
from xml.sax.saxutils import escape
@@ -232,8 +231,9 @@
def makefile(self, makefilename_base, engine, named = False):
"""Makefiles for individual mmps not feasible at the moment"""
- pass # Cannot, currently, "unfurl an mmp" directly but do want
- # to be able to simulate the overall recursive unfurling of a build.
+ pass
+ # Cannot, currently, "unfurl an mmp" directly but do want
+ # to be able to simulate the overall recursive unfurling of a build.
class Component(ModelNode):
"""A group of projects or, in symbian-speak, a bld.inf.
@@ -321,7 +321,6 @@
# insert the start time into the Makefile name?
- buildconfig = build.GetConfig("build").GenerateBuildUnits(build.cache)
self.configs = build.buildUnitsToBuild
# Pass certain CLI flags through to the makefile-generating sbs calls
@@ -385,8 +384,7 @@
makefile_path = str(build.topMakefile) + "_" + str(loop_number)
try:
os.unlink(makefile_path) # until we have dependencies working properly
- except Exception,e:
- # print "couldn't unlink %s: %s" %(componentMakefileName, str(e))
+ except Exception:
pass
# add some basic data in a component-wide variant
@@ -859,32 +857,6 @@
self.cache.Load(self.systemFLM)
- def GetConfig(self, configname):
- names = configname.split(".")
-
- cache = self.cache
-
- base = names[0]
- mods = names[1:]
-
- if base in cache.groups:
- x = cache.FindNamedGroup(base)
- elif base in cache.aliases:
- x = cache.FindNamedAlias(base)
- elif base in cache.variants:
- x = cache.FindNamedVariant(base)
- else:
- raise Exception("Unknown build configuration '%s'" % configname)
-
- x.ClearModifiers()
-
-
- try:
- for m in mods: x.AddModifier( cache.FindNamedVariant(m) )
- except KeyError:
- raise Exception("Unknown build configuration '%s'" % configname)
- return x
-
def GetBuildUnitsToBuild(self, configNames):
"""Return a list of the configuration objects that correspond to the
list of configuration names in the configNames parameter.
@@ -900,17 +872,7 @@
else:
configNames.append(self.defaultConfig)
- buildUnitsToBuild = set()
-
-
- for c in set(configNames):
- self.Debug("BuildUnit: %s", c)
- try:
- x = self.GetConfig(c)
- gb = x.GenerateBuildUnits(self.cache)
- buildUnitsToBuild.update( gb )
- except Exception, e:
- self.FatalError(str(e))
+ buildUnitsToBuild = raptor_data.GetBuildUnits(configNames, self.cache, self)
for b in buildUnitsToBuild:
self.Info("Buildable configuration '%s'", b.name)
@@ -1003,7 +965,6 @@
dir = generic_path.Path(aDir)
bldInf = dir.Append(self.buildInformation)
- componentgroup = []
if bldInf.isFile():
return bldInf
@@ -1150,7 +1111,7 @@
self.out.write(raptor_timing.Timing.discovery_string(object_type = object_type,
count = count))
except Exception, exception:
- Error(exception.Text, function = "InfoDiscoveryTime")
+ self.Error(exception.Text, function = "InfoDiscoveryTime")
def InfoStartTime(self, object_type, task, key):
if self.timing:
@@ -1158,7 +1119,7 @@
self.out.write(raptor_timing.Timing.start_string(object_type = object_type,
task = task, key = key))
except Exception, exception:
- Error(exception.Text, function = "InfoStartTime")
+ self.Error(exception.Text, function = "InfoStartTime")
def InfoEndTime(self, object_type, task, key):
if self.timing:
@@ -1166,7 +1127,7 @@
self.out.write(raptor_timing.Timing.end_string(object_type = object_type,
task = task, key = key))
except Exception, exception:
- Error(exception.Text, function = "InfoEndTime")
+ self.Error(exception.Text, function = "InfoEndTime")
def Debug(self, format, *extras, **attributes):
"Send a debugging message to the configured channel"
@@ -1280,6 +1241,9 @@
self.AssertBuildOK()
buildUnitsToBuild = self.GetBuildUnitsToBuild(self.configNames)
+ if len(buildUnitsToBuild) == 0:
+ raise BuildCannotProgressException("No configurations to build.")
+
self.buildUnitsToBuild = buildUnitsToBuild
# find out what components to build, and in what way
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor_cli.py
--- a/sbsv2/raptor/python/raptor_cli.py Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/python/raptor_cli.py Wed Apr 07 12:34:10 2010 +0100
@@ -34,7 +34,7 @@
# raptor_cli module attributes
parser = OptionParser(prog = raptor.name,
- usage = """%prog [--help] [options] [variable=value] [target] ...
+ usage = """%prog [--help] [options] [target] ...
Targets:
@@ -247,13 +247,8 @@
# the leftover_args are either variable assignments of the form a=b
# or target names.
- regex = re.compile("^(.+)=(.*)$")
for leftover in leftover_args:
- assignment = regex.findall(leftover)
- if len(assignment) > 0:
- Raptor.SetEnv(assignment[0][0],assignment[0][1])
- else:
- Raptor.AddTarget(leftover)
+ Raptor.AddTarget(leftover)
# Define the dictionary of functions to be used.
# Attributes and function names can be added easily.
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor_data.py
--- a/sbsv2/raptor/python/raptor_data.py Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/python/raptor_data.py Wed Apr 07 12:34:10 2010 +0100
@@ -65,7 +65,7 @@
# Make sure not to start up on an unsupported platform
if not HostPlatform.IsKnown(HostPlatform.hostplatform):
- raise Exception("raptor_data module loaded on an unrecognised platform '%s'. Expected one of %s" % (hostplatform, str(hostplatforms)))
+ raise Exception("raptor_data module loaded on an unrecognised platform '%s'. Expected one of %s" % (HostPlatform.hostplatform, str(HostPlatform.hostplatforms)))
# raptor_data module classes
@@ -139,7 +139,13 @@
raise BadReferenceError()
def GetModifiers(self, cache):
- return [ cache.FindNamedVariant(m) for m in self.modifiers ]
+ mods = []
+ for m in self.modifiers:
+ try:
+ mods.append(cache.FindNamedVariant(m))
+ except KeyError:
+ raise BadReferenceError(m)
+ return mods
def Valid(self):
return self.ref
@@ -710,7 +716,7 @@
def __str__(self):
attributes = "name='" + self.name + "' type='" + self.type + "'"
- if default != None:
+ if self.default != None:
attributes += " default='" + self.default + "'"
if type == "tool":
@@ -724,19 +730,31 @@
value = os.environ[self.name]
if value:
- # if this value is a "path" or a "tool" then we need to make sure
- # it is a proper absolute path in our preferred format.
- if self.type == "path" or self.type == "tool":
+ if self.type in ["path", "tool", "toolchainpath"]:
+ # if this value is some sort of path or tool then we need to make sure
+ # it is a proper absolute path in our preferred format.
try:
path = generic_path.Path(value)
value = str(path.Absolute())
except ValueError,e:
- raise BadToolValue("the environment variable %s is incorrect: %s" % (self.name, str(e)))
- # if this value ends in an un-escaped backslash, then it will be treated as a line continuation character
- # in makefile parsing - un-escaped backslashes at the end of values are therefore escaped
+ raise BadToolValue("the environment variable %s is incorrect: %s" % (self.name, str(e)))
+
+ if self.type in ["tool", "toolchainpath"]:
+ # if we're dealing with tool-related values, then make sure that we can get "safe"
+ # versions if they contain spaces - if we can't, that's an error, as they won't
+ # survive full usage in the toolcheck or when used and/or referenced in FLMs
+ if ' ' in value:
+ path = generic_path.Path(value)
+ spaceSafeValue = path.GetSpaceSafePath()
+
+ if not spaceSafeValue:
+ raise BadToolValue("the environment variable %s is incorrect - it is a '%s' type but contains spaces that cannot be neutralised: %s" % (self.name, self.type, value))
+
+ value = spaceSafeValue
elif value.endswith('\\'):
- # an odd number of backslashes means there's one to escape
- count = len(value) - len(value.rstrip('\\'))
+ # if this value ends in an un-escaped backslash, then it will be treated as a line continuation character
+ # in makefile parsing - un-escaped backslashes at the end of values are therefore escaped
+ count = len(value) - len(value.rstrip('\\')) # an odd number of backslashes means there's one to escape
if count % 2:
value += '\\'
except KeyError:
@@ -906,7 +924,6 @@
s += ""
return s
-import traceback
class VariantRef(Reference):
def __init__(self, ref=None):
@@ -918,7 +935,7 @@
def Resolve(self, cache):
try:
return cache.FindNamedVariant(self.ref)
- except KeyError, e:
+ except KeyError:
raise BadReferenceError(self.ref)
class MissingVariantException(Exception):
@@ -961,7 +978,7 @@
missing_variants.append(r.ref)
if len(missing_variants) > 0:
- raise MissingVariantException("Missing variants '%s'", " ".join(missing_variants))
+ raise MissingVariantException("Missing variants '%s'" % " ".join(missing_variants))
def GenerateBuildUnits(self, cache):
self.Resolve(cache)
@@ -1026,25 +1043,27 @@
def GenerateBuildUnits(self, cache):
units = []
-
+
missing_variants = []
for r in self.childRefs:
- refMods = r.GetModifiers(cache)
-
try:
obj = r.Resolve(cache=cache)
except BadReferenceError:
missing_variants.append(r.ref)
else:
obj.ClearModifiers()
+ try:
+ refMods = r.GetModifiers(cache)
+ except BadReferenceError,e:
+ missing_variants.append(str(e))
+ else:
+ for m in refMods + self.modifiers:
+ obj.AddModifier(m)
- for m in refMods + self.modifiers:
- obj.AddModifier(m)
-
- units.extend( obj.GenerateBuildUnits(cache) )
+ units.extend( obj.GenerateBuildUnits(cache) )
if len(missing_variants) > 0:
- raise MissingVariantException("Missing variants '%s'", " ".join(missing_variants))
+ raise MissingVariantException("Missing variants '%s'" % " ".join(missing_variants))
return units
@@ -1055,7 +1074,7 @@
Reference.__init__(self, ref)
def __str__(self):
- return "<%s />" % (prefix, self.ref, ".".join(self.modifiers))
+ return "" % (self.ref, ".".join(self.modifiers))
def Resolve(self, cache):
try:
@@ -1063,6 +1082,81 @@
except KeyError:
raise BadReferenceError(self.ref)
+def GetBuildUnits(configNames, cache, logger):
+ """expand a list of config strings like "arm.v5.urel" into a list
+ of BuildUnit objects that can be queried for settings.
+
+ The expansion tries to be tolerant of errors in the XML so that a
+ typo in one part of a group does not invalidate the whole group.
+ """
+
+ # turn dot-separated name strings into Model objects (Group, Alias, Variant)
+ models = []
+
+ for c in set(configNames):
+ ok = True
+ names = c.split(".")
+
+ base = names[0]
+ mods = names[1:]
+
+ if base in cache.groups:
+ x = cache.FindNamedGroup(base)
+ elif base in cache.aliases:
+ x = cache.FindNamedAlias(base)
+ elif base in cache.variants:
+ x = cache.FindNamedVariant(base)
+ else:
+ logger.Error("Unknown build configuration '%s'" % base)
+ continue
+
+ x.ClearModifiers()
+
+ for m in mods:
+ if m in cache.variants:
+ x.AddModifier( cache.FindNamedVariant(m) )
+ else:
+ logger.Error("Unknown build variant '%s'" % m)
+ ok = False
+
+ if ok:
+ models.append(copy.copy(x))
+
+ # turn Model objects into BuildUnit objects
+ #
+ # all objects have a GenerateBuildUnits method but don't use
+ # that for Groups because it is not tolerant of errors (the
+ # first error raises an exception and the rest of the group is
+ # abandoned)
+ units = []
+
+ while len(models) > 0:
+ x = models.pop()
+ try:
+ if isinstance(x, (Alias, Variant)):
+ # these we just turn straight into BuildUnits
+ units.extend(x.GenerateBuildUnits(cache))
+ elif isinstance(x, Group):
+ # deal with each part of the group separately (later)
+ for child in x.childRefs:
+ modChild = copy.copy(child)
+ modChild.modifiers = child.modifiers + [m.name for m in x.modifiers]
+ models.append(modChild)
+ elif isinstance(x, Reference):
+ # resolve references and their modifiers
+ try:
+ obj = x.Resolve(cache)
+ modObj = copy.copy(obj)
+ modObj.modifiers = x.GetModifiers(cache)
+ except BadReferenceError,e:
+ logger.Error("Unknown reference '%s'" % str(e))
+ else:
+ models.append(modObj)
+ except Exception, e:
+ logger.Error(str(e))
+
+ return units
+
class ToolErrorException(Exception):
def __init__(self, s):
Exception.__init__(self,s)
@@ -1364,6 +1458,9 @@
class UninitialisedVariableException(Exception):
pass
+class RecursionException(Exception):
+ pass
+
class Evaluator(object):
"""Determine the values of variables under different Configurations.
Either of specification and buildUnit may be None."""
@@ -1436,7 +1533,6 @@
for k, v in self.dict.items():
if v.find('$(' + k + ')') != -1:
raise RecursionException("Recursion Detected in variable '%s' in configuration '%s' " % (k,configName))
- expanded = "RECURSIVE_INVALID_STRING"
else:
expanded = self.ExpandAll(v, specName, configName)
diff -r 6cc6d1d59188 -r 9bebdb95e0de sbsv2/raptor/python/raptor_make.py
--- a/sbsv2/raptor/python/raptor_make.py Tue Apr 06 11:42:16 2010 +0100
+++ b/sbsv2/raptor/python/raptor_make.py Wed Apr 07 12:34:10 2010 +0100
@@ -37,7 +37,19 @@
class BadMakeEngineException(Exception):
pass
+def string_following(prefix, str):
+ """If str starts with prefix then return the rest of str, otherwise None"""
+ if str.startswith(prefix):
+ return str[len(prefix):]
+ else:
+ return None
+
def XMLEscapeLog(stream):
+ """ A generator that reads a raptor log from a stream and performs an XML escape
+ on all text between tags, which is usually make output that could contain
+ illegal characters that upset XML-based log parsers.
+ This function yields "xml-safe" output line by line.
+ """
inRecipe = False
for line in stream:
@@ -54,22 +66,49 @@
yield escape(line)
def AnnoFileParseOutput(annofile):
+ """ A generator that extracts log output from an emake annotation file,
+ perform an XML-unescape on it and "yields" it line by line. """
af = open(annofile, "r")
inOutput = False
- inParseJob = False
+
+ buildid = ""
for line in af:
line = line.rstrip("\n\r")
+
if not inOutput:
- if line.startswith("