]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
go-vendor.bbclass: Run vendor_unlink task under fakeroot
authorJohn Ripple <john.ripple@keysight.com>
Wed, 22 Jul 2026 20:08:29 +0000 (14:08 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 23 Jul 2026 10:27:21 +0000 (11:27 +0100)
do_install and do_package both run under fakeroot (pseudo), which keeps
pseudo's ownership/inode database in sync with what is actually on disk
under D. do_vendor_unlink runs between them but was never marked
fakeroot, so its os.unlink() of the vendor symlink happened outside of
pseudo's view: the file disappeared from disk but pseudo's database
still held a stale record for that path/inode.

The next fakeroot task to touch that path (do_package) then finds the
on-disk state and pseudo's database disagreeing, and pseudo aborts with
"path mismatch" / "inode mismatch" errors, failing do_package.

Mark do_vendor_unlink fakeroot, matching do_install and do_package, so
its filesystem operations are tracked by pseudo consistently.

Signed-off-by: John Ripple <john.ripple@keysight.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/go-vendor.bbclass

index 85a3c1b586ed5954cec96abf1216912512983145..5bb4e8e876aba30d9e680767c55e0bf8855148b6 100644 (file)
@@ -40,13 +40,14 @@ def go_src_uri(repo, version, path=None, subdir=None, \
 
     return src_uri
 
-python do_vendor_unlink() {
+fakeroot python do_vendor_unlink() {
     go_import = d.getVar('GO_IMPORT')
     linkname = os.path.join(d.getVar('D') + d.getVar('libdir'), 'go', 'src', go_import, 'vendor')
     if os.path.islink(linkname):
         os.unlink(linkname)
 }
 
+do_vendor_unlink[depends] += "virtual/fakeroot-native:do_populate_sysroot"
 addtask vendor_unlink before do_package after do_install
 
 python do_go_vendor() {