* [PATCH v4 0/6] Python refactoring
@ 2019-03-04 13:07 claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 1/6] Remove all uses of subprocess.call(shell=True) claudius.heine.ext
` (8 more replies)
0 siblings, 9 replies; 16+ messages in thread
From: claudius.heine.ext @ 2019-03-04 13:07 UTC (permalink / raw)
To: isar-users; +Cc: Claudius Heine
From: Claudius Heine <ch@denx.de>
Hi,
I just took Haralds patchset + Maxims rebase and fixed it up.
There was just a tiny change necessary, I added that in an additional patch.
It builds on my machine (qemuamd64) and I am currently testing it on isar-ci.
If that is successful and review is ok, my patch can be merged into the
'Remove all uses of subprocess.call(shell=True)' or left separately.
regards,
Claudius
Claudius Heine (1):
isar-bootstrap-helper: get_deb_host_arch: fix decoding
Harald Seiler (5):
Remove all uses of subprocess.call(shell=True)
Use modern python formatting
image: Remove recursion in get_image_name
wic: Refactor fakeroot script
Fix python style
.../example-module/example-module.bb | 8 ++-
meta/classes/base.bbclass | 70 ++++++++++++-------
meta/classes/image.bbclass | 22 ++++--
meta/classes/isar-bootstrap-helper.bbclass | 8 +--
meta/classes/isar-events.bbclass | 14 ++--
meta/classes/patch.bbclass | 13 ++--
meta/classes/wic-img.bbclass | 21 ++++--
.../isar-bootstrap/isar-bootstrap-host.bb | 9 ++-
.../isar-bootstrap/isar-bootstrap-target.bb | 5 +-
.../isar-bootstrap/isar-bootstrap.inc | 12 ++--
scripts/wic_fakeroot | 9 +--
11 files changed, 120 insertions(+), 71 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 1/6] Remove all uses of subprocess.call(shell=True)
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
@ 2019-03-04 13:07 ` claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 2/6] isar-bootstrap-helper: get_deb_host_arch: fix decoding claudius.heine.ext
` (7 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: claudius.heine.ext @ 2019-03-04 13:07 UTC (permalink / raw)
To: isar-users; +Cc: Harald Seiler, Claudius Heine
From: Harald Seiler <hws@denx.de>
Using shell-expansion in subprocess calls has a lot of nasty
side-effects that are hard to debug should one ever surface.
This commit changes all uses of subprocess to
A) not use shell=True by giving a list of args instead of
a command-line.
B) ensure return-codes are handled appropriately.
Furthermore, in some places the subprocess usage was changed to
be more idiomatic.
Co-authored-by: Claudius Heine <ch@denx.de>
Signed-off-by: Harald Seiler <hws@denx.de>
---
meta/classes/base.bbclass | 10 ++++++----
meta/classes/image.bbclass | 5 +++--
meta/classes/isar-bootstrap-helper.bbclass | 8 +++-----
meta/classes/isar-events.bbclass | 13 +++++++------
meta/classes/patch.bbclass | 13 +++++++++----
5 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 4279a68..1f415af 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -171,15 +171,17 @@ addtask clean
do_clean[nostamp] = "1"
python do_clean() {
import subprocess
+ import glob
for f in (d.getVar('CLEANFUNCS', True) or '').split():
bb.build.exec_func(f, d)
- dir = d.expand("${WORKDIR}")
- subprocess.call('sudo rm -rf ' + dir, shell=True)
+ workdir = d.expand("${WORKDIR}")
+ subprocess.check_call(["sudo", "rm", "-rf", workdir])
- dir = "%s.*" % bb.data.expand(d.getVar('STAMP', False), d)
- subprocess.call('sudo rm -rf ' + dir, shell=True)
+ stamppath = bb.data.expand(d.getVar('STAMP', False), d)
+ stampdirs = glob.glob(stamppath + ".*")
+ subprocess.check_call(["sudo", "rm", "-rf"] + stampdirs)
}
# Derived from OpenEmbedded Core: meta/classes/base.bbclass
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 2514c88..34d6515 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -56,8 +56,9 @@ def get_rootfs_size(d):
import subprocess
rootfs_extra = int(d.getVar("ROOTFS_EXTRA", True))
- output = subprocess.check_output(['sudo', 'du', '-s', '--block-size=1k',
- d.getVar("IMAGE_ROOTFS", True)])
+ output = subprocess.check_output(
+ ["sudo", "du", "-s", "--block-size=1k", d.getVar("IMAGE_ROOTFS", True)]
+ )
base_size = int(output.split()[0])
return base_size + rootfs_extra * 1024
diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
index d780b85..18081a0 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -9,11 +9,9 @@ IMAGE_TRANSIENT_PACKAGES ??= ""
def get_deb_host_arch():
import subprocess
- host_arch = subprocess.Popen("dpkg --print-architecture",
- shell=True,
- env=os.environ,
- stdout=subprocess.PIPE
- ).stdout.read().decode('utf-8').strip()
+ host_arch = subprocess.check_output(
+ ["dpkg", "--print-architecture"]
+ ).strip()
return host_arch
#Debian Distribution for SDK host
diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass
index c4a6149..a178d05 100644
--- a/meta/classes/isar-events.bbclass
+++ b/meta/classes/isar-events.bbclass
@@ -16,13 +16,14 @@ python isar_handler() {
basepath = tmpdir + '/work/'
- with open(os.devnull, 'w') as devnull:
- with open('/proc/mounts', 'rU') as f:
- lines = f.readlines()
- for line in lines:
+ with open('/proc/mounts') as f:
+ for line in f.readlines():
if basepath in line:
- subprocess.call('sudo umount -l ' + line.split()[1],
- stdout=devnull, stderr=devnull, shell=True)
+ subprocess.call(
+ ["sudo", "umount", "-l", line.split()[1]],
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ )
}
isar_handler[eventmask] = "bb.runqueue.runQueueExitWait bb.event.BuildCompleted"
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 0bc449f..c19542d 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -21,10 +21,15 @@ python do_patch() {
striplevel = fetcher.ud[src_uri].parm.get("striplevel") or "1"
- cmd = "patch --no-backup-if-mismatch -p " + striplevel + \
- " --directory " + src_dir + " --input " + workdir + basename
- bb.note(cmd)
- if subprocess.call(cmd, shell=True) != 0:
+ cmd = [
+ "patch",
+ "--no-backup-if-mismatch",
+ "-p", striplevel,
+ "--directory", src_dir,
+ "--input", workdir + basename,
+ ]
+ bb.note(" ".join(cmd))
+ if subprocess.call(cmd) != 0:
bb.fatal("patching failed")
except bb.fetch2.BBFetchException as e:
raise bb.build.FuncFailed(e)
--
2.20.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 2/6] isar-bootstrap-helper: get_deb_host_arch: fix decoding
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 1/6] Remove all uses of subprocess.call(shell=True) claudius.heine.ext
@ 2019-03-04 13:07 ` claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 3/6] Use modern python formatting claudius.heine.ext
` (6 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: claudius.heine.ext @ 2019-03-04 13:07 UTC (permalink / raw)
To: isar-users; +Cc: Claudius Heine
From: Claudius Heine <ch@denx.de>
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta/classes/isar-bootstrap-helper.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
index 18081a0..38d90fb 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -11,7 +11,7 @@ def get_deb_host_arch():
import subprocess
host_arch = subprocess.check_output(
["dpkg", "--print-architecture"]
- ).strip()
+ ).decode('utf-8').strip()
return host_arch
#Debian Distribution for SDK host
--
2.20.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 3/6] Use modern python formatting
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 1/6] Remove all uses of subprocess.call(shell=True) claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 2/6] isar-bootstrap-helper: get_deb_host_arch: fix decoding claudius.heine.ext
@ 2019-03-04 13:07 ` claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 4/6] image: Remove recursion in get_image_name claudius.heine.ext
` (5 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: claudius.heine.ext @ 2019-03-04 13:07 UTC (permalink / raw)
To: isar-users; +Cc: Harald Seiler
From: Harald Seiler <hws@denx.de>
The use of % for formatting is discouraged because it has side-
effects that are not immediately obvious. This commit refactors
all uses of % to a better formatting style.
As f-Strings are not availible in in some python versions we support
(<3.6) the formatter of choice is .format() or manual concatenation
in cases where it is more concise.
This commit additionally refactors the showdata and listtasks tasks
to make better use of the new formatter code.
Signed-off-by: Harald Seiler <hws@denx.de>
---
meta/classes/base.bbclass | 58 ++++++++++++-------
meta/classes/wic-img.bbclass | 21 +++++--
.../isar-bootstrap/isar-bootstrap.inc | 12 ++--
3 files changed, 58 insertions(+), 33 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 1f415af..c9b9e9e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -33,27 +33,35 @@ do_showdata[nostamp] = "1"
python do_showdata() {
for e in d.keys():
if d.getVarFlag(e, 'python'):
- bb.plain("\npython %s () {\n%s}\n" % (e, d.getVar(e, True)))
+ code = d.getVar(e, True)
+ if code.startswith("def"):
+ bb.plain("\n" + code + "\n")
+ else:
+ bb.plain(
+ "\npython {name} () {{\n{code}}}\n".format(
+ name=e, code=code
+ )
+ )
}
# Derived from Open Embedded: openembedded-core/meta/classes/utility-tasks.bbclass
addtask listtasks
do_listtasks[nostamp] = "1"
python do_listtasks() {
- taskdescs = {}
+ tasks = {}
maxlen = 0
for e in d.keys():
if d.getVarFlag(e, 'task'):
maxlen = max(maxlen, len(e))
if e.endswith('_setscene'):
- desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc') or '')
+ tasks[e] = (
+ d.getVarFlag(e[:-9], 'doc') or ''
+ ) + " (setscene version)"
else:
- desc = d.getVarFlag(e, 'doc') or ''
- taskdescs[e] = desc
+ tasks[e] = d.getVarFlag(e, 'doc') or ''
- tasks = sorted(taskdescs.keys())
- for taskname in tasks:
- bb.plain("%s %s" % (taskname.ljust(maxlen), taskdescs[taskname]))
+ for name, desc in sorted(tasks.items()):
+ bb.plain("{0:{len}} {1}".format(name, desc, len=maxlen))
}
root_cleandirs() {
@@ -71,30 +79,40 @@ root_cleandirs() {
python() {
import re
+
for e in d.keys():
flags = d.getVarFlags(e)
if flags and flags.get('task'):
rcleandirs = flags.get('root_cleandirs')
if rcleandirs:
tmpdir = os.path.normpath(d.getVar("TMPDIR", True))
- rcleandirs = list(os.path.normpath(d.expand(i))
- for i in rcleandirs.split())
+ rcleandirs = list(
+ os.path.normpath(d.expand(i)) for i in rcleandirs.split()
+ )
for i in rcleandirs:
if not i.startswith(tmpdir):
- bb.fatal("root_cleandirs entry %s is not contained in "
- "TMPDIR %s" % (i, tmpdir))
+ bb.fatal(
+ "root_cleandirs entry {} is not contained in TMPDIR {}".format(
+ i, tmpdir
+ )
+ )
- ws = re.match("^\s*", d.getVar(e, False)).group()
if flags.get('python'):
- d.prependVar(e, ws + "d.setVar('ROOT_CLEANDIRS_DIRS', '"
- + " ".join(rcleandirs) + "')\n"
- + ws + "bb.build.exec_func("
- + "'root_cleandirs', d)\n")
+ cleandir_code = (
+ "{ws}d.setVar('ROOT_CLEANDIRS_DIRS', '{dirlist}')\n"
+ "{ws}bb.build.exec_func('root_cleandirs', d)\n"
+ )
else:
- d.prependVar(e, ws + "ROOT_CLEANDIRS_DIRS='"
- + " ".join(rcleandirs) + "'\n"
- + ws + "root_cleandirs\n")
+ cleandir_code = (
+ "{ws}ROOT_CLEANDIRS_DIRS='{dirlist}'\n"
+ "{ws}root_cleandirs\n"
+ )
+
+ ws = re.match(r"^\s*", d.getVar(e, False)).group()
+ d.prependVar(
+ e, cleandir_code.format(ws=ws, dirlist=" ".join(rcleandirs))
+ )
}
# filter out all "apt://" URIs out of SRC_URI and stick them into SRC_APT
diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index c9d90a9..14795a7 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -28,6 +28,8 @@ python do_write_wks_template () {
}
python () {
+ import itertools
+
wks_full_path = None
wks_file = d.getVar('WKS_FILE', True)
@@ -41,14 +43,21 @@ python () {
wks_full_path = wks_file
else:
bbpaths = d.getVar('BBPATH', True).split(':')
+ corebase_paths = bbpaths
+
corebase = d.getVar('COREBASE', True)
- search_path = ':'.join('%s/wic' % p for p in bbpaths) + ':' + \
- ':'.join('%s/scripts/lib/wic/canned-wks' % l \
- for l in (bbpaths + [corebase]))
+ if corebase is not None:
+ corebase_paths.append(corebase)
+
+ search_path = ":".join(itertools.chain(
+ (p + "/wic" for p in bbpaths),
+ (l + "/scripts/lib/wic/canned-wks"
+ for l in (corebase_paths)),
+ ))
wks_full_path = bb.utils.which(search_path, wks_file)
if not wks_full_path:
- bb.fatal("WKS_FILE '%s' not found" % wks_file)
+ bb.fatal("WKS_FILE '{}' not found".format(wks_file))
d.setVar('WKS_FULL_PATH', wks_full_path)
@@ -117,12 +126,12 @@ python do_rootfs_wicenv () {
for var in wicvars.split():
value = d.getVar(var, True)
if value:
- envf.write('%s="%s"\n' % (var, value.strip()))
+ envf.write('{}="{}"\n'.format(var, value.strip()))
# this part is stolen from OE ./meta/recipes-core/meta/wic-tools.bb
with open(os.path.join(outdir, "wic-tools.env"), 'w') as envf:
for var in ('RECIPE_SYSROOT_NATIVE', 'STAGING_DATADIR', 'STAGING_LIBDIR'):
- envf.write('%s="%s"\n' % (var, d.getVar(var, True).strip()))
+ envf.write('{}="{}"\n'.format(var, d.getVar(var, True).strip()))
}
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 234d339..5114714 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -40,18 +40,16 @@ python () {
d.setVar("DEBOOTSTRAP_KEYRING", "--keyring ${APTKEYRING}")
for key in distro_apt_keys.split():
url = urlparse(key)
- filename = ''.join([wd, url.path])
- d.appendVar("SRC_URI", " %s" % key)
- d.appendVar("APTKEYFILES", " %s" % filename)
+ d.appendVar("SRC_URI", " " + key)
+ d.appendVar("APTKEYFILES", " " + wd + url.path)
if bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')):
own_pub_key = d.getVar("BASE_REPO_KEY", False)
if own_pub_key:
d.setVar("DEBOOTSTRAP_KEYRING", "--keyring ${APTKEYRING}")
for key in own_pub_key.split():
url = urlparse(key)
- filename = ''.join([wd, url.path])
- d.appendVar("SRC_URI", " %s" % key)
- d.appendVar("APTKEYFILES", " %s" % filename)
+ d.appendVar("SRC_URI", " " + key)
+ d.appendVar("APTKEYFILES", " " + wd + url.path)
}
def aggregate_files(d, file_list, file_out):
@@ -170,7 +168,7 @@ def get_distro_suite(d, is_host):
def get_distro_components_argument(d, is_host):
components = get_distro_primary_source_entry(d, is_host)[2]
if components and components.strip():
- return "--components=%s" % ",".join(components.split())
+ return "--components=" + ",".join(components.split())
else:
return ""
--
2.20.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 4/6] image: Remove recursion in get_image_name
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
` (2 preceding siblings ...)
2019-03-04 13:07 ` [PATCH v4 3/6] Use modern python formatting claudius.heine.ext
@ 2019-03-04 13:07 ` claudius.heine.ext
2019-03-04 13:08 ` [PATCH v4 5/6] wic: Refactor fakeroot script claudius.heine.ext
` (4 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: claudius.heine.ext @ 2019-03-04 13:07 UTC (permalink / raw)
To: isar-users; +Cc: Harald Seiler
From: Harald Seiler <hws@denx.de>
The use of recursion in this function is not immediately
obvious. This commit refactors the recursion into a more
visible imperative code style.
Signed-off-by: Harald Seiler <hws@denx.de>
---
meta/classes/image.bbclass | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 34d6515..a60441c 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -43,13 +43,24 @@ ROOTFS_EXTRA ?= "64"
def get_image_name(d, name_link):
S = d.getVar("IMAGE_ROOTFS", True)
path_link = os.path.join(S, name_link)
+
+ # If path_link does not exist, it might be a symlink
+ # in the target rootfs. This block attempts to resolve
+ # it relative to the rootfs location.
+ if not os.path.exists(path_link):
+ path_link = os.path.join(
+ S,
+ os.path.relpath(
+ os.path.realpath(path_link),
+ "/",
+ ),
+ )
+
if os.path.exists(path_link):
base = os.path.basename(os.path.realpath(path_link))
full = d.getVar("IMAGE_FULLNAME", True) + "." + base
return [base, full]
- if os.path.islink(path_link):
- return get_image_name(d, os.path.relpath(os.path.realpath(path_link),
- '/'))
+
return ["", ""]
def get_rootfs_size(d):
--
2.20.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 5/6] wic: Refactor fakeroot script
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
` (3 preceding siblings ...)
2019-03-04 13:07 ` [PATCH v4 4/6] image: Remove recursion in get_image_name claudius.heine.ext
@ 2019-03-04 13:08 ` claudius.heine.ext
2019-03-04 13:08 ` [PATCH v4 6/6] Fix python style claudius.heine.ext
` (3 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: claudius.heine.ext @ 2019-03-04 13:08 UTC (permalink / raw)
To: isar-users; +Cc: Harald Seiler
From: Harald Seiler <hws@denx.de>
Signed-off-by: Harald Seiler <hws@denx.de>
---
scripts/wic_fakeroot | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/scripts/wic_fakeroot b/scripts/wic_fakeroot
index 9e01c38..88a03fa 100755
--- a/scripts/wic_fakeroot
+++ b/scripts/wic_fakeroot
@@ -11,7 +11,6 @@
#
import os
import sys
-import shutil
import subprocess
args = sys.argv
@@ -24,14 +23,12 @@ cmd = args[0]
# i.e. in wics partition.py the "du -ks" fails on
# var/cache/apt/archives/partial
# rootfs/root ...
-assert 'root' == os.environ["USER"]
+assert os.geteuid() == 0, "wic_fakeroot must be run as root!"
# e2fsck <= 1.43.5 returns 1 on non-errors (stretch and before affected)
# treat 1 as safe ... the filesystem was successfully repaired and is OK
if cmd.startswith('fsck.'):
ret = subprocess.call(args)
- if ret == 0 or ret == 1:
- sys.exit(0)
- sys.exit(ret)
+ sys.exit(0 if ret == 1 else ret)
-os.execv(shutil.which(cmd), args)
+os.execvp(cmd, args)
--
2.20.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v4 6/6] Fix python style
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
` (4 preceding siblings ...)
2019-03-04 13:08 ` [PATCH v4 5/6] wic: Refactor fakeroot script claudius.heine.ext
@ 2019-03-04 13:08 ` claudius.heine.ext
2019-03-04 16:21 ` [PATCH v4 0/6] Python refactoring Claudius Heine
` (2 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: claudius.heine.ext @ 2019-03-04 13:08 UTC (permalink / raw)
To: isar-users; +Cc: Harald Seiler
From: Harald Seiler <hws@denx.de>
Signed-off-by: Harald Seiler <hws@denx.de>
---
.../recipes-kernel/example-module/example-module.bb | 8 +++++++-
meta/classes/base.bbclass | 2 +-
meta/classes/isar-events.bbclass | 1 -
meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb | 9 ++++++---
.../recipes-core/isar-bootstrap/isar-bootstrap-target.bb | 5 +++--
5 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/meta-isar/recipes-kernel/example-module/example-module.bb b/meta-isar/recipes-kernel/example-module/example-module.bb
index b725416..a08a6c5 100644
--- a/meta-isar/recipes-kernel/example-module/example-module.bb
+++ b/meta-isar/recipes-kernel/example-module/example-module.bb
@@ -11,7 +11,13 @@
# has hard dependencies from linux-compiler-gcc-4.8-arm, what
# conflicts with the host binaries.
python() {
- if d.getVar('KERNEL_NAME') in ['armmp', 'arm64', 'rpi-rpfv', 'amd64', '686-pae']:
+ if d.getVar('KERNEL_NAME') in [
+ 'armmp',
+ 'arm64',
+ 'rpi-rpfv',
+ 'amd64',
+ '686-pae',
+ ]:
d.setVar('ISAR_CROSS_COMPILE', '0')
}
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index c9b9e9e..9a1837f 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -126,7 +126,7 @@ python() {
src_apt = []
for u in src_uri:
if u.startswith(prefix):
- src_apt.append(u[len(prefix):])
+ src_apt.append(u[len(prefix) :])
else:
new_src_uri.append(u)
diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass
index a178d05..7dd1ed5 100644
--- a/meta/classes/isar-events.bbclass
+++ b/meta/classes/isar-events.bbclass
@@ -8,7 +8,6 @@ addhandler isar_handler
python isar_handler() {
import subprocess
- import bb.runqueue
tmpdir = d.getVar('TMPDIR', True)
if not tmpdir:
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb
index a793585..08b068f 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb
@@ -29,13 +29,16 @@ do_apt_config_prepare[vardeps] += "\
python do_apt_config_prepare() {
if not os.path.islink(d.getVar("DEPLOY_ISAR_BOOTSTRAP", True)):
apt_preferences_out = d.getVar("APTPREFS", True)
- apt_preferences_list = (d.getVar("HOST_DISTRO_APT_PREFERENCES", True) or ""
- ).split()
+ apt_preferences_list = (
+ d.getVar("HOST_DISTRO_APT_PREFERENCES", True) or ""
+ ).split()
aggregate_files(d, apt_preferences_list, apt_preferences_out)
apt_sources_out = d.getVar("APTSRCS", True)
apt_sources_init_out = d.getVar("APTSRCS_INIT", True)
- apt_sources_list = (d.getVar("HOST_DISTRO_APT_SOURCES", True) or "").split()
+ apt_sources_list = (
+ d.getVar("HOST_DISTRO_APT_SOURCES", True) or ""
+ ).split()
aggregate_files(d, apt_sources_list, apt_sources_init_out)
aggregate_aptsources_list(d, apt_sources_list, apt_sources_out)
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb
index bec6fa8..79f3e34 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb
@@ -28,8 +28,9 @@ do_apt_config_prepare[vardeps] += "\
python do_apt_config_prepare() {
if not os.path.islink(d.getVar("DEPLOY_ISAR_BOOTSTRAP", True)):
apt_preferences_out = d.getVar("APTPREFS", True)
- apt_preferences_list = (d.getVar("DISTRO_APT_PREFERENCES", True) or ""
- ).split()
+ apt_preferences_list = (
+ d.getVar("DISTRO_APT_PREFERENCES", True) or ""
+ ).split()
aggregate_files(d, apt_preferences_list, apt_preferences_out)
apt_sources_out = d.getVar("APTSRCS", True)
--
2.20.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 0/6] Python refactoring
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
` (5 preceding siblings ...)
2019-03-04 13:08 ` [PATCH v4 6/6] Fix python style claudius.heine.ext
@ 2019-03-04 16:21 ` Claudius Heine
2019-03-11 10:10 ` Maxim Yu. Osipov
2019-03-12 14:56 ` Claudius Heine
2019-03-12 22:36 ` Maxim Yu. Osipov
8 siblings, 1 reply; 16+ messages in thread
From: Claudius Heine @ 2019-03-04 16:21 UTC (permalink / raw)
To: isar-users; +Cc: Claudius Heine
Hi,
On 04/03/2019 14.07, [ext] claudius.heine.ext@siemens.com wrote:
> From: Claudius Heine <ch@denx.de>
>
> Hi,
>
> I just took Haralds patchset + Maxims rebase and fixed it up.
>
> There was just a tiny change necessary, I added that in an additional patch.
> It builds on my machine (qemuamd64) and I am currently testing it on isar-ci.
Ok I run this patchset two times on the isar-ci now. The exact same
commit id failed the first time after ~10 minutes [1] and will go green
the second time [2] (Not completely finished yet, but it looks good so
far after 1h50m.)
We really should fix the nondeterminism in the CI.
regards,
Claudius
[1] http://isar-build.org:8080/job/isar_claudius_ilbers-ci/22/
[2] http://isar-build.org:8080/job/isar_claudius_ilbers-ci/23/
>
> If that is successful and review is ok, my patch can be merged into the
> 'Remove all uses of subprocess.call(shell=True)' or left separately.
>
> regards,
> Claudius
>
> Claudius Heine (1):
> isar-bootstrap-helper: get_deb_host_arch: fix decoding
>
> Harald Seiler (5):
> Remove all uses of subprocess.call(shell=True)
> Use modern python formatting
> image: Remove recursion in get_image_name
> wic: Refactor fakeroot script
> Fix python style
>
> .../example-module/example-module.bb | 8 ++-
> meta/classes/base.bbclass | 70 ++++++++++++-------
> meta/classes/image.bbclass | 22 ++++--
> meta/classes/isar-bootstrap-helper.bbclass | 8 +--
> meta/classes/isar-events.bbclass | 14 ++--
> meta/classes/patch.bbclass | 13 ++--
> meta/classes/wic-img.bbclass | 21 ++++--
> .../isar-bootstrap/isar-bootstrap-host.bb | 9 ++-
> .../isar-bootstrap/isar-bootstrap-target.bb | 5 +-
> .../isar-bootstrap/isar-bootstrap.inc | 12 ++--
> scripts/wic_fakeroot | 9 +--
> 11 files changed, 120 insertions(+), 71 deletions(-)
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 0/6] Python refactoring
2019-03-04 16:21 ` [PATCH v4 0/6] Python refactoring Claudius Heine
@ 2019-03-11 10:10 ` Maxim Yu. Osipov
2019-03-11 12:22 ` Claudius Heine
0 siblings, 1 reply; 16+ messages in thread
From: Maxim Yu. Osipov @ 2019-03-11 10:10 UTC (permalink / raw)
To: Claudius Heine, isar-users; +Cc: Claudius Heine
Hi Claudius,
On 3/4/19 5:21 PM, Claudius Heine wrote:
> Hi,
>
> On 04/03/2019 14.07, [ext] claudius.heine.ext@siemens.com wrote:
>> From: Claudius Heine <ch@denx.de>
>>
>> Hi,
>>
>> I just took Haralds patchset + Maxims rebase and fixed it up.
>>
>> There was just a tiny change necessary, I added that in an additional
>> patch.
>> It builds on my machine (qemuamd64) and I am currently testing it on
>> isar-ci.
>
> Ok I run this patchset two times on the isar-ci now. The exact same
> commit id failed the first time after ~10 minutes [1] and will go green
> the second time [2] (Not completely finished yet, but it looks good so
> far after 1h50m.)
>
> We really should fix the nondeterminism in the CI.
From the first glance the error caused build failure was
E: Couldn't download packages: locales
How are you going to fix such "non-determinism"?
Regards,
Maxim.
>
> regards,
> Claudius
>
> [1] http://isar-build.org:8080/job/isar_claudius_ilbers-ci/22/
> [2] http://isar-build.org:8080/job/isar_claudius_ilbers-ci/23/
>
>>
>> If that is successful and review is ok, my patch can be merged into the
>> 'Remove all uses of subprocess.call(shell=True)' or left separately.
>>
>> regards,
>> Claudius
>>
>> Claudius Heine (1):
>> isar-bootstrap-helper: get_deb_host_arch: fix decoding
>>
>> Harald Seiler (5):
>> Remove all uses of subprocess.call(shell=True)
>> Use modern python formatting
>> image: Remove recursion in get_image_name
>> wic: Refactor fakeroot script
>> Fix python style
>>
>> .../example-module/example-module.bb | 8 ++-
>> meta/classes/base.bbclass | 70 ++++++++++++-------
>> meta/classes/image.bbclass | 22 ++++--
>> meta/classes/isar-bootstrap-helper.bbclass | 8 +--
>> meta/classes/isar-events.bbclass | 14 ++--
>> meta/classes/patch.bbclass | 13 ++--
>> meta/classes/wic-img.bbclass | 21 ++++--
>> .../isar-bootstrap/isar-bootstrap-host.bb | 9 ++-
>> .../isar-bootstrap/isar-bootstrap-target.bb | 5 +-
>> .../isar-bootstrap/isar-bootstrap.inc | 12 ++--
>> scripts/wic_fakeroot | 9 +--
>> 11 files changed, 120 insertions(+), 71 deletions(-)
>>
>
--
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 0/6] Python refactoring
2019-03-11 10:10 ` Maxim Yu. Osipov
@ 2019-03-11 12:22 ` Claudius Heine
0 siblings, 0 replies; 16+ messages in thread
From: Claudius Heine @ 2019-03-11 12:22 UTC (permalink / raw)
To: Maxim Yu. Osipov, isar-users; +Cc: Claudius Heine
On Mon, 2019-03-11 at 11:10 +0100, Maxim Yu. Osipov wrote:
> Hi Claudius,
>
> On 3/4/19 5:21 PM, Claudius Heine wrote:
> > Hi,
> >
> > On 04/03/2019 14.07, [ext] claudius.heine.ext@siemens.com wrote:
> > > From: Claudius Heine <ch@denx.de>
> > >
> > > Hi,
> > >
> > > I just took Haralds patchset + Maxims rebase and fixed it up.
> > >
> > > There was just a tiny change necessary, I added that in an
> > > additional
> > > patch.
> > > It builds on my machine (qemuamd64) and I am currently testing it
> > > on
> > > isar-ci.
> >
> > Ok I run this patchset two times on the isar-ci now. The exact
> > same
> > commit id failed the first time after ~10 minutes [1] and will go
> > green
> > the second time [2] (Not completely finished yet, but it looks good
> > so
> > far after 1h50m.)
> >
> > We really should fix the nondeterminism in the CI.
>
> From the first glance the error caused build failure was
>
> E: Couldn't download packages: locales
>
> How are you going to fix such "non-determinism"?
Such problems are not an issue in OE so they should not be an issue in
Isar.
Claudius
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 0/6] Python refactoring
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
` (6 preceding siblings ...)
2019-03-04 16:21 ` [PATCH v4 0/6] Python refactoring Claudius Heine
@ 2019-03-12 14:56 ` Claudius Heine
2019-03-12 15:26 ` Jan Kiszka
2019-03-12 22:36 ` Maxim Yu. Osipov
8 siblings, 1 reply; 16+ messages in thread
From: Claudius Heine @ 2019-03-12 14:56 UTC (permalink / raw)
To: isar-users; +Cc: Claudius Heine
This should probaly also be part of the isar release. It should fix
those 'ResourceWarning: unclosed file <_io.BufferedReader name=32>'
bitbake warnings.
On Mon, 2019-03-04 at 14:07 +0100, [ext] claudius.heine.ext@siemens.com
wrote:
> From: Claudius Heine <ch@denx.de>
>
> Hi,
>
> I just took Haralds patchset + Maxims rebase and fixed it up.
>
> There was just a tiny change necessary, I added that in an additional
> patch.
> It builds on my machine (qemuamd64) and I am currently testing it on
> isar-ci.
>
> If that is successful and review is ok, my patch can be merged into
> the
> 'Remove all uses of subprocess.call(shell=True)' or left separately.
>
> regards,
> Claudius
>
> Claudius Heine (1):
> isar-bootstrap-helper: get_deb_host_arch: fix decoding
>
> Harald Seiler (5):
> Remove all uses of subprocess.call(shell=True)
> Use modern python formatting
> image: Remove recursion in get_image_name
> wic: Refactor fakeroot script
> Fix python style
>
> .../example-module/example-module.bb | 8 ++-
> meta/classes/base.bbclass | 70 ++++++++++++-----
> --
> meta/classes/image.bbclass | 22 ++++--
> meta/classes/isar-bootstrap-helper.bbclass | 8 +--
> meta/classes/isar-events.bbclass | 14 ++--
> meta/classes/patch.bbclass | 13 ++--
> meta/classes/wic-img.bbclass | 21 ++++--
> .../isar-bootstrap/isar-bootstrap-host.bb | 9 ++-
> .../isar-bootstrap/isar-bootstrap-target.bb | 5 +-
> .../isar-bootstrap/isar-bootstrap.inc | 12 ++--
> scripts/wic_fakeroot | 9 +--
> 11 files changed, 120 insertions(+), 71 deletions(-)
>
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 0/6] Python refactoring
2019-03-12 14:56 ` Claudius Heine
@ 2019-03-12 15:26 ` Jan Kiszka
2019-03-12 15:34 ` Claudius Heine
0 siblings, 1 reply; 16+ messages in thread
From: Jan Kiszka @ 2019-03-12 15:26 UTC (permalink / raw)
To: [ext] Claudius Heine, isar-users; +Cc: Claudius Heine
On 12.03.19 15:56, [ext] Claudius Heine wrote:
> This should probaly also be part of the isar release. It should fix
> those 'ResourceWarning: unclosed file <_io.BufferedReader name=32>'
> bitbake warnings.
Which of the commits should fix that, and why? Remains non-obvious to me.
But I don't disagree that fixes, even minor ones, should be part of the release.
There are way more fixes pending, let's give Maxim some time.
Jan
>
> On Mon, 2019-03-04 at 14:07 +0100, [ext] claudius.heine.ext@siemens.com
> wrote:
>> From: Claudius Heine <ch@denx.de>
>>
>> Hi,
>>
>> I just took Haralds patchset + Maxims rebase and fixed it up.
>>
>> There was just a tiny change necessary, I added that in an additional
>> patch.
>> It builds on my machine (qemuamd64) and I am currently testing it on
>> isar-ci.
>>
>> If that is successful and review is ok, my patch can be merged into
>> the
>> 'Remove all uses of subprocess.call(shell=True)' or left separately.
>>
>> regards,
>> Claudius
>>
>> Claudius Heine (1):
>> isar-bootstrap-helper: get_deb_host_arch: fix decoding
>>
>> Harald Seiler (5):
>> Remove all uses of subprocess.call(shell=True)
>> Use modern python formatting
>> image: Remove recursion in get_image_name
>> wic: Refactor fakeroot script
>> Fix python style
>>
>> .../example-module/example-module.bb | 8 ++-
>> meta/classes/base.bbclass | 70 ++++++++++++-----
>> --
>> meta/classes/image.bbclass | 22 ++++--
>> meta/classes/isar-bootstrap-helper.bbclass | 8 +--
>> meta/classes/isar-events.bbclass | 14 ++--
>> meta/classes/patch.bbclass | 13 ++--
>> meta/classes/wic-img.bbclass | 21 ++++--
>> .../isar-bootstrap/isar-bootstrap-host.bb | 9 ++-
>> .../isar-bootstrap/isar-bootstrap-target.bb | 5 +-
>> .../isar-bootstrap/isar-bootstrap.inc | 12 ++--
>> scripts/wic_fakeroot | 9 +--
>> 11 files changed, 120 insertions(+), 71 deletions(-)
>>
>> --
>> 2.20.1
>>
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 0/6] Python refactoring
2019-03-12 15:26 ` Jan Kiszka
@ 2019-03-12 15:34 ` Claudius Heine
2019-03-12 16:03 ` Jan Kiszka
0 siblings, 1 reply; 16+ messages in thread
From: Claudius Heine @ 2019-03-12 15:34 UTC (permalink / raw)
To: Jan Kiszka, isar-users; +Cc: Claudius Heine
On 12/03/2019 16.26, Jan Kiszka wrote:
> On 12.03.19 15:56, [ext] Claudius Heine wrote:
>> This should probaly also be part of the isar release. It should fix
>> those 'ResourceWarning: unclosed file <_io.BufferedReader name=32>'
>> bitbake warnings.
>
> Which of the commits should fix that, and why? Remains non-obvious to me.
The first one 'Remove all uses of subprocess.call(shell=True)'.
The usage of 'Popen' requires that the process handler should be closed,
which was not done in isar-bootstrap-helper.bbclass. The right solution
is either not use Popen (which this patch changes) or use Popen with a
context manager (which I have done in the template.bbclass).
>
> But I don't disagree that fixes, even minor ones, should be part of the
> release. There are way more fixes pending, let's give Maxim some time.
I just wanted to give the additional information here, because that
could have been missed.
Claudius
>
> Jan
>
>>
>> On Mon, 2019-03-04 at 14:07 +0100, [ext] claudius.heine.ext@siemens.com
>> wrote:
>>> From: Claudius Heine <ch@denx.de>
>>>
>>> Hi,
>>>
>>> I just took Haralds patchset + Maxims rebase and fixed it up.
>>>
>>> There was just a tiny change necessary, I added that in an additional
>>> patch.
>>> It builds on my machine (qemuamd64) and I am currently testing it on
>>> isar-ci.
>>>
>>> If that is successful and review is ok, my patch can be merged into
>>> the
>>> 'Remove all uses of subprocess.call(shell=True)' or left separately.
>>>
>>> regards,
>>> Claudius
>>>
>>> Claudius Heine (1):
>>> isar-bootstrap-helper: get_deb_host_arch: fix decoding
>>>
>>> Harald Seiler (5):
>>> Remove all uses of subprocess.call(shell=True)
>>> Use modern python formatting
>>> image: Remove recursion in get_image_name
>>> wic: Refactor fakeroot script
>>> Fix python style
>>>
>>> .../example-module/example-module.bb | 8 ++-
>>> meta/classes/base.bbclass | 70 ++++++++++++-----
>>> --
>>> meta/classes/image.bbclass | 22 ++++--
>>> meta/classes/isar-bootstrap-helper.bbclass | 8 +--
>>> meta/classes/isar-events.bbclass | 14 ++--
>>> meta/classes/patch.bbclass | 13 ++--
>>> meta/classes/wic-img.bbclass | 21 ++++--
>>> .../isar-bootstrap/isar-bootstrap-host.bb | 9 ++-
>>> .../isar-bootstrap/isar-bootstrap-target.bb | 5 +-
>>> .../isar-bootstrap/isar-bootstrap.inc | 12 ++--
>>> scripts/wic_fakeroot | 9 +--
>>> 11 files changed, 120 insertions(+), 71 deletions(-)
>>>
>>> --
>>> 2.20.1
>>>
>>
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 0/6] Python refactoring
2019-03-12 15:34 ` Claudius Heine
@ 2019-03-12 16:03 ` Jan Kiszka
2019-03-12 16:17 ` Claudius Heine
0 siblings, 1 reply; 16+ messages in thread
From: Jan Kiszka @ 2019-03-12 16:03 UTC (permalink / raw)
To: Claudius Heine, isar-users; +Cc: Claudius Heine
On 12.03.19 16:34, Claudius Heine wrote:
> On 12/03/2019 16.26, Jan Kiszka wrote:
>> On 12.03.19 15:56, [ext] Claudius Heine wrote:
>>> This should probaly also be part of the isar release. It should fix
>>> those 'ResourceWarning: unclosed file <_io.BufferedReader name=32>'
>>> bitbake warnings.
>>
>> Which of the commits should fix that, and why? Remains non-obvious to me.
>
> The first one 'Remove all uses of subprocess.call(shell=True)'.
>
> The usage of 'Popen' requires that the process handler should be closed, which
> was not done in isar-bootstrap-helper.bbclass. The right solution is either not
> use Popen (which this patch changes) or use Popen with a context manager (which
> I have done in the template.bbclass).
>
Ah, ok. Should be in the commit log then. These warnings were pretty annoying.
Jan
>>
>> But I don't disagree that fixes, even minor ones, should be part of the
>> release. There are way more fixes pending, let's give Maxim some time.
>
> I just wanted to give the additional information here, because that could have
> been missed.
>
> Claudius
>
>>
>> Jan
>>
>>>
>>> On Mon, 2019-03-04 at 14:07 +0100, [ext] claudius.heine.ext@siemens.com
>>> wrote:
>>>> From: Claudius Heine <ch@denx.de>
>>>>
>>>> Hi,
>>>>
>>>> I just took Haralds patchset + Maxims rebase and fixed it up.
>>>>
>>>> There was just a tiny change necessary, I added that in an additional
>>>> patch.
>>>> It builds on my machine (qemuamd64) and I am currently testing it on
>>>> isar-ci.
>>>>
>>>> If that is successful and review is ok, my patch can be merged into
>>>> the
>>>> 'Remove all uses of subprocess.call(shell=True)' or left separately.
>>>>
>>>> regards,
>>>> Claudius
>>>>
>>>> Claudius Heine (1):
>>>> isar-bootstrap-helper: get_deb_host_arch: fix decoding
>>>>
>>>> Harald Seiler (5):
>>>> Remove all uses of subprocess.call(shell=True)
>>>> Use modern python formatting
>>>> image: Remove recursion in get_image_name
>>>> wic: Refactor fakeroot script
>>>> Fix python style
>>>>
>>>> .../example-module/example-module.bb | 8 ++-
>>>> meta/classes/base.bbclass | 70 ++++++++++++-----
>>>> --
>>>> meta/classes/image.bbclass | 22 ++++--
>>>> meta/classes/isar-bootstrap-helper.bbclass | 8 +--
>>>> meta/classes/isar-events.bbclass | 14 ++--
>>>> meta/classes/patch.bbclass | 13 ++--
>>>> meta/classes/wic-img.bbclass | 21 ++++--
>>>> .../isar-bootstrap/isar-bootstrap-host.bb | 9 ++-
>>>> .../isar-bootstrap/isar-bootstrap-target.bb | 5 +-
>>>> .../isar-bootstrap/isar-bootstrap.inc | 12 ++--
>>>> scripts/wic_fakeroot | 9 +--
>>>> 11 files changed, 120 insertions(+), 71 deletions(-)
>>>>
>>>> --
>>>> 2.20.1
>>>>
>>>
>>
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 0/6] Python refactoring
2019-03-12 16:03 ` Jan Kiszka
@ 2019-03-12 16:17 ` Claudius Heine
0 siblings, 0 replies; 16+ messages in thread
From: Claudius Heine @ 2019-03-12 16:17 UTC (permalink / raw)
To: Jan Kiszka, isar-users; +Cc: Claudius Heine
On Tue, 2019-03-12 at 17:03 +0100, Jan Kiszka wrote:
> On 12.03.19 16:34, Claudius Heine wrote:
> > On 12/03/2019 16.26, Jan Kiszka wrote:
> > > On 12.03.19 15:56, [ext] Claudius Heine wrote:
> > > > This should probaly also be part of the isar release. It should
> > > > fix
> > > > those 'ResourceWarning: unclosed file <_io.BufferedReader
> > > > name=32>'
> > > > bitbake warnings.
> > >
> > > Which of the commits should fix that, and why? Remains non-
> > > obvious to me.
> >
> > The first one 'Remove all uses of subprocess.call(shell=True)'.
> >
> > The usage of 'Popen' requires that the process handler should be
> > closed, which
> > was not done in isar-bootstrap-helper.bbclass. The right solution
> > is either not
> > use Popen (which this patch changes) or use Popen with a context
> > manager (which
> > I have done in the template.bbclass).
> >
>
> Ah, ok. Should be in the commit log then. These warnings were pretty
> annoying.
I don't think that Harald was aware that his patch fixed those when he
wrote his patch. He just fixed general mispractices in the python code
that he discovered by himself or by using pylint etc.
This is also just my expectation of what this change probably fixes. I
have not investigated that if that is definitely the case. So that was
more or less just a side-note from me. If someone wants to determine if
my theory is correct, then be welcomed to it.
Claudius
>
> Jan
>
> > > But I don't disagree that fixes, even minor ones, should be part
> > > of the
> > > release. There are way more fixes pending, let's give Maxim some
> > > time.
> >
> > I just wanted to give the additional information here, because that
> > could have
> > been missed.
> >
> > Claudius
> >
> > > Jan
> > >
> > > > On Mon, 2019-03-04 at 14:07 +0100, [ext]
> > > > claudius.heine.ext@siemens.com
> > > > wrote:
> > > > > From: Claudius Heine <ch@denx.de>
> > > > >
> > > > > Hi,
> > > > >
> > > > > I just took Haralds patchset + Maxims rebase and fixed it up.
> > > > >
> > > > > There was just a tiny change necessary, I added that in an
> > > > > additional
> > > > > patch.
> > > > > It builds on my machine (qemuamd64) and I am currently
> > > > > testing it on
> > > > > isar-ci.
> > > > >
> > > > > If that is successful and review is ok, my patch can be
> > > > > merged into
> > > > > the
> > > > > 'Remove all uses of subprocess.call(shell=True)' or left
> > > > > separately.
> > > > >
> > > > > regards,
> > > > > Claudius
> > > > >
> > > > > Claudius Heine (1):
> > > > > isar-bootstrap-helper: get_deb_host_arch: fix decoding
> > > > >
> > > > > Harald Seiler (5):
> > > > > Remove all uses of subprocess.call(shell=True)
> > > > > Use modern python formatting
> > > > > image: Remove recursion in get_image_name
> > > > > wic: Refactor fakeroot script
> > > > > Fix python style
> > > > >
> > > > > .../example-module/example-module.bb | 8 ++-
> > > > > meta/classes/base.bbclass | 70
> > > > > ++++++++++++-----
> > > > > --
> > > > > meta/classes/image.bbclass | 22 ++++--
> > > > > meta/classes/isar-bootstrap-helper.bbclass | 8 +--
> > > > > meta/classes/isar-events.bbclass | 14 ++--
> > > > > meta/classes/patch.bbclass | 13 ++--
> > > > > meta/classes/wic-img.bbclass | 21 ++++--
> > > > > .../isar-bootstrap/isar-bootstrap-host.bb | 9 ++-
> > > > > .../isar-bootstrap/isar-bootstrap-target.bb | 5 +-
> > > > > .../isar-bootstrap/isar-bootstrap.inc | 12 ++--
> > > > > scripts/wic_fakeroot | 9 +--
> > > > > 11 files changed, 120 insertions(+), 71 deletions(-)
> > > > >
> > > > > --
> > > > > 2.20.1
> > > > >
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v4 0/6] Python refactoring
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
` (7 preceding siblings ...)
2019-03-12 14:56 ` Claudius Heine
@ 2019-03-12 22:36 ` Maxim Yu. Osipov
8 siblings, 0 replies; 16+ messages in thread
From: Maxim Yu. Osipov @ 2019-03-12 22:36 UTC (permalink / raw)
To: claudius.heine.ext, isar-users; +Cc: Claudius Heine
On 3/4/19 2:07 PM, claudius.heine.ext@siemens.com wrote:
> From: Claudius Heine <ch@denx.de>
>
> Hi,
>
> I just took Haralds patchset + Maxims rebase and fixed it up.
>
> There was just a tiny change necessary, I added that in an additional patch.
> It builds on my machine (qemuamd64) and I am currently testing it on isar-ci.
>
> If that is successful and review is ok, my patch can be merged into the
> 'Remove all uses of subprocess.call(shell=True)' or left separately.
Applied to the 'next'.
Thanks,
Maxim.
> regards,
> Claudius
>
> Claudius Heine (1):
> isar-bootstrap-helper: get_deb_host_arch: fix decoding
>
> Harald Seiler (5):
> Remove all uses of subprocess.call(shell=True)
> Use modern python formatting
> image: Remove recursion in get_image_name
> wic: Refactor fakeroot script
> Fix python style
>
> .../example-module/example-module.bb | 8 ++-
> meta/classes/base.bbclass | 70 ++++++++++++-------
> meta/classes/image.bbclass | 22 ++++--
> meta/classes/isar-bootstrap-helper.bbclass | 8 +--
> meta/classes/isar-events.bbclass | 14 ++--
> meta/classes/patch.bbclass | 13 ++--
> meta/classes/wic-img.bbclass | 21 ++++--
> .../isar-bootstrap/isar-bootstrap-host.bb | 9 ++-
> .../isar-bootstrap/isar-bootstrap-target.bb | 5 +-
> .../isar-bootstrap/isar-bootstrap.inc | 12 ++--
> scripts/wic_fakeroot | 9 +--
> 11 files changed, 120 insertions(+), 71 deletions(-)
>
--
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2019-03-12 22:36 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 13:07 [PATCH v4 0/6] Python refactoring claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 1/6] Remove all uses of subprocess.call(shell=True) claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 2/6] isar-bootstrap-helper: get_deb_host_arch: fix decoding claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 3/6] Use modern python formatting claudius.heine.ext
2019-03-04 13:07 ` [PATCH v4 4/6] image: Remove recursion in get_image_name claudius.heine.ext
2019-03-04 13:08 ` [PATCH v4 5/6] wic: Refactor fakeroot script claudius.heine.ext
2019-03-04 13:08 ` [PATCH v4 6/6] Fix python style claudius.heine.ext
2019-03-04 16:21 ` [PATCH v4 0/6] Python refactoring Claudius Heine
2019-03-11 10:10 ` Maxim Yu. Osipov
2019-03-11 12:22 ` Claudius Heine
2019-03-12 14:56 ` Claudius Heine
2019-03-12 15:26 ` Jan Kiszka
2019-03-12 15:34 ` Claudius Heine
2019-03-12 16:03 ` Jan Kiszka
2019-03-12 16:17 ` Claudius Heine
2019-03-12 22:36 ` Maxim Yu. Osipov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox