SYMBIAN: Fix exception in thread function for piper.py and build_apps.py

Allow build older version with current symbian_builder module in case regression.
Set verbose option in installer builder instead error-checking.
Fix ugly 'crcrlf' line endings.
This commit is contained in:
Fiodar Stryzhniou 2021-07-11 20:17:27 +03:00 committed by Eugene Sandulenko
parent d48a14fd08
commit f992ae017b
5 changed files with 37 additions and 20 deletions

View File

@ -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()

View File

@ -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)

View File

@ -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')

View File

@ -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"

View File

@ -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)