Skip to contentSkip to conversation

gen-lockedsig-cache: catch os.link error V2

PATCH In review brian avery 3 participants 4 messages Mar 17, 2017 – Mar 19, 2017

lore
Share & tools
lore
#0 lore raw

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

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.

This is a V2 because I took a copy/paste shortcut when I sent in the last one and that went as well as I should have expected. This one is sent from the machine it was tested on... My bad :(.

-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(-)

--
2.7.4

#1 lore raw

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

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)

--
2.7.4

#2 lore raw
In reply to brian avery
Quoted 8 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of brian avery
Sent: den 17 mars 2017 13:50
To: [email protected]
Subject: [OE-core] [PATCH 0/1] gen-lockedsig-cache: catch os.link error V2

Quoted 8 lines

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.

This is a V2 because I took a copy/paste shortcut when I sent in the last one and that went as well as I should have expected. This one is sent from the machine it was tested on... My bad :(.

Do not make the "V2" part of the subject, make it part of the PATCH prefix, e.g.:

[PATCH v2 0/1] gen-lockedsig-cache: catch os.link error

Otherwise it will become part of the commit message where it does not make any sense (since there obviously is no V1 committed...)

Quoted 1 line

-brian

//Peter

#3 lore raw

Thanks!
resubmitted as [PATCH V3 x/y] .
-b
an intel employee

Quoted 36 lines · Peter Kjellerstedt
Quoted 7 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of brian avery
Sent: den 17 mars 2017 13:50
To: [email protected]
Subject: [OE-core] [PATCH 0/1] gen-lockedsig-cache: catch os.link error

V2

Quoted 9 lines

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.

This is a V2 because I took a copy/paste shortcut when I sent in the last one and that went as well as I should have expected. This one is sent from the machine it was tested on... My bad :(.

Do not make the "V2" part of the subject, make it part of the PATCH prefix, e.g.:

[PATCH v2 0/1] gen-lockedsig-cache: catch os.link error

Otherwise it will become part of the commit message where it does not make any sense (since there obviously is no V1 committed...)

Quoted 1 line

-brian

//Peter

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core