Skip to contentSkip to conversation

gen-lockedsig-cache: catch os.link error

PATCH New brian avery 1 participant 2 messages Mar 19, 2017

lore
Share & tools
lore
#0 lore raw

v3 cover gen-lockedsig-cache: catch os.link error

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.

-brian

The following changes since commit 7e0985bab68547f946163828a16beab7542fca2e:

nativesdk-packagegroup-sdk-host.bb: add cmake (2017-03-17 16:53:06 +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, 5 insertions(+), 1 deletion(-)

--
1.9.1

#1 lore raw

PATCH v3 1/1 gen-lockedsig-cache: catch os.link error

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.

---
 scripts/gen-lockedsig-cache | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
scripts/gen-lockedsig-cache +5 -1
index 49de74ed..6765891 100755
@@ -62,7 +62,11 @@ for f in files:
         os.remove(dst)
     if (os.stat(src).st_dev == os.stat(destdir).st_dev):
         print('linking')
-        os.link(src, dst)
+        try:
+            os.link(src, dst)
+        except OSError as e:
+            print('hard linking failed, copying')
+            shutil.copyfile(src, dst)
     else:
         print('copying')
         shutil.copyfile(src, dst)
Signature · 1 line
1.9.1