summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Yurkov <alexander.v.yurkov@gmail.com>2025-01-23 18:47:40 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-27 15:47:09 +0000
commitcf221090ede48b71b64b371e603bf8dab00fd7cb (patch)
tree1f110d45a214670dd9f93bce308f8f3f4b9243e2
parentdc9fe7aa015c4094e416abacde343b17070a0a8f (diff)
downloadpoky-cf221090ede48b71b64b371e603bf8dab00fd7cb.tar.gz
classes: go-vendor: Change symlink creation.
Create missing directories required to create the symlink. Use relative symlinks to stay in the build directory scope (to avoid sstate issue with absolute paths). (From OE-Core rev: 6c4e3206b6537f714416688cf8c921dd21cdfc20) Signed-off-by: Alexander Yurkov <alexander.v.yurkov@gmail.com> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/go-vendor.bbclass8
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/classes/go-vendor.bbclass b/meta/classes/go-vendor.bbclass
index f3268c1125..6ec6178add 100644
--- a/meta/classes/go-vendor.bbclass
+++ b/meta/classes/go-vendor.bbclass
@@ -201,11 +201,15 @@ python do_go_vendor() {
201 for vendored_name, replaced_path in replaced_paths.items(): 201 for vendored_name, replaced_path in replaced_paths.items():
202 symlink_target = os.path.join(source_dir, *['src', go_import, replaced_path]) 202 symlink_target = os.path.join(source_dir, *['src', go_import, replaced_path])
203 symlink_name = os.path.join(vendor_dir, vendored_name) 203 symlink_name = os.path.join(vendor_dir, vendored_name)
204 relative_symlink_target = os.path.relpath(symlink_target, os.path.dirname(symlink_name))
204 bb.debug(1, "vendored name %s, symlink name %s" % (vendored_name, symlink_name)) 205 bb.debug(1, "vendored name %s, symlink name %s" % (vendored_name, symlink_name))
205 oe.path.relsymlink(symlink_target, symlink_name) 206
207 os.makedirs(os.path.dirname(symlink_name), exist_ok=True)
208 os.symlink(relative_symlink_target, symlink_name)
206 209
207 # Create a symlink to the actual directory 210 # Create a symlink to the actual directory
208 oe.path.relsymlink(vendor_dir, linkname) 211 relative_vendor_dir = os.path.relpath(vendor_dir, os.path.dirname(linkname))
212 os.symlink(relative_vendor_dir, linkname)
209} 213}
210 214
211addtask go_vendor before do_patch after do_unpack 215addtask go_vendor before do_patch after do_unpack