* [PATCH 1/3] oeqa: don't litter /tmp with temporary directories
@ 2018-12-03 20:35 Ross Burton
2018-12-03 20:35 ` [PATCH 2/3] oeqa/selftest/esdk: run selftest inside workdir not /tmp Ross Burton
2018-12-03 20:35 ` [PATCH 3/3] insane: clarify GNU_HASH warning Ross Burton
0 siblings, 2 replies; 3+ messages in thread
From: Ross Burton @ 2018-12-03 20:35 UTC (permalink / raw)
To: openembedded-core
If we need to create a temporary directory in targetbuild or buildproject use
tempfile.TemporaryDirectory so that when the test case is finished, the
directory is deleted.
Also synchronise the logic and don't possibly store the temporary directory in
self.tmpdir as nothing uses that.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/lib/oeqa/utils/buildproject.py | 5 ++++-
meta/lib/oeqa/utils/targetbuild.py | 5 +++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oeqa/utils/buildproject.py b/meta/lib/oeqa/utils/buildproject.py
index 7e9b84955f5..524015ede4b 100644
--- a/meta/lib/oeqa/utils/buildproject.py
+++ b/meta/lib/oeqa/utils/buildproject.py
@@ -17,7 +17,10 @@ class BuildProject(metaclass=ABCMeta):
self.uri = uri
self.archive = os.path.basename(uri)
if not tmpdir:
- tmpdir = tempfile.mkdtemp(prefix='buildproject')
+ tmpdir = self.d.getVar('WORKDIR')
+ if not tmpdir:
+ self.tempdirobj = tempfile.TemporaryDirectory(prefix='buildproject-')
+ tmpdir = self.tempdirobj.name
self.localarchive = os.path.join(tmpdir, self.archive)
self.dl_dir = dl_dir
if foldername:
diff --git a/meta/lib/oeqa/utils/targetbuild.py b/meta/lib/oeqa/utils/targetbuild.py
index 1202d579fb0..b8db7b2aca0 100644
--- a/meta/lib/oeqa/utils/targetbuild.py
+++ b/meta/lib/oeqa/utils/targetbuild.py
@@ -20,8 +20,9 @@ class BuildProject(metaclass=ABCMeta):
if not tmpdir:
tmpdir = self.d.getVar('WORKDIR')
if not tmpdir:
- tmpdir = tempfile.mkdtemp(prefix='buildproject')
- self.localarchive = os.path.join(tmpdir,self.archive)
+ self.tempdirobj = tempfile.TemporaryDirectory(prefix='buildproject-')
+ tmpdir = self.tempdirobj.name
+ self.localarchive = os.path.join(tmpdir, self.archive)
if foldername:
self.fname = foldername
else:
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/3] oeqa/selftest/esdk: run selftest inside workdir not /tmp
2018-12-03 20:35 [PATCH 1/3] oeqa: don't litter /tmp with temporary directories Ross Burton
@ 2018-12-03 20:35 ` Ross Burton
2018-12-03 20:35 ` [PATCH 3/3] insane: clarify GNU_HASH warning Ross Burton
1 sibling, 0 replies; 3+ messages in thread
From: Ross Burton @ 2018-12-03 20:35 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/lib/oeqa/selftest/cases/eSDK.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/meta/lib/oeqa/selftest/cases/eSDK.py b/meta/lib/oeqa/selftest/cases/eSDK.py
index d03188f2f75..14f75d8c09a 100644
--- a/meta/lib/oeqa/selftest/cases/eSDK.py
+++ b/meta/lib/oeqa/selftest/cases/eSDK.py
@@ -70,11 +70,12 @@ CORE_IMAGE_EXTRA_INSTALL = "perl"
@classmethod
def setUpClass(cls):
super(oeSDKExtSelfTest, cls).setUpClass()
- cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
+ cls.image = 'core-image-minimal'
- sstate_dir = get_bb_var('SSTATE_DIR')
+ bb_vars = get_bb_vars(['SSTATE_DIR', 'WORKDIR'], cls.image)
+ cls.tmpdirobj = tempfile.TemporaryDirectory(prefix="selftest-esdk-", dir=bb_vars["WORKDIR"])
+ cls.tmpdir_eSDKQA = cls.tempdirobj.name
- cls.image = 'core-image-minimal'
oeSDKExtSelfTest.generate_eSDK(cls.image)
# Install eSDK
@@ -87,14 +88,14 @@ CORE_IMAGE_EXTRA_INSTALL = "perl"
sstate_config="""
SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
SSTATE_MIRRORS = "file://.* file://%s/PATH"
- """ % sstate_dir
+ """ % bb_vars["SSTATE_DIR"]
with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
f.write(sstate_config)
@classmethod
def tearDownClass(cls):
- shutil.rmtree(cls.tmpdir_eSDKQA, ignore_errors=True)
- super(oeSDKExtSelfTest, cls).tearDownClass()
+ cls.tmpdirobj.cleanup()
+ super().tearDownClass()
@OETestID(1602)
def test_install_libraries_headers(self):
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/3] insane: clarify GNU_HASH warning
2018-12-03 20:35 [PATCH 1/3] oeqa: don't litter /tmp with temporary directories Ross Burton
2018-12-03 20:35 ` [PATCH 2/3] oeqa/selftest/esdk: run selftest inside workdir not /tmp Ross Burton
@ 2018-12-03 20:35 ` Ross Burton
1 sibling, 0 replies; 3+ messages in thread
From: Ross Burton @ 2018-12-03 20:35 UTC (permalink / raw)
To: openembedded-core
We have a fatal error if ELF objects don't have GNU_HASH segments don't don't
explain what the problem is. At least give a hint to users by suggesting that
LDFLAGS wasn't passed to the compiler.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/classes/insane.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 4644221bc6b..6718feb3af5 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -383,7 +383,7 @@ def package_qa_hash_style(path, name, d, elf, messages):
sane = True
if has_syms and not sane:
- package_qa_add_message(messages, "ldflags", "No GNU_HASH in the elf binary: '%s'" % path)
+ package_qa_add_message(messages, "ldflags", "No GNU_HASH in the ELF binary %s, didn't pass LDFLAGS?" % path)
QAPATHTEST[buildpaths] = "package_qa_check_buildpaths"
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-03 20:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-03 20:35 [PATCH 1/3] oeqa: don't litter /tmp with temporary directories Ross Burton
2018-12-03 20:35 ` [PATCH 2/3] oeqa/selftest/esdk: run selftest inside workdir not /tmp Ross Burton
2018-12-03 20:35 ` [PATCH 3/3] insane: clarify GNU_HASH warning Ross Burton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox