diff mbox series

go-vendor.bbclass: avoid QA errors with absolute paths

Message ID 20241206173119.12422-1-Robert.Berger@ReliableEmbeddedSystems.com
State New
Headers show
Series go-vendor.bbclass: avoid QA errors with absolute paths | expand

Commit Message

Robert Berger Dec. 6, 2024, 5:31 p.m. UTC
avoid QA errors with absolute paths from go-vendor.bbclass

Signed-off-by: Robert Berger <Robert.Berger@ReliableEmbeddedSystems.com>
---
 meta/classes/go-vendor.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Purdie Dec. 8, 2024, 10:27 p.m. UTC | #1
On Fri, 2024-12-06 at 18:31 +0100, Robert Berger via
lists.openembedded.org wrote:
> avoid QA errors with absolute paths from go-vendor.bbclass
> 
> Signed-off-by: Robert Berger
> <Robert.Berger@ReliableEmbeddedSystems.com>
> ---
>  meta/classes/go-vendor.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/go-vendor.bbclass b/meta/classes/go-
> vendor.bbclass
> index 38ea69ab50..12667b2d60 100644
> --- a/meta/classes/go-vendor.bbclass
> +++ b/meta/classes/go-vendor.bbclass
> @@ -14,7 +14,7 @@
>  # folder. Additionally a manifest file is generated for the 'vendor'
> folder
>  # 
>  
> -inherit go-mod
> +inherit go-mod relative_symlinks
>  
>  def go_src_uri(repo, version, path=None, subdir=None, \
>                  vcs='git', replaces=None, pathmajor=None):
> 

Can you provide a little more information in the commit message such as
the kind of symlink and whether go-vendor always creates these or what
the trigger is for the issue? Which tool is creating the symlinks? Was
this a change in behaviour of the tool? Could the class create relative
symlinks by default rather than fixing them up? 

That symlinks class is a heavy hammer and I'm surprised this hasn't
come up before now if it is always needed.

Thanks,

Richard
Robert Berger Dec. 8, 2024, 10:42 p.m. UTC | #2
On 12/8/24 23:27, Richard Purdie wrote:
> 
> Can you provide a little more information in the commit message such as
> the kind of symlink and whether go-vendor always creates these or what
> the trigger is for the issue? Which tool is creating the symlinks? Was
> this a change in behaviour of the tool? Could the class create relative
> symlinks by default rather than fixing them up?
> 
> That symlinks class is a heavy hammer and I'm surprised this hasn't
> come up before now if it is always needed.

Let me see if I can find some example where I came across this issue.

> 
> Thanks,
> 
> Richard

Regards,

Robert
Robert Berger Dec. 8, 2024, 10:53 p.m. UTC | #3
Hi,

On 12/8/24 23:27, Richard Purdie wrote:
> On Fri, 2024-12-06 at 18:31 +0100, Robert Berger via
> lists.openembedded.org wrote:
>> avoid QA errors with absolute paths from go-vendor.bbclass
>>
>> Signed-off-by: Robert Berger
>> <Robert.Berger@ReliableEmbeddedSystems.com>
>> ---
>>   meta/classes/go-vendor.bbclass | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/go-vendor.bbclass b/meta/classes/go-
>> vendor.bbclass
>> index 38ea69ab50..12667b2d60 100644
>> --- a/meta/classes/go-vendor.bbclass
>> +++ b/meta/classes/go-vendor.bbclass
>> @@ -14,7 +14,7 @@
>>   # folder. Additionally a manifest file is generated for the 'vendor'
>> folder
>>   #
>>   
>> -inherit go-mod
>> +inherit go-mod relative_symlinks
>>   
>>   def go_src_uri(repo, version, path=None, subdir=None, \
>>                   vcs='git', replaces=None, pathmajor=None):
>>
> 
> Can you provide a little more information in the commit message such as
> the kind of symlink and whether go-vendor always creates these or what
> the trigger is for the issue? Which tool is creating the symlinks? Was
> this a change in behaviour of the tool? Could the class create relative
> symlinks by default rather than fixing them up?
> 
> That symlinks class is a heavy hammer and I'm surprised this hasn't
> come up before now if it is always needed.

Here is the example:

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

This is the error without my patch:

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.

I added it also to:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=15683

> 
> Thanks,
> 
> Richard
diff mbox series

Patch

diff --git a/meta/classes/go-vendor.bbclass b/meta/classes/go-vendor.bbclass
index 38ea69ab50..12667b2d60 100644
--- a/meta/classes/go-vendor.bbclass
+++ b/meta/classes/go-vendor.bbclass
@@ -14,7 +14,7 @@ 
 # folder. Additionally a manifest file is generated for the 'vendor' folder
 # 
 
-inherit go-mod
+inherit go-mod relative_symlinks
 
 def go_src_uri(repo, version, path=None, subdir=None, \
                 vcs='git', replaces=None, pathmajor=None):