Bug 15683 - go-vendor.bbclass: avoid QA errors with absolute paths
Summary: go-vendor.bbclass: avoid QA errors with absolute paths
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 5.3
Hardware: All Multiple
: Medium minor
Target Milestone: 5.2
Assignee: Thomas Vandenabeele
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-12-06 17:26 UTC by Robert Berger
Modified: 2026-03-12 15:16 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Berger 2024-12-06 17:26:46 UTC

    
Comment 3 Robert Berger 2024-12-08 22:52:55 UTC
Example which fails without my patch:

https://gitlab.com/meta-layers/meta-yocto-training/-/tree/master/recipes-training/golang-helloworld?ref_type=heads

Error:

ERROR: github.com-robertberger-golangexample-1.0+git-r0 do_populate_sysroot: sstate found an absolute path symlink /workdir/build/multi-v7-ml-debug-training-master/tmp/work/armv7at2hf-neon-resy-linux-gnueabi/github.com-robertberger-golangexample/1.0+git/sysroot-destdir/usr/lib/go/src/github.com/robertberger/golangexample/vendor pointing at /workdir/build/multi-v7-ml-debug-training-master/tmp/work/armv7at2hf-neon-resy-linux-gnueabi/github.com-robertberger-golangexample/1.0+git/git/src/import/vendor. Please replace this with a relative link.
Comment 4 Randy MacLeod 2024-12-12 15:36:34 UTC
Ricahard says that it's better to avoid creating the incorrect symlinks rather than creating them and then fixing them afterwards.
Comment 5 Robert Berger 2024-12-12 20:07:05 UTC
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15683#c3 should explain it, plus my test case.

Please note, that except for the selftests I seem to be the only one using this class in my example:

$ grep --include \*.bb --include \*.inc --include \*.bbclass -r go-vendor .

./meta-yocto-training/recipes-training/golang-helloworld/github.com-robertberger-golangexample_git.bb:inherit go-vendor

Besides, I am not sure how the selftest does not show this issue. Maybe the test case needs to be improved?

"It's better to avoid creating the incorrect symlinks rather than creating them and then fixing them afterwards"

Yes sure. The question is who creates them? ;)
Comment 6 Richard Purdie 2025-01-07 22:23:26 UTC
I've sent a patch to the list which changes go-vendor to create relative symlinks in the first place.
Comment 7 Robert Berger 2025-01-15 14:19:48 UTC
Just for completeness, here is the patch:

https://git.yoctoproject.org/poky/commit/meta/classes/go-vendor.bbclass?id=c323d56244644964d68e012e688b3339492e50c4
Comment 9 Thomas Vandenabeele 2026-02-07 20:10:09 UTC
Is this patch planned to be applied to the scarthgap branch as well?

I ran into the same issue after creating a basic Go recipe using 'recipetool create'. I was about to file a bug for this problem, but I noticed that an existing report already addresses it and that it has been fixed upstream.
Comment 10 Randy MacLeod 2026-02-09 19:20:02 UTC
Hi Thomas,

If you think this makes sense as a backport, will you 
please test it and send an email:

https://docs.yoctoproject.org/contributor-guide/submit-changes.html#submitting-changes-to-stable-release-branches

If so, please change the status of this defect. Thanks.

CC-ing Yoann who maintains the stable branches.
Comment 11 Thomas Vandenabeele 2026-02-14 16:13:05 UTC
Hello Randy,

I have submitted the patch after test and validation:
https://patchwork.yoctoproject.org/project/oe-core/patch/20260214160806.3043158-1-thomas@bootzero.one/