diff --git a/backends/platform/symbian/symbian_builder/build_apps.py b/backends/platform/symbian/symbian_builder/build_apps.py index 2d2dc7068d2..a73e4634955 100644 --- a/backends/platform/symbian/symbian_builder/build_apps.py +++ b/backends/platform/symbian/symbian_builder/build_apps.py @@ -26,6 +26,10 @@ import multiprocessing as mp from common_names import * +#workaround for "threading bug in strptime" +#see - https://stackoverflow.com/questions/32245560/module-object-has-no-attribute-strptime-with-several-threads-python/46401422 +import _strptime + prj_template = "PRJ_MMPFILES\n%s" prj_path = "paralell_build" @@ -44,7 +48,7 @@ def thread_func(q, plats): pass else: raise - + fname = os.path.join(plats, fileName) fname = os.path.join("..", fname) fname = os.path.join("..", fname) @@ -52,7 +56,7 @@ def thread_func(q, plats): tmp = os.path.join(pth, "bld.inf") SafeWriteFile(tmp, prj_template %fname) - + #Needed because datetime.now() returns the same time for every call start = time.strftime("%H:%M:%S") @@ -60,12 +64,19 @@ def thread_func(q, plats): out, err = cmd.communicate() cmd1 = subprocess.Popen('abld build gcce urel', stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=pth, shell=True) out1, err1 = cmd1.communicate() + + end = time.strftime("%H:%M:%S" ) + start_dt = datetime.strptime(start, '%H:%M:%S') + end_dt = datetime.strptime(end, '%H:%M:%S') + diff = (end_dt - start_dt) + out = out + out1 err = err + err1 # I hope it correctly stores logs in parallel tasks # after cmd.communicate() we have ugly 'crcrlf' line endings - SafeWriteFile(build_log, out.replace(u"\r", u""), 'a') - SafeWriteFile(build_err, err.replace(u"\r", u""), 'a') + AppendToFile(build_log, out.replace(u"\r", u"")) + AppendToFile(build_err, err.replace(u"\r", u"")) + AppendToFile(build_time, "Engine %s build time: %s.\n" %(fileName, str(diff)) ) def build_apps(plats): q = Queue.Queue() diff --git a/backends/platform/symbian/symbian_builder/create_installers.py b/backends/platform/symbian/symbian_builder/create_installers.py index 027cd4d11b6..2256265f99b 100644 --- a/backends/platform/symbian/symbian_builder/create_installers.py +++ b/backends/platform/symbian/symbian_builder/create_installers.py @@ -27,11 +27,11 @@ from common_names import * def makesis(pkg, path): print "pkg: %s" %pkg - t = "makesis -c %s" %pkg - cmd = subprocess.Popen(t, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=path, shell=True) + cmd = subprocess.Popen("makesis -v %s" %pkg, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=path, shell=True) out, err = cmd.communicate() - SafeWriteFile(build_log, out) - SafeWriteFile(build_err, err) + #After cmd.communicate() we have ugly 'crcrlf' line endings + AppendToFile(build_log, out.replace(u"\r", u"")) + AppendToFile(build_err, err.replace(u"\r", u"")) def create_installers(path): t = os.listdir(path) diff --git a/backends/platform/symbian/symbian_builder/parse_base.py b/backends/platform/symbian/symbian_builder/parse_base.py index dc663c50b79..6ea572cdb86 100644 --- a/backends/platform/symbian/symbian_builder/parse_base.py +++ b/backends/platform/symbian/symbian_builder/parse_base.py @@ -65,8 +65,11 @@ def checkMacro(macro, active_conf = active_config): def processModule_mk(folder, mmp_file, active_conf = active_config): pth = os.path.join('..\..\..', folder) - with open(os.path.join(pth, "module.mk")) as ff: - f = ff.readlines() + try: + with open(os.path.join(pth, "module.mk")) as ff: + f = ff.readlines() + except IOError: #folder added in newer version + return pth = os.path.join('..\..\..\..', folder) SafeWriteFile(mmp_file, "\nSOURCEPATH %s\n" %pth, 'a') diff --git a/backends/platform/symbian/symbian_builder/piper.py b/backends/platform/symbian/symbian_builder/piper.py index 632d3aa2f72..0ab6d88b48a 100644 --- a/backends/platform/symbian/symbian_builder/piper.py +++ b/backends/platform/symbian/symbian_builder/piper.py @@ -26,6 +26,10 @@ import multiprocessing as mp from common_names import * +#workaround for "threading bug in strptime" +#see - https://stackoverflow.com/questions/32245560/module-object-has-no-attribute-strptime-with-several-threads-python/46401422 +import _strptime + prj_template = "PRJ_MMPFILES\n%s" prj_path = "paralell_build" diff --git a/backends/platform/symbian/symbian_builder/pkg_generator.py b/backends/platform/symbian/symbian_builder/pkg_generator.py index 3883354b617..b502188f935 100644 --- a/backends/platform/symbian/symbian_builder/pkg_generator.py +++ b/backends/platform/symbian/symbian_builder/pkg_generator.py @@ -148,7 +148,6 @@ def SaveDependency(build, pkg): sis_major_version, sis_minor_version, sis_build_number, dep_name)) def ResolvePackName(ordinal, target, build): - print int(ordinal) + 1 tmp = package_name %(str(ordinal +1) + " " + target) if build == 'full': tmp += " test" @@ -158,15 +157,15 @@ def CreateLastPkg(install_uid, build, path, ordinal, target): pkg = path %(ordinal +1) pkg_cmdline = path %( str(ordinal +1) + "_cmdline") pack_name = ResolvePackName(ordinal, target, build) - + SafeWriteFile(pkg, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) ) SafeWriteFile(pkg_cmdline, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) ) SaveDependency(build, pkg) SaveDependency(build, pkg_cmdline) - + AppendToFile(pkg, pkg_licenses_show) AppendToFile(pkg_cmdline, pkg_licenses_show) - + SaveInstallData(pkg, build, ordinal*2 + 1, toResolve = False) SaveInstallData(pkg_cmdline, build, ordinal*2 + 1) @@ -174,12 +173,12 @@ def CreatePkg(install_uid, build, path, ordinal, target): pkg = path %(ordinal +1) pkg_cmdline = path %( str(ordinal +1) + "_cmdline") pack_name = ResolvePackName(ordinal, target, build) - + SafeWriteFile(pkg, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) ) SafeWriteFile(pkg_cmdline, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) ) SaveDependency(build, pkg) SaveDependency(build, pkg_cmdline) - + AppendToFile(pkg, pkg_licenses_show) AppendToFile(pkg_cmdline, pkg_licenses_show) @@ -191,20 +190,20 @@ def CreatePkg(install_uid, build, path, ordinal, target): def CreateFirstPkg(install_uid, build, path, target): ext = 1 cmd = str(ext) + "_cmdline" - + pkg = path %ext pkg_cmdline = path %cmd pack_name = ResolvePackName(0, target, build) - + SafeWriteFile(pkg, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) ) SafeWriteFile(pkg_cmdline, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) ) - + AppendToFile(pkg, pkg_licenses_install) AppendToFile(pkg_cmdline, pkg_licenses_install) if build == 'release': AppendToFile(pkg, mif_install) AppendToFile(pkg_cmdline, ResolveEpocRoot(mif_install)) - + SaveInstallData(pkg, build, 1, toResolve = False) SaveInstallData(pkg_cmdline, build, 1) SaveInstallData(pkg, build, 2, toResolve = False)