# HG changeset patch
# User Jon Chatten
# Date 1269847696 -3600
# Node ID 824dddcc66f70cf3a6edc2224b9dd725d8683bab
# Parent 698b9b7141d78003955e0dba7a6d6ab23ea5558e# Parent 80ad0c7f75fe157b6124d256fabe772e9504ec41
merge from fix
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/RELEASE-NOTES.html
--- a/sbsv2/raptor/RELEASE-NOTES.html Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/RELEASE-NOTES.html Mon Mar 29 08:28:16 2010 +0100
@@ -22,7 +22,15 @@
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
@@ -31,14 +39,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 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/config/arm.xml
--- a/sbsv2/raptor/lib/config/arm.xml Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/config/arm.xml Mon Mar 29 08:28:16 2010 +0100
@@ -1,51 +1,62 @@
-
+
-
-
-
+
+
-
+
+
+
-
-
-
+
-
-
-
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
@@ -57,16 +68,9 @@
-
-
-
-
-
-
-
-
-
+
+
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/config/gcc.xml
--- a/sbsv2/raptor/lib/config/gcc.xml Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/config/gcc.xml Mon Mar 29 08:28:16 2010 +0100
@@ -1,33 +1,33 @@
-
-
+
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
@@ -58,7 +56,6 @@
-
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/config/gcce.xml
--- a/sbsv2/raptor/lib/config/gcce.xml Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/config/gcce.xml Mon Mar 29 08:28:16 2010 +0100
@@ -1,15 +1,15 @@
-
-
+
+
+
+
-
-
@@ -123,6 +123,6 @@
-
+
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/config/gccxml.xml
--- a/sbsv2/raptor/lib/config/gccxml.xml Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/config/gccxml.xml Mon Mar 29 08:28:16 2010 +0100
@@ -1,21 +1,20 @@
-
+
-
+
+
+
+
-
-
+
-
-
+
+
-
-
-
-
+
@@ -51,11 +50,13 @@
-
+
+
+
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/config/locations.xml
--- a/sbsv2/raptor/lib/config/locations.xml Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/config/locations.xml Mon Mar 29 08:28:16 2010 +0100
@@ -108,7 +108,7 @@
-
+
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/config/msvc.xml
--- a/sbsv2/raptor/lib/config/msvc.xml Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/config/msvc.xml Mon Mar 29 08:28:16 2010 +0100
@@ -1,11 +1,11 @@
-
+
-
+
@@ -17,8 +17,14 @@
+
+
+
+
+
+
@@ -32,7 +38,6 @@
-
@@ -44,7 +49,7 @@
-
+
@@ -57,9 +62,6 @@
-
-
-
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/config/rvct.xml
--- a/sbsv2/raptor/lib/config/rvct.xml Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/config/rvct.xml Mon Mar 29 08:28:16 2010 +0100
@@ -1,68 +1,62 @@
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -71,25 +65,35 @@
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
@@ -100,6 +104,7 @@
-
+
+
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/config/variants.xml
--- a/sbsv2/raptor/lib/config/variants.xml Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/config/variants.xml Mon Mar 29 08:28:16 2010 +0100
@@ -91,37 +91,40 @@
-
+
+
-
+
+
-
+
+
-
-
-
+
+
+
-
+
@@ -142,13 +145,13 @@
-
-
-
+
+
+
-
+
@@ -172,13 +175,13 @@
-
-
-
+
+
+
-
+
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/config/winscw.xml
--- a/sbsv2/raptor/lib/config/winscw.xml Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/config/winscw.xml Mon Mar 29 08:28:16 2010 +0100
@@ -1,24 +1,31 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -45,97 +52,96 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
diff -r 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/flm/e32abiv2.flm
--- a/sbsv2/raptor/lib/flm/e32abiv2.flm Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/flm/e32abiv2.flm Mon Mar 29 08:28:16 2010 +0100
@@ -575,8 +575,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
@@ -589,12 +588,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
@@ -607,19 +604,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
@@ -629,7 +623,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) \
@@ -649,7 +643,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) \
@@ -790,7 +784,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 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/lib/flm/resource.flm
--- a/sbsv2/raptor/lib/flm/resource.flm Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/lib/flm/resource.flm Mon Mar 29 08:28:16 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 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/python/generic_path.py
--- a/sbsv2/raptor/python/generic_path.py Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/python/generic_path.py Mon Mar 29 08:28:16 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 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/python/plugins/filter_terminal.py
--- a/sbsv2/raptor/python/plugins/filter_terminal.py Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/python/plugins/filter_terminal.py Mon Mar 29 08:28:16 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 """
@@ -435,8 +440,11 @@
sys.stdout.write("%s : errors: %s\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 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/python/raptor.py
--- a/sbsv2/raptor/python/raptor.py Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/python/raptor.py Mon Mar 29 08:28:16 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 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/python/raptor_data.py
--- a/sbsv2/raptor/python/raptor_data.py Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/python/raptor_data.py Mon Mar 29 08:28:16 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 698b9b7141d7 -r 824dddcc66f7 sbsv2/raptor/python/raptor_make.py
--- a/sbsv2/raptor/python/raptor_make.py Fri Mar 26 12:06:09 2010 +0000
+++ b/sbsv2/raptor/python/raptor_make.py Mon Mar 29 08:28:16 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("