# HG changeset patch # User Richard Taylor # Date 1264419814 0 # Node ID 9758784ab2d312a761f83ec521189b9a7915b7a5 # Parent dbb43cb033574c2f04bf3aa4b1031eb28dc9eb5e# Parent a06c1a10c603eb5bc13ce5ec342300323eb348b1 catch up to 2.12.0 diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/RELEASE-NOTES.txt --- a/sbsv2/raptor/RELEASE-NOTES.txt Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/RELEASE-NOTES.txt Mon Jan 25 11:43:34 2010 +0000 @@ -1,10 +1,60 @@ Release Notes for Symbian Build System v2 -version 2.11.4 +version 2.12.0 + +New Features: +- New 'Patchable Constants' target type: TARGETTYPE pdll +- Combine Linking and Postlinking into a single step - performance improvement. +- Support exit codes from next version of the trace compiler which will issue them +- New sbs_filter script and batchfile to ease the use of sbs_filter.py. + Allows filters to be executed over a log after a build has been done. + e.g. + + sbs_filter --filters=FilterWhat < logfile.log + + (This runs a "--what" without regenerating any makefiles or reparsing + the matadata.) +- New (beta) FilterWhatComp filter. Simulates abld log output for + use with parse_what.pl for packing up zips by component. Whatcomp output + uses the incoming epocroot value. i.e. if epocroot is relative then so is + the what output. e.g. if EPOCROOT=\ then the output will be of the form: + + "\epoc32\release\armv5\...." + + If it's "..\myepocroot" then the output will be: + + "..\myepocroot\epoc32\release\armv5". + + If it's absolute then the what output will also be absolute. +- New FilterCheck filter. This can be used with sbs_filter to perform the + equivalent of --check using the log output from a build. It is more + efficient than --check because the metadata is not parsed and no makefiles + are generated. e.g. + + sbs_filter --filters=FilterCheck < logfile.log + +- New (beta) graphical build visualisation tool (bin/timelines.py). + Requires pygame and PyOpenGL. e.g. + + python timelines.py < filename.log + +- New (beta) log analyser (recipestats.py) for recording the total time spent + in each type of recipe in the build. e.g. + + python recipestats.py < filename.log > stats.csv + + The output is in CSV format. Defect Fixes: -fix for ARM9E + ARMV5 pre-processing confusion +- fix for ARM9E + ARMV5 pre-processing confusion +- SF bug 1606: template_ext.flm wrongly creates dependencies to OTHER_CFG targets +- SF bug 1570: Adding then removing a capability can produce incorrect + result: e.g. ALL TCB -TCB becomes ALL -TCB but it should be just ALL + +Other Changes: +- Default to using Python 2.6.4 on windows (no change in compatibility with + older versions of Python). version 2.11.3 diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/bin/recipestats.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/bin/recipestats.py Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,117 @@ +#!/usr/bin/env python +# +# Copyright (c) 2007-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: +# +# display summary information about recipes from raptor logs +# e.g. total times and so on. + +import time + +class RecipeStats(object): + STAT_OK = 0 + + + def __init__(self): + self.stats = {} + self.failcount = 0 + self.failtime = 0.0 + self.failtypes = {} + self.retryfails = 0 + + def add(self, starttime, duration, name, status): + if status != RecipeStats.STAT_OK: + self.failcount += 1 + if name in self.failtypes: + self.failtypes[name] += 1 + else: + self.failtypes[name] = 1 + + if status == 128: + self.retryfails += 1 + return + + if name in self.stats: + (count, time) = self.stats[name] + self.stats[name] = (count + 1, time + duration) + else: + self.stats[name] = (1,duration) + + def recipe_csv(self): + s = "# name, time, count\n" + for (name,(count,time)) in self.stats.iteritems(): + s += '"%s",%s,%d\n' % (name, str(time), count) + return s + + + +import sys +import re + +def main(): + + f = sys.stdin + st = RecipeStats() + + recipe_re = re.compile(".*NUL 2>NUL diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/bin/sbs_check_exports.py diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/bin/sbs_filter --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/bin/sbs_filter Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,91 @@ +#!/bin/bash +# Copyright (c) 2007-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: +# raptor script +# add mingw to the PATH if we are running Cygwin on Windows +# + +# If SBS_HOME is not set in the environment then work it out +# from the path to this batch file +if [ -z "$SBS_HOME" ] ; then + temp=$0 + SBS_HOME=$(cd ${temp%/*} && echo $PWD) + export SBS_HOME=${SBS_HOME%/bin} +fi + +# Ensure that the host type is set for Raptor: +eval $($SBS_HOME/bin/gethost.sh -e) + +if [ -z "$HOSTPLATFORM" ]; then + echo "Error: HOSTPLATFORM could not be determined." 1>&2 + exit 1 +fi + +if [ ! -d "$SBS_HOME/$HOSTPLATFORM_DIR" ]; then +cat 1>&2 <&2 + echo "Check your SBS_HOME environment variable." 1>&2 +fi + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/bin/sbs_filter.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/bin/sbs_filter.bat Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,47 @@ +@rem +@rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of the License "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +@REM Automatically find SBS_HOME if it is not set +@IF NOT "%SBS_HOME%"=="" goto foundhome +@SET RAPTORBINDIR=%~dp0 +@SET WD=%cd% +@cd %RAPTORBINDIR%\.. +@SET SBS_HOME=%cd% +@cd %WD% +:foundhome + +@REM Use the cygwin set by the environment if possible +@SET __CYGWIN__=%SBS_CYGWIN% +@IF "%__CYGWIN__%"=="" SET __CYGWIN__=%SBS_HOME%\win32\cygwin + +@REM add to the search path +@SET PATH=%__CYGWIN__%\bin;%PATH% + +@REM Make sure that /tmp is not set incorrectly for sbs +@umount -u /tmp >NUL 2>NUL +@mount -u %TEMP% /tmp >NUL 2>NUL +@umount -u / >NUL 2>NUL +@mount -u %__CYGWIN__% / >NUL 2>NUL + +@REM Tell CYGWIN not to map unix security attributes to windows to +@REM prevent raptor from potentially creating read-only files: +@set CYGWIN=nontsec nosmbntsec + +@REM Run with all the arguments. +@bash %SBS_HOME%\bin\sbs_filter %* + +@ENDLOCAL +@cmd /c exit /b %ERRORLEVEL% diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/bin/sbs_filter.py --- a/sbsv2/raptor/bin/sbs_filter.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/bin/sbs_filter.py Mon Jan 25 11:43:34 2010 +0000 @@ -61,22 +61,27 @@ the_raptor.out.open(raptor_params, the_raptor.filterList.split(','), pbox) except Exception, e: - sys.stderr.write("filter exception: %s\n" % str(e)) - traceback.print_ex() + sys.stderr.write("error: problem while creating filters %s\n" % str(e)) + traceback.print_exc() sys.exit(1) # read stdin a line at a time and pass it to the Raptor object -line = " " -while line: - line = sys.stdin.readline() - the_raptor.out.write(line) +try: + line = " " + while line: + line = sys.stdin.readline() + the_raptor.out.write(line) +except: + sys.stderr.write("error: problem while filtering: %s\n" % str(e)) + traceback.print_exc() + sys.exit(1) -# from Raptor.CloseLog() -if not the_raptor.out.summary(): - the_raptor.errorCode = 1 + +# Print the summary (this can't return errors) +the_raptor.out.summary() if not the_raptor.out.close(): - the_raptor.errorCode = 1 + the_raptor.errorCode = 2 # return the error code sys.exit(the_raptor.errorCode) diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/bin/timelines.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/bin/timelines.py Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,224 @@ +# +# Copyright (c) 2007-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: +# +# Raptor log visualisation program. Takes a raptor log as standard input +# and displays timelines that represent build progress and +# how much actual parallelism there is in the build. +# This program requires the pygame and PyOpenGL modules. + +from OpenGL.GL import * +from OpenGL.GLU import * +import pygame +from pygame.locals import * +import time + +class Timeline(object): + """A bar representing a number of recipes which were executed in + time sequence. There is no guarantee about what host but in + theory they could have been executed on the same host.""" + + globalmax = 2.0 + + def __init__(self,ylevel): + self.maxtime = 0.0 + self.recipes = [] + self.ylevel = ylevel + + def append(self, recipe): + "" add this recipe to this timeline if it happens after the latest recipe already in the timeline "" + if recipe.starttime + recipe.duration > self.maxtime: + self.maxtime = recipe.starttime + recipe.duration + if self.maxtime > Timeline.globalmax: + Timeline.globalmax = self.maxtime + else: + pass + + self.recipes.append(recipe) + + def draw(self): + glLoadIdentity() + self.xscale = 4.0 / Timeline.globalmax + + glTranslatef(-2.0, -1.5, -6.0) + count = 0 + for r in self.recipes: + if count % 2 == 0: + coloff=0.8 + else: + coloff = 1.0 + + count += 1 + r.draw(self.xscale, self.ylevel, coloff) + +class Recipe(object): + """Represents a task completed in a raptor build. + Drawn as a colour-coded bar with different + colours for the various recipe types.""" + STAT_OK = 0 + colours = { + 'compile': (0.5,0.5,1.0), + 'compile2object': (0.5,0.5,1.0), + 'win32compile2object': (0.5,0.5,1.0), + 'tools2linkexe': (0.5,1.0,0.5), + 'link': (0.5,1.0,0.5), + 'linkandpostlink': (0.5,1.0,0.5), + 'win32stageonelink': (0.5,1.0,0.5), + 'tools2lib': (0.5,1.0,1.0), + 'win32stagetwolink': (1.0,0.1,1.0), + 'postlink': (1.0,0.5,1.0) + } + + def __init__(self, starttime, duration, name, status): + self.starttime = starttime + self.duration = duration + self.status = status + self.colour = (1.0, 1.0, 1.0) + if name in Recipe.colours: + self.colour = Recipe.colours[name] + else: + self.colour = (1.0,1.0,1.0) + self.name = name + + def draw(self, scale, ylevel, coloff): + if self.status == Recipe.STAT_OK: + glColor4f(self.colour[0]*coloff, self.colour[1]*coloff, self.colour[2]*coloff,0.2) + else: + glColor4f(1.0*coloff, 0.6*coloff, 0.6*coloff,0.2) + + + x = self.starttime * scale + y = ylevel + x2 = x + self.duration * scale + y2 = ylevel + 0.2 + glBegin(GL_QUADS) + glVertex3f(x, y, 0) + glVertex3f(x, y2, 0) + glVertex3f(x2, y2, 0) + glVertex3f(x2, y, 0) + glEnd() + + +def resize((width, height)): + if height==0: + height=1 + glViewport(0, 0, width, height) + glMatrixMode(GL_PROJECTION) + glLoadIdentity() + gluPerspective(45, 1.0*width/height, 0.1, 100.0) + glMatrixMode(GL_MODELVIEW) + glLoadIdentity() + +def init(): + glShadeModel(GL_SMOOTH) + glClearColor(0.0, 0.0, 0.0, 0.0) + glClearDepth(1.0) + glEnable(GL_DEPTH_TEST) + glDepthFunc(GL_LEQUAL) + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) + + +import sys +import re + +def main(): + + video_flags = OPENGL|DOUBLEBUF + + pygame.init() + pygame.display.set_mode((800,600), video_flags) + + resize((800,600)) + init() + + frames = 0 + ticks = pygame.time.get_ticks() + + + lines = 4 + timelines = [] + ylevel = 0.0 + for i in xrange(0,4): + ylevel += 0.6 + timelines.append(Timeline(ylevel)) + + f = sys.stdin + + recipe_re = re.compile(".* newdiff: + dest_timeline = t + olddiff = newdiff + tnum += 1 + + dest_timeline.append(Recipe(s, elapsed, rname, status)) + event = pygame.event.poll() + if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): + break + + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) + for t in timelines: + t.draw() + pygame.display.flip() + + frames = frames+1 + + print "fps: %de" % ((frames*1000)/(pygame.time.get_ticks()-ticks)) + event = pygame.event.wait() + + +if __name__ == '__main__': main() diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/config/interfaces.xml --- a/sbsv2/raptor/lib/config/interfaces.xml Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/config/interfaces.xml Mon Jan 25 11:43:34 2010 +0000 @@ -5,12 +5,13 @@ - + + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/config/locations.xml --- a/sbsv2/raptor/lib/config/locations.xml Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/config/locations.xml Mon Jan 25 11:43:34 2010 +0000 @@ -72,7 +72,7 @@ - + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/config/variants.xml --- a/sbsv2/raptor/lib/config/variants.xml Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/config/variants.xml Mon Jan 25 11:43:34 2010 +0000 @@ -187,7 +187,6 @@ - diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/config/winscw.xml --- a/sbsv2/raptor/lib/config/winscw.xml Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/config/winscw.xml Mon Jan 25 11:43:34 2010 +0000 @@ -26,6 +26,7 @@ + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/e32abiv2.flm --- a/sbsv2/raptor/lib/flm/e32abiv2.flm Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2.flm Mon Jan 25 11:43:34 2010 +0000 @@ -384,7 +384,22 @@ # Generating the import library is enough if TARGETTYPE=implib ############# ifneq ($(DOPOSTLINK),) -include $(FLMHOME)/e32postlink.mk +# Capabilities +FINAL_CAPABILITIES:=$(if $(CAPABILITY),$(CAPABILITY),NONE) + +# Paging options for the old postlinker +POSTLINKER_PAGEDOPTION:=--defaultpaged +ifeq ($(PAGED),1) + POSTLINKER_PAGEDOPTION:=--paged +endif +ifeq ($(PAGED),0) + POSTLINKER_PAGEDOPTION:=--unpaged +endif + +CLEANTARGETS:=$(CLEANTARGETS) $(E32TARGET) +CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DEFFILE) +CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DSO) + endif # ifneq ($(DOPOSTLINK),) ifneq ($(TARGETTYPE),implib) @@ -592,10 +607,10 @@ # outside the relevant tags but it is also unavoidable. define linktarget_func ## The actual link target, dependencies and build step -$(LINK_TARGET): $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS),$(LINKOBJECTS)) $(escaped_e32abiv2_LIBS) $(LINKER_ENTRYPOINT_LIBDEP) $(if $(SUPPORTS_STDCPP_NEWLIB),$(CHECKLIB)) $(if $(LINKERFEEDBACK_STAGE2),$(FEEDBACKFILE),) +$(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 $(if $(MULTIFILE_ENABLED),,@echo -n "" > $(VIAFILE); $(call groupin10,$(LINKOBJECTS)) ;) - $(call startrule,link) \ + $(call startrule,linkandpostlink) \ $(if $(PERTURBSTARTTIME),$(RANSLEEP) $(PERTURBMSECS) ;,) \ $(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(located_STATICLIBRARIES),$(CHECKLIB) $(CHECKLIB_TYPE) --elf $(call dblquote,$(located_STATICLIBRARIES)) &&,),) \ $(LD) $(LINKER_MISC_FLAGS) $(LINKER_DEFAULT_LIB_PATHS) $(SYMBIAN_LINK_FLAGS) $(if $(DEBUG_INFO),$(LINKER_DEBUG_OPTION),$(LINKER_NODEBUG_OPTION)) \ @@ -605,19 +620,61 @@ $(LINKER_ARCH_OPTION) \ $(SYMVER_OPTION) $(SO_NAME_OPTION)=$(call dblquote,$(LINKASVERSIONED)) \ $(LINKER_ENTRYPOINT_SETTING) \ - -o $$(call dblquote,$$@) \ + -o $$(call dblquote,$(LINK_TARGET)) \ $(if $(LTCG),$(LTCG_OPTION),) \ $(LINKER_SYMBOLS_OPTION) $(LINKER_SYMBOLS_FILE_OPTION)=$(call dblquote,$(MAPFILE)) \ $(LINKEROPTION) \ $(if $(MULTIFILE_ENABLED),$(call dblquote,$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS)),$(COMMANDFILE_OPTION)$(call dblquote,$(VIAFILE))) \ - $(if $(GENERATELINKERFEEDBACK),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \ + $(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 endrule,link) + $(quoted_e32abiv2_LIBS) $(LINKER_DEFAULT_LIBS) && \ + $(ELF2E32) \ + --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \ + --version=$(VERSION) \ + --capability=$(FINAL_CAPABILITIES) \ + --linkas=$(call dblquote,$(LINKASVERSIONED)) \ + --fpu=$(if $(ARMFPU),$(ARMFPU),$(POSTLINKER_FPU_DEFAULT)) \ + --targettype=$(POSTLINKTARGETTYPE) \ + --output=$$(call dblquote,$$@) \ + --elfinput=$(call dblquote,$(LINK_TARGET)) \ + $(if $(UID1),--uid1=0x$(UID1),) \ + $(if $(UID2),--uid2=0x$(UID2),) \ + $(if $(UID3),--uid3=0x$(UID3),) \ + $(if $(VENDORID),--vid=0x$(VENDORID),) \ + $(if $(EXPTARGET),--customdlltarget,) \ + $(if $(ARMLIBS),--excludeunwantedexports,) \ + $(if $(EPOCALLOWDLLDATA),--dlldata,) \ + $(if $(EPOCPROCESSPRIORITY),--priority=$(EPOCPROCESSPRIORITY),) \ + $(if $(EPOCSTACKSIZE),--stack=0x$(EPOCSTACKSIZE),) \ + $(if $(EPOCHEAPSIZEMIN),--heap=0x$(EPOCHEAPSIZEMIN)$(CHAR_COMMA)0x$(EPOCHEAPSIZEMAX),) \ + $(if $(EPOCFIXEDPROCESS),--fixedaddress,) \ + $(if $(EPOCDATALINKADDRESS),--datalinkaddress=$(EPOCDATALINKADDRESS),) \ + $(if $(NAMEDSYMLKUP),--namedlookup,) \ + $(if $(SMPSAFE),--smpsafe,) \ + $(if $(POSTLINKDEFFILE),--definput=$(POSTLINKDEFFILE),) \ + $(if $(EXPORTUNFROZEN),--unfrozen,) \ + $(if $(AUTOEXPORTS),--sysdef=$(call dblquote,$(AUTOEXPORTS)),) \ + $(if $(CANIGNORENONCALLABLE), \ + $(if $(IMPORTLIBRARYREQUIRED),,--ignorenoncallable),) \ + $(if $(CANHAVEEXPORTS), --defoutput=$(call dblquote,$(GENERATED_DEFFILE)) --dso=$(GENERATED_DSO)) \ + $(if $(filter $(VARIANTTYPE),$(DEBUGGABLE)),--debuggable,) \ + $(if $(POSTLINKER_SUPPORTS_WDP), \ + --codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \ + $(POSTLINKER_PAGEDOPTION)) \ + $(if $(NOCOMPRESSTARGET),--uncompressed, \ + $(if $(INFLATECOMPRESSTARGET),--compressionmethod=inflate, \ + $(if $(BYTEPAIRCOMPRESSTARGET),--compressionmethod=bytepair, \ + --compressionmethod=$(POSTLINKER_COMPRESSION_DEFAULT)))) \ + --libpath="$(call concat,$(PATHSEP)$(CHAR_SEMIC),$(strip $(RUNTIME_LIBS_PATH) $(STATIC_LIBS_PATH)))" \ + $(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,&& { $(GNURM) -rf $(INTERMEDIATEPATH); true; })) \ + $(call endrule,linkandpostlink) -$(MAPFILE): $(LINK_TARGET) +$(MAPFILE): $(E32TARGET) +$(LINK_TARGET): $(E32TARGET) endef +ifneq ($(DOPOSTLINK),) $(eval $(linktarget_func)) +endif # ifneq ($(DOPOSTLINK),) CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT)) WHATRELEASE:=$(WHATRELEASE) $(MAPFILE) diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/e32abiv2defaults.mk --- a/sbsv2/raptor/lib/flm/e32abiv2defaults.mk Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2defaults.mk Mon Jan 25 11:43:34 2010 +0000 @@ -59,7 +59,7 @@ LINKER_ENTRYPOINT_ADORNMENT:=(uc_exe_.o) endif - ifeq ($(call isoneof,$(TARGETTYPE),ani textnotifier2 stddll plugin fsy pdl dll),1) + ifeq ($(call isoneof,$(TARGETTYPE),ani textnotifier2 stddll plugin fsy pdl dll pdll),1) LINKER_ENTRYPOINT_ADORNMENT:=(uc_dll_.o) endif diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/e32abiv2dll.flm --- a/sbsv2/raptor/lib/flm/e32abiv2dll.flm Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2dll.flm Mon Jan 25 11:43:34 2010 +0000 @@ -55,6 +55,6 @@ $(call vrestore) else -$(error $e32abiv2dll.flm called with wrong TARGETTYPE (should be 'dll' but is '$(TARGETTYPE)')) +$(error e32abiv2dll.flm called with wrong TARGETTYPE (should be 'dll' but is '$(TARGETTYPE)')) endif diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/e32abiv2pdll.flm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2pdll.flm Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,61 @@ +# 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: +# ARMv5 PDLL ABIv2 Function Like Makefile (FLM) +# Build an e32 PDLL (Patchable constants DLL) +# +# + +ifeq ($(TARGETTYPE),pdll) +include $(FLMHOME)/e32abiv2defaults.mk + +# What we need to build a DLL +ifeq ($(NOEXPORTLIBRARY),) +IMPORTLIBRARYREQUIRED:=1 +endif +POSTLINKDEFFILE:=$(DEFFILE) +SUPPORT_FREEZE:=1 + +# Default Linker settings for this target type +LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edll.lib +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) + +ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) +endif + +LINKER_STUB_LIBRARY:=$(STATIC_RUNTIME_DIR)/edllstub.lib +STATIC_RUNTIME_LIB:=$(USER_STATIC_RUNTIME_LIB) + + +# Default Postlinker settings +CANHAVEEXPORTS:=1 +POSTLINKTARGETTYPE:=DLL +POSTLINKFILETYPE:=dll +DOPOSTLINK:=1 +CANIGNORENONCALLABLE:=1 + +# Use the general EABI FLM +# We are appending to CDEFS but we don't want this to affect +# other invocations so we are going to save it on a stack +# and restore it afterwards +$(call vsave,CDEFS) +CDEFS:=$(CDEFS) __DLL__ +include $(FLMHOME)/e32abiv2.flm +$(call vrestore) + +else +$(error e32abiv2pdll.flm called with wrong TARGETTYPE (should be 'pdll' but is '$(TARGETTYPE)')) +endif + + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/e32postlink.mk --- a/sbsv2/raptor/lib/flm/e32postlink.mk Tue Jan 19 14:28:16 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -# -# 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: -# ARMv5 e32 postlinking FLM -# Knows how to postlink all possible ABIV2 executables for ARM -# - -# Interface -# -# Metadata supplied (or deduced from) -# -# ARMFPU -# BYTEPAIRCOMPRESSTARGET -# CAPABILITY -# COMPRESSTARGET Not directly referenced, at least with the current approach to compression keywords -# DEBUGGABLE Can be "udeb" or "urel" or "udeb urel" or "" -# E32TARGET -# EPOCALLOWDLLDATA -# EPOCFIXEDPROCESS -# EPOCHEAPSIZEMAX -# EPOCHEAPSIZEMIN -# EPOCPROCESSPRIORITY -# EPOCSTACKSIZE -# EXPORTUNFROZEN -# INFLATECOMPRESSTARGET -# NOCOMPRESSTARGET -# POSTLINKTARGETTYPE -# SID -# SMPSAFE -# UID2 -# UID3 -# VERSION -# VENDORID -# -# Other -# -# ARMLIBS -# AUTOEXPORTS Symbols that must be assumed to exist for this TARGETTYPE in the format: export,ordinal;export,ordinal;.. -# CANIGNORENONCALLABLE If the TARGETTYPE allows it, disregard non-callable exports (v-tables, type information, etc.) -# CANHAVEEXPORTS -# CLEANTARGETS -# ELF2E32 -# EPOCDATALINKADDRESS Redundant? -# EPOCROOT -# EXPTARGET -# GENERATED_DEFFILE -# GENERATED_DSO -# HAVE_ORDERONLY -# IMPORTLIBRARYREQUIRED -# INTERMEDIATEPATH -# LINKASVERSIONED -# LINK_TARGET Postlinker elf input -# NAMEDSYMLKUP -# PAGEDCODE_OPTION -# POSTLINKDEFFILE -# POSTLINKER_COMPRESSION_DEFAULT Default compression when either COMPRESSTARGET or no compression .mmp keyword is used -# POSTLINKER_FPU_DEFAULT -# POSTLINKER_SUPPORTS_WDP -# RUNTIME_LIBS_PATH -# SAVESPACE -# STATIC_LIBS_PATH -# UID1 -# VARIANTTYPE - - -# Capabilities -ADDED_CAPABILITIES:=$(subst $(CHAR_SPACE),+,$(filter-out -%,$(CAPABILITY))) -SUBTRACTED_CAPABILITIES:=$(subst $(CHAR_SPACE),,$(filter -%,$(CAPABILITY))) -FINAL_CAPABILITIES:=$(if $(ADDED_CAPABILITIES),$(ADDED_CAPABILITIES)$(SUBTRACTED_CAPABILITIES),NONE) - -# Paging options for the old postlinker -POSTLINKER_PAGEDOPTION:=--defaultpaged -ifeq ($(PAGED),1) - POSTLINKER_PAGEDOPTION:=--paged -endif -ifeq ($(PAGED),0) - POSTLINKER_PAGEDOPTION:=--unpaged -endif - -# Postlink target -define e32postlink -$(E32TARGET): $(LINK_TARGET) $(POSTLINKDEFFILE) $(ELF2E32) $(if $(HAVE_ORDERONLY),|,) $(EPOCROOT)/epoc32/build/TEM_LIB - $(call startrule,postlink) \ - $(ELF2E32) \ - --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \ - --version=$(VERSION) \ - --capability=$(FINAL_CAPABILITIES) \ - --linkas=$(call dblquote,$(LINKASVERSIONED)) \ - --fpu=$(if $(ARMFPU),$(ARMFPU),$(POSTLINKER_FPU_DEFAULT)) \ - --targettype=$(POSTLINKTARGETTYPE) \ - --output=$$(call dblquote,$$@) \ - --elfinput=$(call dblquote,$(LINK_TARGET)) \ - $(if $(UID1),--uid1=0x$(UID1),) \ - $(if $(UID2),--uid2=0x$(UID2),) \ - $(if $(UID3),--uid3=0x$(UID3),) \ - $(if $(VENDORID),--vid=0x$(VENDORID),) \ - $(if $(EXPTARGET),--customdlltarget,) \ - $(if $(ARMLIBS),--excludeunwantedexports,) \ - $(if $(EPOCALLOWDLLDATA),--dlldata,) \ - $(if $(EPOCPROCESSPRIORITY),--priority=$(EPOCPROCESSPRIORITY),) \ - $(if $(EPOCSTACKSIZE),--stack=0x$(EPOCSTACKSIZE),) \ - $(if $(EPOCHEAPSIZEMIN),--heap=0x$(EPOCHEAPSIZEMIN)$(CHAR_COMMA)0x$(EPOCHEAPSIZEMAX),) \ - $(if $(EPOCFIXEDPROCESS),--fixedaddress,) \ - $(if $(EPOCDATALINKADDRESS),--datalinkaddress=$(EPOCDATALINKADDRESS),) \ - $(if $(NAMEDSYMLKUP),--namedlookup,) \ - $(if $(SMPSAFE),--smpsafe,) \ - $(if $(POSTLINKDEFFILE),--definput=$(POSTLINKDEFFILE),) \ - $(if $(EXPORTUNFROZEN),--unfrozen,) \ - $(if $(AUTOEXPORTS),--sysdef=$(call dblquote,$(AUTOEXPORTS)),) \ - $(if $(CANIGNORENONCALLABLE), \ - $(if $(IMPORTLIBRARYREQUIRED),,--ignorenoncallable),) \ - $(if $(CANHAVEEXPORTS), --defoutput=$(call dblquote,$(GENERATED_DEFFILE)) --dso=$(GENERATED_DSO)) \ - $(if $(filter $(VARIANTTYPE),$(DEBUGGABLE)),--debuggable,) \ - $(if $(POSTLINKER_SUPPORTS_WDP), \ - --codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \ - $(POSTLINKER_PAGEDOPTION)) \ - $(if $(NOCOMPRESSTARGET),--uncompressed, \ - $(if $(INFLATECOMPRESSTARGET),--compressionmethod=inflate, \ - $(if $(BYTEPAIRCOMPRESSTARGET),--compressionmethod=bytepair, \ - --compressionmethod=$(POSTLINKER_COMPRESSION_DEFAULT)))) \ - --libpath="$(call concat,$(PATHSEP)$(CHAR_SEMIC),$(strip $(RUNTIME_LIBS_PATH) $(STATIC_LIBS_PATH)))" \ - $(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,&& { $(GNURM) -rf $(INTERMEDIATEPATH); true; })) \ - $(call endrule,postlink) -endef -$(eval $(e32postlink)) - -CLEANTARGETS:=$(CLEANTARGETS) $(E32TARGET) -CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DEFFILE) -CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DSO) diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/emulator.xml --- a/sbsv2/raptor/lib/flm/emulator.xml Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/flm/emulator.xml Mon Jan 25 11:43:34 2010 +0000 @@ -151,6 +151,23 @@ + + + + + + + + + + + + + + + + + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/standard.xml --- a/sbsv2/raptor/lib/flm/standard.xml Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/flm/standard.xml Mon Jan 25 11:43:34 2010 +0000 @@ -212,6 +212,10 @@ + + + + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/template_ext.flm --- a/sbsv2/raptor/lib/flm/template_ext.flm Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/flm/template_ext.flm Mon Jan 25 11:43:34 2010 +0000 @@ -81,11 +81,10 @@ # to be target specific to the unique targets # that we have created. -UNIQ:=$(TEMPLATE_EXTENSION_MAKEFILE)$(PLATFORM)$(TO_ROOT)$(TO_BLDINF)$(EPOCBLD)$(EXTENSION_ROOT)$(TEMCOUNT) +UNIQ:=$(TEMPLATE_EXTENSION_MAKEFILE)$(VARIANTPLATFORM)$(TO_ROOT)$(TO_BLDINF)$(EPOCBLD)$(EXTENSION_ROOT)$(TEMCOUNT) UNIQ:=$(word 1,$(shell echo $(UNIQ) | $(GNUMD5SUM))) # Work out the other FINAL target if we're building both udeb and urel -ifneq ($($(UNIQ)),) ifeq ($(CFG),urel) OTHER_CFG:=udeb @@ -100,6 +99,7 @@ OTHER_CFG:=rel endif +ifneq ($($(UNIQ)_$(OTHER_CFG)),) OTHER_MAKMAKE:=$(UNIQ)_$(OTHER_CFG)_MAKMAKE OTHER_BLD:=$(UNIQ)_$(OTHER_CFG)_BLD OTHER_FREEZE:=$(UNIQ)_$(OTHER_CFG)_FREEZE @@ -111,7 +111,7 @@ endif # ifneq ($($(UNIQ)),) # Set $($(UNIQ)) so it can be detected if we're run again -$(UNIQ):=1 +$(UNIQ)_$(CFG):=1 tem_$(notdir $(TEMPLATE_EXTENSION_MAKEFILE))_$(PLATFORM)_$(CFG):=$(tem_$(notdir $(TEMPLATE_EXTENSION_MAKEFILE))_$(PLATFORM)_$(CFG)) $(UNIQ)_$(CFG) diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/tracecompiler.mk --- a/sbsv2/raptor/lib/flm/tracecompiler.mk Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/flm/tracecompiler.mk Mon Jan 25 11:43:34 2010 +0000 @@ -63,9 +63,9 @@ ( echo -en "$(TRACE_PRJNAME)\n$(PROJECT_META)\n"; \ $(GNUCAT) $(TRACE_SOURCE_LIST); \ echo -en "*ENDOFSOURCEFILES*\n" ) | \ - $(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) && \ - $(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) ; \ - $(GNUCAT) $(TRACE_SOURCE_LIST) \ + $(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) && \ + $(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \ + { $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \ $(call endrule,tracecompile) endef diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/win32dll.flm --- a/sbsv2/raptor/lib/flm/win32dll.flm Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/lib/flm/win32dll.flm Mon Jan 25 11:43:34 2010 +0000 @@ -30,5 +30,5 @@ include $(FLMHOME)/win32.flm else -$(error $win32dll.flm called with wrong TARGETTYPE (should be 'dll' but is '$(TARGETTYPE)')) +$(error win32dll.flm called with wrong TARGETTYPE (should be 'dll' but is '$(TARGETTYPE)')) endif diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/lib/flm/win32pdll.flm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/lib/flm/win32pdll.flm Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,34 @@ +# 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: +# WINSCW PDLL Function Like Makefile (FLM) +# Build an emulator PDLL +# +# + +ifeq ($(TARGETTYPE),pdll) + +BASE_TYPE:=dll +CW_STATIC_RUNTIME:=1 +FIRST_STATLIB:= +FIXED_EXPORT:= +SUPPORTS_IMPORT_LIBRARY:=1 +SYSTEM_TARGET:=0 +UID2_DEFAULT:= + +# Use the general win32 FLM +include $(FLMHOME)/win32.flm + +else +$(error $winp32dll.flm called with wrong TARGETTYPE (should be 'dll' but is '$(TARGETTYPE)')) +endif diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/python/plugins/filter_check.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/python/plugins/filter_check.py Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,29 @@ +# +# 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 --what and --check operations +# + +import os +import sys +import re +import filter_interface +import filter_what + +class FilterCheck(filter_what.FilterWhat): + + def __init__(self): + super(filter_what.FilterWhat,self).__init__() + self.check = True + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/python/plugins/filter_terminal.py --- a/sbsv2/raptor/python/plugins/filter_terminal.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/python/plugins/filter_terminal.py Mon Jan 25 11:43:34 2010 +0000 @@ -113,6 +113,7 @@ "asmcompile" : "asmcompile" , "compile" : "compile" , "postlink" : "target", + "linkandpostlink" : "target", "resourcecompile" : "resource", "genstringtable" : "strtable", "tem" : "tem", diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/python/plugins/filter_what.py --- a/sbsv2/raptor/python/plugins/filter_what.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/python/plugins/filter_what.py Mon Jan 25 11:43:34 2010 +0000 @@ -22,6 +22,10 @@ class FilterWhat(filter_interface.Filter): + def __init__(self): + super(filter_interface.Filter,self).__init__() + self.path_prefix_to_strip = None + self.path_prefix_to_add_on = None def print_file(self, line, start, end): "Ensure DOS slashes on Windows" @@ -33,6 +37,12 @@ filename = line[(start + 1):end].replace("/","\\") else: filename = line[(start + 1):end] + + if self.path_prefix_to_strip: + if filename.startswith(self.path_prefix_to_strip): + filename = filename[len(self.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): @@ -42,6 +52,12 @@ self.outfile.write(filename+"\n") self.prints += 1 + + def start_bldinf(self, bldinf): + pass + + def end_bldinf(self): + pass def open(self, build_parameters): @@ -79,6 +95,10 @@ "Regex for zip exports" self.zip_export_regex = re.compile("^.*") + + "Regex for determining bld.inf name" + self.whatlog_regex = re.compile("^", "]]>")) # and some general debug stuff @@ -822,7 +825,7 @@ return self.home.Append(aGenericPath) else: return aGenericPath - + # make generic paths absolute (if required) self.configPath = map(mkAbsolute, self.configPath) self.cache.Load(self.configPath) @@ -859,12 +862,12 @@ return x def GetBuildUnitsToBuild(self, configNames): - """Return a list of the configuration objects that correspond to the + """Return a list of the configuration objects that correspond to the list of configuration names in the configNames parameter. raptor.GetBuildUnitsToBuild(["armv5", "winscw"]) >>> [ config1, config2, ... , configN ] - """ + """ if len(configNames) == 0: # use default config @@ -878,9 +881,9 @@ for c in set(configNames): self.Debug("BuildUnit: %s", c) - try: + try: x = self.GetConfig(c) - gb = x.GenerateBuildUnits(self.cache) + gb = x.GenerateBuildUnits(self.cache) buildUnitsToBuild.update( gb ) except Exception, e: self.FatalError(str(e)) @@ -894,7 +897,7 @@ return buildUnitsToBuild def CheckToolset(self, evaluator, configname): - """Check the toolset for a particular config, allow other objects access + """Check the toolset for a particular config, allow other objects access to the toolset for this build (e.g. the raptor_make class).""" if self.toolset is None: if self.toolcheck == 'on': @@ -968,7 +971,7 @@ def FindComponentIn(self, aDir = None): - # look for a bld.inf + # look for a bld.inf if aDir is None: dir = generic_path.CurrentDir() @@ -1109,14 +1112,14 @@ for a,v in dictionary.items(): atts += " " + a + "='" + v + "'" return atts - + def Info(self, format, *extras, **attributes): """Send an information message to the configured channel (XML control characters will be escaped) """ self.out.write("" + escape(format % extras) + "\n") - + def InfoDiscovery(self, object_type, count): if self.timing: try: @@ -1124,7 +1127,7 @@ count = count)) except Exception, exception: Error(exception.Text, function = "InfoDiscoveryTime") - + def InfoStartTime(self, object_type, task, key): if self.timing: try: @@ -1132,7 +1135,7 @@ task = task, key = key)) except Exception, exception: Error(exception.Text, function = "InfoStartTime") - + def InfoEndTime(self, object_type, task, key): if self.timing: try: @@ -1154,7 +1157,7 @@ """Send a warning message to the configured channel (XML control characters will be escaped) """ - self.out.write("" + + self.out.write("" + escape(format % extras) + "\n") def FatalError(self, format, *extras, **attributes): @@ -1165,7 +1168,7 @@ further errors are probably triggered by the first. """ if not self.fatalErrorState: - self.out.write("" + + self.out.write("" + (format % extras) + "\n") self.errorCode = 1 self.fatalErrorState = True @@ -1174,7 +1177,7 @@ """Send an error message to the configured channel (XML control characters will be escaped) """ - self.out.write("" + + self.out.write("" + escape(format % extras) + "\n") self.errorCode = 1 @@ -1212,7 +1215,7 @@ if self.systemDefinitionFile != None: systemModel = raptor_xml.SystemModel(self, self.systemDefinitionFile, self.systemDefinitionBase) layers = self.GatherSysModelLayers(systemModel, self.systemDefinitionRequestedLayers) - + # Now get components specified on a commandline - build them after any # layers in the system definition. if len(self.commandlineComponents) > 0: @@ -1246,7 +1249,7 @@ self.Introduction() # establish an object cache self.AssertBuildOK() - + self.LoadCache() # find out what configurations to build @@ -1299,7 +1302,7 @@ for l in layers: # create specs for a specific group of components l.realise(self) - + except BuildCannotProgressException,b: if str(b) != "": self.Info(str(b)) @@ -1326,7 +1329,7 @@ build.ProcessConfig() build.CommandLine(argv) - return build + return build @@ -1334,6 +1337,8 @@ class BuildStats(object): def __init__(self, raptor_instance): + self.incoming_epocroot = incoming_epocroot + self.epocroot = epocroot self.logFileName = raptor_instance.logFileName self.quiet = raptor_instance.quiet self.doCheck = raptor_instance.doCheck diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/python/raptor_data.py --- a/sbsv2/raptor/python/raptor_data.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/python/raptor_data.py Mon Jan 25 11:43:34 2010 +0000 @@ -722,15 +722,23 @@ def Apply(self, oldValue): try: value = os.environ[self.name] - - # 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 value and (self.type == "path" or self.type == "tool"): - 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 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": + 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 + elif value.endswith('\\'): + # an odd number of backslashes means there's one to escape + count = len(value) - len(value.rstrip('\\')) + if count % 2: + value += '\\' except KeyError: if self.default != None: value = self.default diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/python/raptor_make.py --- a/sbsv2/raptor/python/raptor_make.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/python/raptor_make.py Mon Jan 25 11:43:34 2010 +0000 @@ -30,6 +30,8 @@ from raptor_makefile import * import traceback import sys +from xml.sax.saxutils import escape + # raptor_make module classes @@ -403,7 +405,7 @@ command = self.buildCommand if self.makefileOption: - command += " " + self.makefileOption + " " + '"' + str(makefile) + '"' + command += " " + self.makefileOption + " " + ' "' + str(makefile) + '" ' if self.raptor.keepGoing and self.keepGoingOption: command += " " + self.keepGoingOption @@ -416,7 +418,11 @@ command += " " + self.defaultMakeOptions # Can supply options on the commandline to override default settings. if len(self.raptor.makeOptions) > 0: - command += " " + " ".join(self.raptor.makeOptions) + for o in self.raptor.makeOptions: + if o.find(";") != -1 or o.find("\\") != -1: + command += " " + "'" + o + "'" + else: + command += " " + o # Switch off dependency file including? if self.raptor.noDependInclude: @@ -449,6 +455,12 @@ if addTargets: command += " " + " ".join(addTargets) + # Send stderr to a file so that it can't mess up the log (e.g. + # clock skew messages from some build engines scatter their + # output across our xml. + stderrfilename = makefile+'.stderr' + command += " 2>'%s' " % stderrfilename + # Substitute the makefile name for any occurrence of #MAKEFILE# command = command.replace("#MAKEFILE#", str(makefile)) @@ -469,16 +481,20 @@ makeenv['TALON_SHELL']=self.talonshell makeenv['TALON_BUILDID']=str(self.buildID) makeenv['TALON_TIMEOUT']=str(self.talontimeout) + if self.raptor.filesystem == "unix": - p = subprocess.Popen(command, bufsize=65535, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - close_fds=True, env=makeenv, shell=True) + p = subprocess.Popen([command], bufsize=65535, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + close_fds=True, env=makeenv, shell=True) else: - p = subprocess.Popen(command, bufsize=65535, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - universal_newlines=True, env=makeenv) + p = subprocess.Popen(args = + [raptor_data.ToolSet.shell, '-c', command], + bufsize=65535, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + shell = False, + universal_newlines=True, env=makeenv) stream = p.stdout @@ -487,6 +503,7 @@ line = stream.readline() self.raptor.out.write(line) + # should be done now returncode = p.wait() @@ -494,6 +511,17 @@ self.raptor.InfoEndTime(object_type = "makefile", task = "build", key = str(makefile)) + # Take all the stderr output that went into the .stderr file + # and put it back into the log, but safely so it can't mess up + # xml parsers. + try: + e = open(stderrfilename,"r") + for line in e: + self.raptor.out.write(escape(line)) + e.close() + except Exception,e: + self.raptor.Error("Couldn't complete stderr output for %s - '%s'", command, str(e)) + if returncode != 0 and not self.raptor.keepGoing: self.Tidy() return False diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/python/raptor_meta.py --- a/sbsv2/raptor/python/raptor_meta.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/python/raptor_meta.py Mon Jan 25 11:43:34 2010 +0000 @@ -1451,7 +1451,12 @@ elif varname=='CAPABILITY': for cap in toks[1]: + cap = cap.lower() self.__debug("Setting "+toks[0]+": " + cap) + if cap != "all": + if not cap.startswith("-"): + if not cap.startswith("+"): + cap = "+" + cap self.capabilities.append(cap) elif varname=='DEFFILE': self.__defFileRoot = self.__currentMmpFile @@ -2198,18 +2203,21 @@ self.ResourceVariants[i].AddOperation(raptor_data.Set("MAIN_REQUESTEDTARGETEXT", self.__TARGETEXT.lower())) # Create Capability variable in one SET operation (more efficient than multiple appends) - self.BuildVariant.AddOperation(raptor_data.Set("CAPABILITY"," ".join(self.capabilities))) + + self.BuildVariant.AddOperation(raptor_data.Set("CAPABILITY","".join(self.capabilities))) # Resolve combined capabilities as hex flags, for configurations that require them capabilityFlag1 = 0 capabilityFlag2 = 0 # Always 0 - for capability in [c.lower() for c in self.capabilities]: + for capability in self.capabilities: invert = 0 if capability.startswith('-'): invert = 0xffffffff - capability = capability.lstrip('-') + capability = capability[1:] + elif capability.startswith('+'): + capability = capability[1:] if MMPRaptorBackend.supportedCapabilities.has_key(capability): capabilityFlag1 = capabilityFlag1 ^ invert diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/python/raptor_version.py --- a/sbsv2/raptor/python/raptor_version.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/python/raptor_version.py Mon Jan 25 11:43:34 2010 +0000 @@ -15,7 +15,7 @@ # raptor version information module # -version=(2,11,3,"2010-01-12","symbian build system") +version=(2,12,0,"2010-01-25","symbian build system") def numericversion(): """Raptor version string""" diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/common/run_tests.py --- a/sbsv2/raptor/test/common/run_tests.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/test/common/run_tests.py Mon Jan 25 11:43:34 2010 +0000 @@ -517,6 +517,18 @@ return keys +# Make SBS_HOME, EPOCROOT have uppercase drive letters to match os.getcwd() and +# thus stop all those insane test problems which result from one being uppercase +# and the other lowercase + +if sys.platform.startswith("win"): + sh = os.environ['SBS_HOME'] + if sh[1] == ':': + os.environ['SBS_HOME'] = sh[0].upper() + sh[1:] + er = os.environ['EPOCROOT'] + if er[1] == ':': + os.environ['EPOCROOT'] = er[0].upper() + er[1:] + # Clean epocroot before running tests raptor_tests.clean_epocroot() run_tests = SuiteRun(suitepattern = options.suite, testpattern = options.tests, diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/run.bat --- a/sbsv2/raptor/test/run.bat Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/test/run.bat Mon Jan 25 11:43:34 2010 +0000 @@ -21,7 +21,7 @@ setlocal set __PYTHON__=%SBS_PYTHON% -if "%__PYTHON__%"=="" set __PYTHON__=%SBS_HOME%\win32\python252\python.exe +if "%__PYTHON__%"=="" set __PYTHON__=%SBS_HOME%\win32\python264\python.exe set __TEST_SUITE__=%SBS_HOME%\test\common\run_tests.pyc set __TEST_SUITE_PY__=%SBS_HOME%\test\common\run_tests.py diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/capability_arm.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/capability_arm.py Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,76 @@ +# +# 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". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +from raptor_tests import SmokeTest +import sys + +def run(): + t = SmokeTest() + t.usebash = True + + + if sys.platform.startswith("win"): + elf2e32 = "$(EPOCROOT)/epoc32/tools/elf2e32.exe" + else: + elf2e32 = "$(EPOCROOT)/epoc32/tools/elf2e32" + + description = """This test attempts to check that an exe gets the capabilities that we requested. It's ARM specific since it uses elf2e32. Tries to demonstrate capabilties being turned off then on in the mmp.""" + command = "sbs -b smoke_suite/test_resources/simple/capability.inf -c %s -m ${SBSMAKEFILE} -f ${SBSLOGFILE} && " + \ + elf2e32 + " --dump=s --e32input=$(EPOCROOT)/epoc32/release/armv5/urel/test_capability.exe" + targets = [ + "$(EPOCROOT)/epoc32/release/armv5/urel/test_capability.exe", + "$(EPOCROOT)/epoc32/release/armv5/urel/test_capability.exe.map" + ] + buildtargets = [ + ] + mustmatch = [ + "\s*Secure ID: 10003a5c$", + "\s*Vendor ID: 00000000$", + "\s*Capabilities: 00000000 000fffbf$", + "\s*CommDD$", + "\s*PowerMgmt$", + "\s*MultimediaDD$", + "\s*ReadDeviceData$", + "\s*WriteDeviceData$", + "\s*TrustedUI$", + "\s*DiskAdmin$", + "\s*NetworkControl$", + "\s*AllFiles$", + "\s*SwEvent$", + "\s*NetworkServices$", + "\s*LocalServices$", + "\s*ReadUserData$", + "\s*WriteUserData$", + "\s*Location$", + "\s*SurroundingsDD$", + "\s*UserEnvironment$", + "\s*TCB$" + ] + mustnotmatch = [ + "DRM" + ] + warnings = 0 + + t.id = "0107" + t.name = "capability_arm" + t.description = description + t.command = command % "arm.v5.urel.gcce4_4_1" + t.targets = targets + t.mustmatch = mustmatch + t.mustnotmatch = mustnotmatch + t.warnings = warnings + t.run() + return t diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/pdll_arm.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/pdll_arm.py Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,121 @@ +# +# 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: +# + +from raptor_tests import AntiTargetSmokeTest + +def run(): + t = AntiTargetSmokeTest() + t.usebash = True + + command = "sbs -b smoke_suite/test_resources/simple_dll/pbld.inf -c %s -f -" + maintargets = [ + "$(EPOCROOT)/epoc32/release/%s/udeb/createstaticpdll.dll.sym", + "$(EPOCROOT)/epoc32/release/%s/urel/createstaticpdll.dll.sym", + "$(EPOCROOT)/epoc32/release/%s/udeb/createstaticpdll.dll", + "$(EPOCROOT)/epoc32/release/%s/urel/createstaticpdll.dll" + ] + armv5targets = [ + "$(EPOCROOT)/epoc32/release/%s/lib/createstaticpdll.dso", + "$(EPOCROOT)/epoc32/release/%s/lib/createstaticpdll{000a0000}.dso" + ] + abiv1libtargets = [ + "$(EPOCROOT)/epoc32/release/%s/lib/createstaticpdll.lib", + "$(EPOCROOT)/epoc32/release/%s/lib/createstaticpdll{000a0000}.lib" + ] + buildtargets = [ + "createstaticpdll_dll/%s/udeb/CreateStaticDLL.o", + "createstaticpdll_dll/%s/urel/CreateStaticDLL.o" + ] + mustmatch = [ + r".*\busrt\d_\d\.lib\b.*", + r".*\bscppnwdl\.dso\b.*" + ] + mustnotmatch = [ + ".*ksrt.*" + ] + + # Note that ABIv1 import libraries are only generated for RVCT-based armv5 + # builds on Windows + + t.id = "0104a" + t.name = "pdll_armv5_rvct" + t.command = command % "armv5" + t.targets = map(lambda p: p % "armv5", maintargets + armv5targets)[:] # Shallow, as we optionally extend later and then re-use + t.addbuildtargets('smoke_suite/test_resources/simple_dll/pbld.inf', map(lambda p: p % "armv5", buildtargets)) + t.mustmatch = mustmatch + t.mustnotmatch = mustnotmatch + t.run("linux") + if t.result == AntiTargetSmokeTest.SKIP: + t.targets.extend(map(lambda x: x % "armv5", abiv1libtargets)) + t.run("windows") + + t.id = "0104b" + t.name = "pdll_armv5_clean" + t.command = command % "armv5" + " clean" + t.targets = [] + t.mustmatch = [] + t.mustnotmatch = [] + t.run() + + t.id = "0104c" + t.name = "pdll_armv5_gcce" + t.command = command % "gcce_armv5" + t.targets = map(lambda p: p % "armv5", maintargets + armv5targets) + t.antitargets = map(lambda p: p % "armv5", abiv1libtargets) + t.addbuildtargets('smoke_suite/test_resources/simple_dll/pbld.inf', map(lambda p: p % "armv5", buildtargets)) + t.mustmatch = mustmatch + t.mustnotmatch = mustnotmatch + t.run() + + t.id = "0104d" + t.name = "pdll_armv5_gcce_clean" + t.command = command % "gcce_armv5" + " clean" + t.targets = [] + t.mustmatch = [] + t.mustnotmatch = [] + t.run() + + t.id = "0104e" + t.name = "pdll_armv7_rvct" + t.command = command % "armv7" + t.targets = map(lambda p: p % "armv7", maintargets)[:] # Shallow, as we optionally extend later and then re-use + t.addbuildtargets('smoke_suite/test_resources/simple_dll/pbld.inf', map(lambda p: p % "armv7", buildtargets)) + t.mustmatch = mustmatch + t.mustnotmatch = mustnotmatch + t.run() + + t.id = "0104f" + t.name = "pdll_armv7_clean" + t.command = command % "armv7" + " clean" + t.targets = [] + t.mustmatch = [] + t.mustnotmatch = [] + t.run() + + t.id = "0104g" + t.name = "pdll_armv7_gcce" + t.command = command % "arm.v7.udeb.gcce4_3_2 -c arm.v7.urel.gcce4_3_2" + t.targets = map(lambda p: p % "armv7", maintargets) + t.antitargets = map(lambda p: p % "armv7", abiv1libtargets) + t.addbuildtargets('smoke_suite/test_resources/simple_dll/pbld.inf', map(lambda p: p % "armv7", buildtargets)) + t.mustmatch = mustmatch + t.mustnotmatch = mustnotmatch + t.run() + + t.id = "104" + t.name = "pdll_arm" + t.print_result() + return t diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/pdll_winscw.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/pdll_winscw.py Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,39 @@ +# +# 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: +# + +from raptor_tests import SmokeTest + +def run(): + t = SmokeTest() + t.id = "105" + t.name = "pdll_winscw" + t.command = "sbs -b smoke_suite/test_resources/simple_dll/pbld.inf -c winscw" + t.targets = [ + "$(EPOCROOT)/epoc32/release/winscw/udeb/createstaticpdll.lib", + "$(EPOCROOT)/epoc32/release/winscw/udeb/createstaticpdll.dll", + "$(EPOCROOT)/epoc32/release/winscw/urel/createstaticpdll.dll", + "$(EPOCROOT)/epoc32/release/winscw/urel/createstaticpdll.dll.map" + ] + t.addbuildtargets('smoke_suite/test_resources/simple_dll/pbld.inf', [ + "createstaticpdll_dll/winscw/udeb/CreateStaticDLL.o", + "createstaticpdll_dll/winscw/udeb/createstaticpdll.UID.CPP", + "createstaticpdll_dll/winscw/udeb/createstaticpdll_UID_.o", + "createstaticpdll_dll/winscw/urel/CreateStaticDLL.o", + "createstaticpdll_dll/winscw/urel/createstaticpdll.UID.CPP", + "createstaticpdll_dll/winscw/urel/createstaticpdll_UID_.o" + ]) + t.run() + return t diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/qt.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/qt.py Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,55 @@ +# +# 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: +# This test case requires install of Qt. + +from raptor_tests import SmokeTest + +def run(): + t = SmokeTest() + + t.description = "Ensure Raptor builds Qt applications successfully" + + t.id = "00xx" # TO DO: update ID + t.name = "qt_helloworld" + t.command = "cd smoke_suite/test_resources/qt && qmake -spec symbian-sbsv2 && sbs" + t.targets = [ + "$(SBS_HOME)/test/smoke_suite/test_resources/qt/bld.inf", + "$(SBS_HOME)/test/smoke_suite/test_resources/qt/helloworldqt.loc", + "$(SBS_HOME)/test/smoke_suite/test_resources/qt/helloworldqt.rss", + "$(SBS_HOME)/test/smoke_suite/test_resources/qt/helloworldqt_reg.rss", + "$(SBS_HOME)/test/smoke_suite/test_resources/qt/helloworldqt_template.pkg", + "$(SBS_HOME)/test/smoke_suite/test_resources/qt/Makefile", + "$(EPOCROOT)/epoc32/release/armv5/udeb/helloworldqt.exe", + "$(EPOCROOT)/epoc32/release/armv5/udeb/helloworldqt.exe.map", + "$(EPOCROOT)/epoc32/release/armv5/urel/helloworldqt.exe", + "$(EPOCROOT)/epoc32/release/armv5/urel/helloworldqt.exe.map", + "$(EPOCROOT)/epoc32/release/winscw/udeb/helloworldqt.exe", + "$(EPOCROOT)/epoc32/release/winscw/urel/helloworldqt.exe", + "$(EPOCROOT)/epoc32/release/winscw/urel/helloworldqt.exe.map" + ] + t.addbuildtargets('smoke_suite/test_resources/qt/bld.inf', [ + "helloworldqt_exe/armv5/udeb/helloworld.o", + "helloworldqt_exe/armv5/udeb/helloworld.o.d", + "helloworldqt_exe/armv5/urel/helloworld.o", + "helloworldqt_exe/armv5/urel/helloworld.o.d", + "helloworldqt_exe/winscw/udeb/helloworld.o", + "helloworldqt_exe/winscw/udeb/helloworld.o.d", + "helloworldqt_exe/winscw/urel/helloworld.o", + "helloworldqt_exe/winscw/urel/helloworld.o.d" + ]) + t.run("windows") + + return t + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/test_resources/qt/helloworld.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/qt/helloworld.cpp Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,13 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QPushButton hello("Hello world!"); + hello.resize(100, 30); + + hello.show(); + return app.exec(); +} diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/test_resources/qt/helloworldqt.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/qt/helloworldqt.pro Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,8 @@ + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . + +# Input +SOURCES += helloworld.cpp diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/test_resources/simple/capability.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple/capability.inf Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,22 @@ +/* +* 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". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +PRJ_PLATFORMS +ARMV5 ARMV7 WINSCW ARMV5SMP + +PRJ_MMPFILES +capability.mmp diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/test_resources/simple/capability.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple/capability.mmp Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,34 @@ +/* +* 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". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +TARGET test_capability +TARGETTYPE EXE + +// Test backslash to / here: +TARGETPATH \sys\bin + +UID 0x100039ce 0x00000001 +LIBRARY euser.lib +SECUREID 0x10003a5c +SYSTEMINCLUDE /epoc32/include +SOURCE test.cpp test1.c++ test2.cxx test3.Cpp test4.cc test5.CC test6.C++ +MACRO TEST_MACRO_THAT_DOES_NOTHING +PAGED +EPOCCALLDLLENTRYPOINTS +EPOCSTACKSIZE 8192 +EPOCHEAPSIZE 0x5000 65535 +EPOCPROCESSPRIORITY low +capability ALL -TCB -ProtServ TCB ProtServ -DRM diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/test_resources/simple_dll/CREATESTATICPDLLARM.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_dll/CREATESTATICPDLLARM.def Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,6 @@ +EXPORTS + _ZN10CMessenger11ShowMessageEv @ 1 NONAME + _ZN10CMessenger5NewLCER12CConsoleBaseRK7TDesC16 @ 2 NONAME + _ZTI10CMessenger @ 3 NONAME + _ZTV10CMessenger @ 4 NONAME + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/test_resources/simple_dll/CREATESTATICPDLLWINS.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_dll/CREATESTATICPDLLWINS.def Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,4 @@ +EXPORTS + ?ShowMessage@CMessenger@@QAEXXZ @ 1 NONAME ; ?ShowMessage@CMessenger@@QAEXXZ + ?NewLC@CMessenger@@SAPAV1@AAVCConsoleBase@@ABVTDesC16@@@Z @ 2 NONAME ; ?NewLC@CMessenger@@SAPAV1@AAVCConsoleBase@@ABVTDesC16@@@Z + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/test_resources/simple_dll/CreateStaticPDLL.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_dll/CreateStaticPDLL.mmp Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2000-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: +* +*/ + +TARGET createstaticpdll.dll +TARGETTYPE pdll + +UID 0xE800004C +CAPABILITY All -TCB + + +VENDORID 0x70000001 + +SOURCEPATH . +SOURCE CreateStaticDLL.cpp + +#ifdef ARMV6 +SOURCE armv6_specific.cpp +#endif +#ifdef ARMV7 +SOURCE armv7_specific.cpp +#endif + +USERINCLUDE . +SYSTEMINCLUDE /epoc32/include + +LIBRARY euser.lib + +#if defined(WINS) + deffile ./CREATESTATICPDLLWINS.def +#elif defined(MARM) + deffile ./CREATESTATICPDLLARM.def +#endif +nostrictdef + +#include "../inc/macrotests.mmh" + diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/test_resources/simple_dll/pbld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_dll/pbld.inf Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2000-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: +* Component description file +* +*/ + + +PRJ_PLATFORMS +ARMV5 ARMV6 ARMV7 ARMV5SMP WINSCW + +PRJ_MMPFILES + +CreateStaticPDLL.mmp diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/smoke_suite/whatcomp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/whatcomp.py Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,71 @@ +# +# 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: +# + +from raptor_tests import SmokeTest +import generic_path +import os + +def run(): + t = SmokeTest() + t.usebash = True + result = SmokeTest.PASS + + abs_epocroot = os.path.abspath(os.environ["EPOCROOT"]) + cwd = os.getcwd().replace("\\","/") + + relative_epocroot = os.path.relpath(abs_epocroot.replace("\\","/"),cwd) + + + description = """This tests the whatcomp filter. As a byproduct it uses (and thus smoke-tests) sbs_filter.py""" + command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c %s -m ${SBSMAKEFILE} -f ${SBSLOGFILE} what && " + \ + "EPOCROOT='%s' sbs_filter --filters FilterWhatComp < ${SBSLOGFILE} &&" % relative_epocroot + \ + "EPOCROOT='%s' sbs_filter --filters FilterWhatComp < ${SBSLOGFILE}" % abs_epocroot + targets = [ + ] + buildtargets = [ + ] + + mustmatch_pre = [ + "-- abld -w", + ".*Chdir .*/smoke_suite/test_resources/simple.*", + relative_epocroot + "/epoc32/release/armv5/urel/test.exe", + relative_epocroot + "/epoc32/release/armv5/urel/test.exe.map", + abs_epocroot + "/epoc32/release/armv5/urel/test.exe", + abs_epocroot + "/epoc32/release/armv5/urel/test.exe.map", + ] + + if os.sep == '\\': + mustmatch = [ i.replace("\\", "\\\\" ).replace("/","\\\\") for i in mustmatch_pre ] + else: + mustmatch = mustmatch_pre + + mustnotmatch = [ + "error: no (CHECK|WHAT) information found" + ] + warnings = 0 + + t.id = "0106" + t.name = "filter_whatcomp_sbs_filter" + t.description = description + t.command = command % "arm.v5.urel.gcce4_4_1" + t.targets = targets + t.mustmatch = mustmatch + t.mustnotmatch = mustnotmatch + t.warnings = warnings + t.run() + + t.print_result() + return t diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/timing_tests/parse_time_exports_mmps.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/timing_tests/parse_time_exports_mmps.py Mon Jan 25 11:43:34 2010 +0000 @@ -0,0 +1,77 @@ + +from raptor_tests import SmokeTest, ReplaceEnvs +import os + +def generate_files(): + try: + os.makedirs(ReplaceEnvs("$(SBS_HOME)/test/timing_tests/test_resources/parse_time")) + except: + pass + bldinf_path = ReplaceEnvs("$(SBS_HOME)/test/timing_tests/test_resources/parse_time/bld.inf") + bldinf = open(bldinf_path, "w") + bldinf_content = """prj_mmpfiles +""" + test_dir = ReplaceEnvs("$(SBS_HOME)/test/timing_tests/test_resources/parse_time") + for number in range(0, 250): + mmp_path = ("parse_timing_" + str(number).zfill(3) + ".mmp") + mmp_file = open((test_dir + "/" + mmp_path), "w") + mmp_file.write("""targettype none +""") + mmp_file.close() + bldinf_content += (mmp_path + "\n") + + bldinf_content += "\nprj_exports\n" + + for number1 in range(0, 10): + source_dir = ("export_source_" + str(number1)) + try: + os.mkdir(test_dir + "/" + source_dir) + except: + pass + + for number2 in range (0, 10): + source_file = ("/file_" + str(number2) + ".txt ") + export_file = open((test_dir + "/" + source_dir + source_file), "w") + export_file.write(str(number2)) + export_file.close() + + for number3 in range (0, 10): + dest_dir = ("epoc32/include/export_destination_" + \ + str(number1) + str(number2) + str(number3)) + + for number4 in range(0, 10): + bldinf_content += source_dir + source_file + dest_dir + \ + "/export_destination_" + str(number4) + "\n" + bldinf.write(bldinf_content) + bldinf.close() + + +def delete_files(): + import shutil + + test_dir = ReplaceEnvs("$(SBS_HOME)/test/timing_tests/test_resources/parse_time") + objects = os.listdir(test_dir) + for object in objects: + object_path = (test_dir + "/" + object) + if os.path.isfile(object_path): + os.remove(object_path) + else: + shutil.rmtree(object_path) + + +def run(): + + generate_files() + + t = SmokeTest() + + t.id = "1" + t.name = "parse_time_exports_mmps" + t.description = """Test to measure time taken to parse a large number of + exports and mmps""" + t.command = "sbs -b timing_tests/test_resources/parse_time/bld.inf -n " + \ + "-c armv5_urel --toolcheck=off --timing" + t.run() + + delete_files() + return t diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/unit_suite/raptor_data_unit.py --- a/sbsv2/raptor/test/unit_suite/raptor_data_unit.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/test/unit_suite/raptor_data_unit.py Mon Jan 25 11:43:34 2010 +0000 @@ -30,24 +30,18 @@ def SetEnv(self, name, value): - # set environment variable and remember the old value - - try: - old = os.environ[name] - self.envStack[name] = old - os.environ[name] = value - except KeyError: - self.envStack[name] = None # was not defined + # set environment variable and remember the old value (if there is one) + if os.environ.has_key(name): + self.envStack[name] = os.environ[name] + os.environ[name] = value def RestoreEnv(self, name): # put environment back to its state before SetEnv - saved = self.envStack[name] - - if saved == None: + if self.envStack.has_key(name): + os.environ[name] = self.envStack[name] + else: del os.environ[name] # was not defined - else: - os.environ[name] = saved def testSimpleSpecification(self): @@ -359,6 +353,32 @@ # test the Resolve wrt EPOCROOT varcfg = eval.Resolve("VARIANT_CFG") self.assertEqual(varcfg, "/C/variant/variant.cfg") + + def testProblematicEnvironment(self): + # ask for environment variable values that will break makefile parsing due to + # backslashes forming line continuation characters + self.SetEnv("ENVVAR_BSLASH_END1", "C:\\test1a\\;C:\\test1b\\") + self.SetEnv("ENVVAR_BSLASH_END2", "C:\\test2a\\;C:\\test2b\\\\") + self.SetEnv("ENVVAR_BSLASH_END3", "C:\\test3a\\;C:\\test3b\\\\\\") + var = raptor_data.Variant("my.var") + var.AddOperation(raptor_data.Env("ENVVAR_BSLASH_END1")) + var.AddOperation(raptor_data.Env("ENVVAR_BSLASH_END2")) + var.AddOperation(raptor_data.Env("ENVVAR_BSLASH_END3")) + + aRaptor = raptor.Raptor() + eval = aRaptor.GetEvaluator(None, var.GenerateBuildUnits(aRaptor.cache)[0]) + self.RestoreEnv("ENVVAR_BSLASH_END1") + self.RestoreEnv("ENVVAR_BSLASH_END2") + self.RestoreEnv("ENVVAR_BSLASH_END3") + + value = eval.Get("ENVVAR_BSLASH_END1") + self.assertEqual(value, "C:\\test1a\\;C:\\test1b\\\\") + + value = eval.Get("ENVVAR_BSLASH_END2") + self.assertEqual(value, "C:\\test2a\\;C:\\test2b\\\\") + + value = eval.Get("ENVVAR_BSLASH_END3") + self.assertEqual(value, "C:\\test3a\\;C:\\test3b\\\\\\\\") def testMissingEnvironment(self): # ask for an environment variable that is not set diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/test/unit_suite/raptor_meta_unit.py --- a/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py Mon Jan 25 11:43:34 2010 +0000 @@ -256,18 +256,23 @@ def __testExport(self, aExportObject, aSource, aDestination, aAction): self.assertEquals(aExportObject.getSource(), aSource) - self.assertEqualsOrContains(aExportObject.getDestination(), aDestination) + self.assertEqualsOrContainsPath(aExportObject.getDestination(), aDestination) self.assertEquals(aExportObject.getAction(), aAction) - def assertEqualsOrContains(self, aPathStringOrPathStringList, aPathString): - # If aPathStringOrPathStringList is a list, which it might well be, we should + def assertEqualsOrContainsPath(self, aRequirement, aCandidate): + # If aRequirement is a list, which it might well be, we should # assert that aPathString is contained in it - # If aPathStringOrPathStringList is not a list, it will be a string, and + # If aRequirement not a list, it will be a string, and # we should assert equality of the strings - if isinstance(aPathStringOrPathStringList, list): - self.assert_(aPathString in aPathStringOrPathStringList) + # On windows we shouldn't care about the case of the drive letter. + + if isinstance(aRequirement, list): + pathsequal = False + for r in aRequirement: + pathsequal = path_compare_notdrivelettercase(r,aCandidate) or pathsequal + self.assertTrue(pathsequal) else: - self.assertEquals(aPathStringOrPathStringList, aPathString) + self.assertTrue(path_compare_notdrivelettercase(aRequirement,aCandidate)) def testBldInfExports(self): bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs') @@ -646,10 +651,8 @@ m.deffile = self.deffilekeyword m.nostrictdef = self.nostrictdef f = m.resolveDefFile(self.target, self.platform) - del m - if self.resolveddeffile == f: - return True - return False + + return path_compare_notdrivelettercase(self.resolveddeffile,f) defFileTests = [] @@ -734,7 +737,8 @@ ]) for t in defFileTests: - self.assertEquals(t.test(self.raptor), True) + result = t.test(self.raptor) + self.assertEquals(result, True) def dummyMetaReader(self): "make raptor_meta.MetaReader.__init__ into a none operation" @@ -841,6 +845,16 @@ self.assertEquals(moduleName, result["result"]) self.restoreMetaReader() + + +def path_compare_notdrivelettercase(aRequirement, aCandidate): + if sys.platform.startswith("win"): + if aRequirement[1] == ":": + aRequirement = aRequirement[0].lower() + aRequirement[1:] + aCandidate = aCandidate[0].lower() + aCandidate[1:] + + return aRequirement == aCandidate + # run all the tests diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/util/install-windows/raptorinstallermaker.py --- a/sbsv2/raptor/util/install-windows/raptorinstallermaker.py Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/util/install-windows/raptorinstallermaker.py Mon Jan 25 11:43:34 2010 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# 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" @@ -30,40 +30,51 @@ tempdir = "" parser = optparse.OptionParser() -parser.add_option("-s", "--sbs_home", dest="sbs_home", +parser.add_option("-s", "--sbs-home", dest="sbshome", help="Path to use as SBS_HOME environment variable. If not present the script exits.") +parser.add_option("-w", "--win32-support", dest="win32support", + help="Path to Win32 support directory. If not present the script exits.") (options, args) = parser.parse_args() -if options.sbs_home == None: +if options.sbshome == None: print "ERROR: no SBS_HOME passed in. Exiting..." sys.exit(2) +if options.win32support == None: + print "ERROR: no win32support directory specified. Unable to proceed. Exiting..." + sys.exit(2) +else: + # Required irectories inside the win32-support repository + win32supportdirs = ["bv", "cygwin", "mingw", "python264"] + for dir in win32supportdirs: + if not os.path.isdir(os.path.join(options.win32support, dir)): + print "ERROR: directory %s does not exist. Cannot build installer. Exiting..." % dir + sys.exit(2) def parseconfig(xmlFile="raptorinstallermaker.xml"): pass -def generateinstallerversionheader(sbs_home = None): - os.environ["SBS_HOME"] = sbs_home - os.environ["PATH"] = os.path.join(os.environ["SBS_HOME"], "bin") + os.pathsep + os.environ["PATH"] +def generateinstallerversionheader(sbshome = None): + shellenv = os.environ.copy() + shellenv["PYTHONPATH"] = os.path.join(sbshome, "python") - versioncommand = "sbs -v" + raptorversioncommand = "python -c \"import raptor_version; print raptor_version.numericversion()\"" - # Raptor version string looks like this - # sbs version 2.5.0 [2009-02-20 release] + # Raptor version is obtained from raptor_version module's numericversion function. sbs_version_matcher = re.compile(".*(\d+\.\d+\.\d+).*", re.I) # Create Raptor subprocess - sbs = subprocess.Popen(versioncommand, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) - + versioncommand = subprocess.Popen(raptorversioncommand, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=shellenv) + raptorversion = "" # Get all the lines matching the RE - for line in sbs.stdout.readlines(): + for line in versioncommand.stdout.readlines(): res = sbs_version_matcher.match(line) if res: raptorversion = res.group(1) print "Successfully determined Raptor version %s" % raptorversion - sbs.wait() # Wait for process to end + versioncommand.wait() # Wait for process to end raptorversion_nsis_header_string = "# Raptor version file\n\n!define RAPTOR_VERSION %s\n" % raptorversion @@ -94,11 +105,16 @@ global tempdir print "Cleaning up temporary directory %s" % tempdir shutil.rmtree(tempdir,True) + try: + os.remove("raptorversion.nsh") + print "Successfully deleted raptorversion.nsh." + except: + print "ERROR: failed to remove raptorversion.nsh - remove manually if needed." print "Done." makensispath = unzipnsis(".\\NSIS.zip") -generateinstallerversionheader(options.sbs_home) -nsiscommand = makensispath + " /DRAPTOR_LOCATION=%s raptorinstallerscript.nsi" % options.sbs_home +generateinstallerversionheader(options.sbshome) +nsiscommand = makensispath + " /DRAPTOR_LOCATION=%s /DWIN32SUPPORT=%s raptorinstallerscript.nsi" % (options.sbshome, options.win32support) print "nsiscommand = %s" % nsiscommand runmakensis(nsiscommand) cleanup() diff -r dbb43cb03357 -r 9758784ab2d3 sbsv2/raptor/util/install-windows/raptorinstallerscript.nsi --- a/sbsv2/raptor/util/install-windows/raptorinstallerscript.nsi Tue Jan 19 14:28:16 2010 +0000 +++ b/sbsv2/raptor/util/install-windows/raptorinstallerscript.nsi Mon Jan 25 11:43:34 2010 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# 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" @@ -114,6 +114,14 @@ File /r /x distribution.policy.s60 ${RAPTOR_LOCATION}\schema\*.* SetOutPath "$INSTDIR\win32" File /r /x distribution.policy.s60 ${RAPTOR_LOCATION}\win32\*.* + SetOutPath "$INSTDIR\win32\bv" + File /r /x distribution.policy.s60 /x .hg ${WIN32SUPPORT}\bv\*.* + SetOutPath "$INSTDIR\win32\cygwin" + File /r /x distribution.policy.s60 /x .hg ${WIN32SUPPORT}\cygwin\*.* + SetOutPath "$INSTDIR\win32\mingw" + File /r /x distribution.policy.s60 /x .hg ${WIN32SUPPORT}\mingw\*.* + SetOutPath "$INSTDIR\win32\python264" + File /r /x distribution.policy.s60 /x .hg ${WIN32SUPPORT}\python264\*.* SetOutPath "$INSTDIR" File ${RAPTOR_LOCATION}\RELEASE-NOTES.txt