diff mbox series

sstate: Fail on file systems without hard link support

Message ID 20260417200709.96501-1-michael@rndt.dev
State Accepted, archived
Commit 1179c2f419e0c06ea601d0b9ef1591ee990766bf
Headers show
Series sstate: Fail on file systems without hard link support | expand

Commit Message

Michael Arndt April 17, 2026, 8:07 p.m. UTC
The sstate can only work reliably when the file system has support for hard
links. Previously this error was silenced, now the build fails and the user is
informed about the problem.

Signed-off-by: Michael Arndt <michael@rndt.dev>
CC: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes-global/sstate.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index 88449d19c7..1d41d9bc20 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -787,6 +787,7 @@  sstate_task_postfunc[dirs] = "${WORKDIR}"
 # and renamed in place once created.
 python sstate_create_and_sign_package () {
     from pathlib import Path
+    import errno
 
     # Best effort touch
     def touch(file):
@@ -806,6 +807,9 @@  python sstate_create_and_sign_package () {
             else:
                 os.link(src, dst)
             return True
+        except OSError as e:
+            if e.errno == errno.ENOSYS:
+                bb.fatal("sstate is only supported on file systems with hard link support: %s" % e)
         except:
             pass