All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Ripple <john.ripple@keysight.com>
To: openembedded-core@lists.openembedded.org
Cc: John Ripple <john.ripple@keysight.com>
Subject: [meta][PATCH v3 2/2] go-vendor.bbclass: Remove vendor symlink
Date: Mon, 22 Jun 2026 17:03:30 -0600	[thread overview]
Message-ID: <20260622230331.3754496-2-john.ripple@keysight.com> (raw)
In-Reply-To: <20260622230331.3754496-1-john.ripple@keysight.com>

The go-vendor class creates a symlink at the end of do_go_vendor between
the vendor.fetch location and the vendor folder used by go to find
vendored sources. The do_vendor_unlink task originally removed the
symlink created in the S directory but only after it had already been
copied to the D directory.

The do_go_vendor and do_vendor_unlink tasks were never tied together.
This caused file not found errors on subsequent builds where the
do_vendor_unlink task was re-run without the do_go_vendor task being
re-run. Leaving the symlink in S and only deleting the symlink copied to
D fixes this issue.

Signed-off-by: John Ripple <john.ripple@keysight.com>
---
 meta/classes/go-vendor.bbclass | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/meta/classes/go-vendor.bbclass b/meta/classes/go-vendor.bbclass
index f854d14bdf..e879d629a8 100644
--- a/meta/classes/go-vendor.bbclass
+++ b/meta/classes/go-vendor.bbclass
@@ -42,10 +42,9 @@ def go_src_uri(repo, version, path=None, subdir=None, \
 
 python do_vendor_unlink() {
     go_import = d.getVar('GO_IMPORT')
-    source_dir = d.getVar('S')
-    linkname = os.path.join(source_dir, *['src', go_import, 'vendor'])
-
-    os.unlink(linkname)
+    linkname = os.path.join(d.getVar('D') + d.getVar('libdir'), 'go', 'src', go_import, 'vendor')
+    if os.path.islink(linkname):
+        os.unlink(linkname)
 }
 
 addtask vendor_unlink before do_package after do_install
@@ -209,8 +208,7 @@ python do_go_vendor() {
         os.symlink(relative_symlink_target, symlink_name)
 
     # Create a symlink to the actual directory
-    relative_vendor_dir = os.path.relpath(vendor_dir, os.path.dirname(linkname))
-    os.symlink(relative_vendor_dir, linkname)
+    oe.path.relsymlink(vendor_dir, linkname)
 }
 
 addtask go_vendor before do_patch after do_unpack


  reply	other threads:[~2026-06-22 23:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22 23:03 [meta][PATCH v3 1/2] go-vendor.bbclass: Unpack into BP for destsuffix John Ripple
2026-06-22 23:03 ` John Ripple [this message]
2026-06-26 13:55 ` [OE-core] " Ross Burton
2026-06-26 17:20   ` John Ripple

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260622230331.3754496-2-john.ripple@keysight.com \
    --to=john.ripple@keysight.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.