Skip to contentSkip to conversation

Misc correctness fixes

PATCH In review Paul Eggleton 2 participants 6 messages Dec 22, 2016 – Jan 9, 2017

lore
Share & tools
lore
#0 lore raw

cover Misc correctness fixes

The following changes since commit 5e21afc9395060b489156d3f90505a372b713f37:

Revert "selftest/wic: extending test coverage for WIC script options" (2016-12-20 17:06:01 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/correctness-fixes
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/correctness-fixes

Paul Eggleton (3):
meta: use require instead of include when file should exist
oe-selftest: fix behaviour if oe-selftest.log is a dangling symlink classes/buildstats: don't expand variable pointing to SystemStats

 meta/classes/buildstats.bbclass                                       | 2 +-
 meta/recipes-core/glibc/glibc-locale.inc                              | 2 +-
 meta/recipes-core/glibc/glibc-mtrace.inc                              | 2 +-
 meta/recipes-core/glibc/glibc-scripts.inc                             | 2 +-
 meta/recipes-extended/cpio/cpio_2.12.bb                               | 2 +-
 meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb                     | 2 +-
 meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb                    | 2 +-
 meta/recipes-graphics/xorg-driver/xorg-driver-input.inc               | 2 +-
 meta/recipes-graphics/xorg-driver/xorg-driver-video.inc               | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.10.1.bb        | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb           | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb           | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb             | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.1.bb  | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb     | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.1.bb | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb    | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.10.1.bb | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb    | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.10.1.bb | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb    | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.10.1.bb  | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0_1.10.1.bb              | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb                 | 2 +-
 meta/recipes-support/boost/bjam-native_1.62.0.bb                      | 2 +-
 meta/recipes-support/boost/boost_1.62.0.bb                            | 4 ++--
 scripts/oe-selftest                                                   | 3 ++-
 27 files changed, 29 insertions(+), 28 deletions(-)
Signature · 1 line
2.5.5
#1 lore raw

PATCH 1/3 meta: use require instead of include when file should exist

If the file is expected to exist, then we should always be using require so that if it doesn't we get an error rather than some other more obscure failure later on.

---
 meta/recipes-core/glibc/glibc-locale.inc                              | 2 +-
 meta/recipes-core/glibc/glibc-mtrace.inc                              | 2 +-
 meta/recipes-core/glibc/glibc-scripts.inc                             | 2 +-
 meta/recipes-extended/cpio/cpio_2.12.bb                               | 2 +-
 meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb                     | 2 +-
 meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb                    | 2 +-
 meta/recipes-graphics/xorg-driver/xorg-driver-input.inc               | 2 +-
 meta/recipes-graphics/xorg-driver/xorg-driver-video.inc               | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.10.1.bb        | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb           | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb           | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb             | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.1.bb  | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb     | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.1.bb | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb    | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.10.1.bb | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb    | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.10.1.bb | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb    | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.10.1.bb  | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0_1.10.1.bb              | 2 +-
 meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb                 | 2 +-
 meta/recipes-support/boost/bjam-native_1.62.0.bb                      | 2 +-
 meta/recipes-support/boost/boost_1.62.0.bb                            | 4 ++--
 25 files changed, 26 insertions(+), 26 deletions(-)
meta/recipes-core/glibc/glibc-locale.inc +1 -1
index 11bd612..50b191c 100644
@@ -1,4 +1,4 @@
-include glibc-collateral.inc
+require glibc-collateral.inc
 
 SUMMARY = "Locale data from glibc"
 
meta/recipes-core/glibc/glibc-mtrace.inc +1 -1
index e12b079..0e4615d 100644
@@ -1,4 +1,4 @@
-include glibc-collateral.inc
+require glibc-collateral.inc
 
 SUMMARY = "mtrace utility provided by glibc"
 DESCRIPTION = "mtrace utility provided by glibc"
meta/recipes-core/glibc/glibc-scripts.inc +1 -1
index bce0a42..66fdee4 100644
@@ -1,4 +1,4 @@
-include glibc-collateral.inc
+require glibc-collateral.inc
 
 SUMMARY = "utility scripts provided by glibc"
 DESCRIPTION = "utility scripts provided by glibc"
meta/recipes-extended/cpio/cpio_2.12.bb +1 -1
index e743999..405a90e 100644
@@ -1,4 +1,4 @@
-include cpio_v2.inc
+require cpio_v2.inc
 
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb +1 -1
index 455d31e..dc2820c 100644
@@ -1,6 +1,6 @@
 EGLINFO_PLATFORM ?= "fb"
 EGLINFO_BINARY_NAME ?= "eglinfo-fb"
 
-include eglinfo.inc
+require eglinfo.inc
 
 SUMMARY += "(Framebuffer version)"
meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb +1 -1
index 3427fdf..06a2fea 100644
@@ -1,7 +1,7 @@
 EGLINFO_PLATFORM ?= "x11"
 EGLINFO_BINARY_NAME ?= "eglinfo-x11"
 
-include eglinfo.inc
+require eglinfo.inc
 
 DEPENDS += "virtual/libx11"
 
meta/recipes-graphics/xorg-driver/xorg-driver-input.inc +1 -1
index c4dba1b..342067d 100644
@@ -1,4 +1,4 @@
-include xorg-driver-common.inc
+require xorg-driver-common.inc
 
 DEPENDS += "inputproto kbproto "
 
meta/recipes-graphics/xorg-driver/xorg-driver-video.inc +1 -1
index 38281e0..b5862da 100644
@@ -1,4 +1,4 @@
-include xorg-driver-common.inc
+require xorg-driver-common.inc
 
 DEPENDS =+ "renderproto videoproto xextproto fontsproto"
 
meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.10.1.bb +1 -1
index 98f5a50..c27f5c4 100644
@@ -1,4 +1,4 @@
-include gstreamer1.0-libav.inc
+require gstreamer1.0-libav.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb +1 -1
index f4604a3..b6c0d7d 100644
@@ -1,6 +1,6 @@
 DEFAULT_PREFERENCE = "-1"
 
-include gstreamer1.0-libav.inc
+require gstreamer1.0-libav.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb +1 -1
index 74358a7..3b4580f 100644
@@ -1,4 +1,4 @@
-include gstreamer1.0-omx.inc
+require gstreamer1.0-omx.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
                     file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb +1 -1
index 9705543..49593b6 100644
@@ -1,6 +1,6 @@
 DEFAULT_PREFERENCE = "-1"
 
-include gstreamer1.0-omx.inc
+require gstreamer1.0-omx.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
                     file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.1.bb +1 -1
index 46df026..91a163c 100644
@@ -1,4 +1,4 @@
-include gstreamer1.0-plugins-bad.inc
+require gstreamer1.0-plugins-bad.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
                     file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb +1 -1
index 609ea0b..79ebcac 100644
@@ -1,6 +1,6 @@
 DEFAULT_PREFERENCE = "-1"
 
-include gstreamer1.0-plugins-bad.inc
+require gstreamer1.0-plugins-bad.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
                     file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.1.bb +1 -1
index 82e5a84..6a01bcb 100644
@@ -1,4 +1,4 @@
-include gstreamer1.0-plugins-base.inc
+require gstreamer1.0-plugins-base.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
                     file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb +1 -1
index bdd4cb8..4d63827 100644
@@ -1,6 +1,6 @@
 DEFAULT_PREFERENCE = "-1"
 
-include gstreamer1.0-plugins-base.inc
+require gstreamer1.0-plugins-base.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
                     file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.10.1.bb +1 -1
index 44703dc..ce1321e 100644
@@ -1,4 +1,4 @@
-include gstreamer1.0-plugins-good.inc
+require gstreamer1.0-plugins-good.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
                     file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb +1 -1
index 120629c..04a313d 100644
@@ -1,6 +1,6 @@
 DEFAULT_PREFERENCE = "-1"
 
-include gstreamer1.0-plugins-good.inc
+require gstreamer1.0-plugins-good.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
                     file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.10.1.bb +1 -1
index 1626430..2f72b90 100644
@@ -1,4 +1,4 @@
-include gstreamer1.0-plugins-ugly.inc
+require gstreamer1.0-plugins-ugly.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
                     file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb +1 -1
index 61cdbe8..5b79234 100644
@@ -1,6 +1,6 @@
 DEFAULT_PREFERENCE = "-1"
 
-include gstreamer1.0-plugins-ugly.inc
+require gstreamer1.0-plugins-ugly.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
                     file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.10.1.bb +1 -1
index 7b6e4cb..3ecfb88 100644
@@ -1,4 +1,4 @@
-include gstreamer1.0-rtsp-server.inc
+require gstreamer1.0-rtsp-server.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
 
meta/recipes-multimedia/gstreamer/gstreamer1.0_1.10.1.bb +1 -1
index 428a012..397dcd3 100644
@@ -1,4 +1,4 @@
-include gstreamer1.0.inc
+require gstreamer1.0.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
                     file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb +1 -1
index 6112f2a..39f38a1 100644
@@ -1,6 +1,6 @@
 DEFAULT_PREFERENCE = "-1"
 
-include gstreamer1.0.inc
+require gstreamer1.0.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
                     file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
meta/recipes-support/boost/bjam-native_1.62.0.bb +1 -1
index 32646d7..46013f3 100644
@@ -1,4 +1,4 @@
-include boost-${PV}.inc
+require boost-${PV}.inc
 
 SUMMARY = "Portable Boost.Jam build tool for boost"
 SECTION = "devel"
meta/recipes-support/boost/boost_1.62.0.bb +2 -2
index 120d129..cde03f2 100644
@@ -1,5 +1,5 @@
-include boost-${PV}.inc
-include boost.inc
+require boost-${PV}.inc
+require boost.inc
 
 SRC_URI += "\
     file://arm-intrinsics.patch \
Signature · 1 line
2.5.5
#2 lore raw

PATCH 2/3 oe-selftest: fix behaviour if oe-selftest.log is a dangling symlink

In reply to Paul Eggleton

If you delete the log file that the oe-selftest.log symlink points to but not the symlink itself, because we were using os.path.exists() here the code assumed that the symlink didn't exist when in fact it still did. Use os.path.lexists() instead.

---
 scripts/oe-selftest | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/oe-selftest +2 -1
index bfcea66..1f11a06 100755
@@ -62,7 +62,8 @@ log_prefix = "oe-selftest-" + t.strftime("%Y%m%d-%H%M%S")
 
 def logger_create():
     log_file = log_prefix + ".log"
-    if os.path.exists("oe-selftest.log"): os.remove("oe-selftest.log")
+    if os.path.lexists("oe-selftest.log"):
+        os.remove("oe-selftest.log")
     os.symlink(log_file, "oe-selftest.log")
 
     log = logging.getLogger("selftest")
Signature · 1 line
2.5.5
#3 lore raw

PATCH 3/3 classes/buildstats: don't expand variable pointing to SystemStats

In reply to Paul Eggleton

We're placing an object into the datastore - it's very definitely not something we want to be expanding.

---
 meta/classes/buildstats.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/buildstats.bbclass +1 -1
index 8703cb2..8d7b598 100644
@@ -197,7 +197,7 @@ python runqueue_stats () {
     # are available that we need to find the output directory.
     # The persistent SystemStats is stored in the datastore and
     # closed when the build is done.
-    system_stats = d.getVar('_buildstats_system_stats')
+    system_stats = d.getVar('_buildstats_system_stats', False)
     if not system_stats and isinstance(e, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted)):
         system_stats = buildstats.SystemStats(d)
         d.setVar('_buildstats_system_stats', system_stats)
Signature · 1 line
2.5.5
#4 lore raw

Re: [PATCH 3/3] classes/buildstats: don't expand variable pointing to SystemStats

Quoted 2 lines · Paul Eggleton

We're placing an object into the datastore - it's very definitely not something we want to be expanding.

Why does it matter? Is it faster to tell getVar() that expansion isn't necessary?

I'm fine with the change, I'm just trying to understand whether this merely cosmetic or has some real impact.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#5 lore raw

Re: [PATCH 3/3] classes/buildstats: don't expand variable pointing to SystemStats

Hi Patrick,

Quoted 9 lines · On Wed, 04 Jan 2017 14:05:03 Patrick Ohly wrote:
Quoted 2 lines · Paul Eggleton

We're placing an object into the datastore - it's very definitely not something we want to be expanding.

Why does it matter? Is it faster to tell getVar() that expansion isn't necessary?

I'm fine with the change, I'm just trying to understand whether this merely cosmetic or has some real impact.

It will be very slightly faster if we say expand=False since the preamble to the expansion code won't be run - though I doubt the speed difference is actually significant outside of a tight loop. There is a guard to prevent actually doing the expansion on a non-string value though so expanding it doesn't do any actual harm (and having that guard is a good thing since it saves us pain if we want to write code to get the expanded value of any variable).

However, to my mind the patch is more about correctness - in this case we know for sure that the value isn't a string, so we should avoid trying to expand it.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre