* [PATCH 0/1] gen-lockedsig-cache: catch os.link error
@ 2017-03-15 0:04 brian avery
2017-03-15 0:04 ` [PATCH 1/1] " brian avery
0 siblings, 1 reply; 3+ messages in thread
From: brian avery @ 2017-03-15 0:04 UTC (permalink / raw)
To: openembedded-core
If your sstate-cache directory is on a different filesystem from the one your build is on, gen-lockedsig-cache fails which causes the esdk creation to fail. This catches the hard link failure and does a copy in those cases.
-brian
The following changes since commit 6e20b31d5d17133e0fca086e12a0ad06ab5c4cc8:
wic: selftest: account for occasional newline in debugfs file names (2017-03-14 14:42:18 +0000)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib bavery/gen-sigs-linkfix
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/gen-sigs-linkfix
brian avery (1):
gen-lockedsig-cache: catch os.link error
scripts/gen-lockedsig-cache | 6 ++++++
1 file changed, 6 insertions(+)
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] gen-lockedsig-cache: catch os.link error
2017-03-15 0:04 [PATCH 0/1] gen-lockedsig-cache: catch os.link error brian avery
@ 2017-03-15 0:04 ` brian avery
2017-03-17 8:47 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: brian avery @ 2017-03-15 0:04 UTC (permalink / raw)
To: openembedded-core
We do a hard link to speed up sdk creation but if your sstate-cache is
across a file system boundary, this tries and fails. This patch catches
that error and does a copy instead.
Signed-off-by: brian avery <brian.avery@intel.com>
---
scripts/gen-lockedsig-cache | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index 49de74ed..1cfbeae 100755
--- a/scripts/gen-lockedsig-cache
+++ b/scripts/gen-lockedsig-cache
@@ -63,6 +63,12 @@ for f in files:
if (os.stat(src).st_dev == os.stat(destdir).st_dev):
print('linking')
os.link(src, dst)
+ try:
+ os.link(src, dst)
+ except Exception:
+ print('hard linking failed, copying')
+ shutil.copyfile(src, dst)
+ os.link(src, dst)
else:
print('copying')
shutil.copyfile(src, dst)
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] gen-lockedsig-cache: catch os.link error
2017-03-15 0:04 ` [PATCH 1/1] " brian avery
@ 2017-03-17 8:47 ` Richard Purdie
0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2017-03-17 8:47 UTC (permalink / raw)
To: brian avery, openembedded-core
On Tue, 2017-03-14 at 17:04 -0700, brian avery wrote:
> We do a hard link to speed up sdk creation but if your sstate-cache
> is
> across a file system boundary, this tries and fails. This patch
> catches
> that error and does a copy instead.
>
> Signed-off-by: brian avery <brian.avery@intel.com>
> ---
> scripts/gen-lockedsig-cache | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-
> cache
> index 49de74ed..1cfbeae 100755
> --- a/scripts/gen-lockedsig-cache
> +++ b/scripts/gen-lockedsig-cache
> @@ -63,6 +63,12 @@ for f in files:
> if (os.stat(src).st_dev == os.stat(destdir).st_dev):
> print('linking')
> os.link(src, dst)
> + try:
> + os.link(src, dst)
> + except Exception:
> + print('hard linking failed, copying')
> + shutil.copyfile(src, dst)
> + os.link(src, dst)
> else:
> print('copying')
> shutil.copyfile(src, dst)
Really? How many os.link() calls do we need?
Also, "Exception" without a specific exception you want to catch tends
to be a bad idea.
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-17 8:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-15 0:04 [PATCH 0/1] gen-lockedsig-cache: catch os.link error brian avery
2017-03-15 0:04 ` [PATCH 1/1] " brian avery
2017-03-17 8:47 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox