All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL][PATCH 0/1] devtool: Fix the wrong variable in srcuri_entry
@ 2023-06-13 12:56 Charlie Wu
  2023-06-13 12:56 ` [PATCH 1/1] " Charlie Wu
  0 siblings, 1 reply; 5+ messages in thread
From: Charlie Wu @ 2023-06-13 12:56 UTC (permalink / raw)
  To: poky; +Cc: Charlie Wu, ryanoleary

devtool crashes when running "update-recipe" and append changes on the
recipe. It seems like the wrong variable name cause this problem.

The following changes since commit a776dd26677452154384aca7469c396f1978b1c0:

  linux-yocto/6.1: update genericx86* machines to v6.1.30 (2023-06-09 13:55:38 +0100)

are available in the Git repository at:

  https://git.yoctoproject.org/poky-contrib chiachiwu/setuid-before-git-op
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=chiachiwu/setuid-before-git-op

Charlie Wu (1):
  devtool: Fix the wrong variable in srcuri_entry

 scripts/lib/devtool/standard.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.41.0.162.gfafddb0af9-goog



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] devtool: Fix the wrong variable in srcuri_entry
  2023-06-13 12:56 [PULL][PATCH 0/1] devtool: Fix the wrong variable in srcuri_entry Charlie Wu
@ 2023-06-13 12:56 ` Charlie Wu
  2023-06-13 13:30   ` [poky] " Alexander Kanavin
  2023-06-13 20:43   ` Richard Purdie
  0 siblings, 2 replies; 5+ messages in thread
From: Charlie Wu @ 2023-06-13 12:56 UTC (permalink / raw)
  To: poky; +Cc: ryanoleary, Charlie Wu

devtool crashes when running "update-recipe" and append changes on the recipe.
"$ devtool update-recipe -a <layer> <recipe>"
Traceback (most recent call last):
...
File "/ovss/ovss_quanta/poky/scripts/lib/devtool/standard.py", line 1636, in srcuri_entry
    return 'file://%s%s' % (basepath, paramstr)
                            ^^^^^^^^
NameError: cannot access free variable 'basepath' where it is not associated with a value in enclosing scope

The input variable 'fname' should have the same meaning as the variable 'basepath'.
Modify the 'fname' to 'basepath' and solve the issue.

Signed-off-by: Charlie Wu <chiachiwu@google.com>
---
 scripts/lib/devtool/standard.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 852672810a..86ca77f718 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1629,7 +1629,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
     else:
         patchdir_params = {'patchdir': relpatchdir}
 
-    def srcuri_entry(fname):
+    def srcuri_entry(basepath):
         if patchdir_params:
             paramstr = ';' + ';'.join('%s=%s' % (k,v) for k,v in patchdir_params.items())
         else:
-- 
2.41.0.162.gfafddb0af9-goog



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [poky] [PATCH 1/1] devtool: Fix the wrong variable in srcuri_entry
  2023-06-13 12:56 ` [PATCH 1/1] " Charlie Wu
@ 2023-06-13 13:30   ` Alexander Kanavin
  2023-06-13 20:43   ` Richard Purdie
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2023-06-13 13:30 UTC (permalink / raw)
  To: chiachiwu; +Cc: poky, ryanoleary

Thank you, the correct mailing list for this submission is openembedded-core.

Alex

On Tue, 13 Jun 2023 at 14:56, Charlie Wu via lists.yoctoproject.org
<chiachiwu=google.com@lists.yoctoproject.org> wrote:
>
> devtool crashes when running "update-recipe" and append changes on the recipe.
> "$ devtool update-recipe -a <layer> <recipe>"
> Traceback (most recent call last):
> ...
> File "/ovss/ovss_quanta/poky/scripts/lib/devtool/standard.py", line 1636, in srcuri_entry
>     return 'file://%s%s' % (basepath, paramstr)
>                             ^^^^^^^^
> NameError: cannot access free variable 'basepath' where it is not associated with a value in enclosing scope
>
> The input variable 'fname' should have the same meaning as the variable 'basepath'.
> Modify the 'fname' to 'basepath' and solve the issue.
>
> Signed-off-by: Charlie Wu <chiachiwu@google.com>
> ---
>  scripts/lib/devtool/standard.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
> index 852672810a..86ca77f718 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -1629,7 +1629,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
>      else:
>          patchdir_params = {'patchdir': relpatchdir}
>
> -    def srcuri_entry(fname):
> +    def srcuri_entry(basepath):
>          if patchdir_params:
>              paramstr = ';' + ';'.join('%s=%s' % (k,v) for k,v in patchdir_params.items())
>          else:
> --
> 2.41.0.162.gfafddb0af9-goog
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#13083): https://lists.yoctoproject.org/g/poky/message/13083
> Mute This Topic: https://lists.yoctoproject.org/mt/99504639/1686489
> Group Owner: poky+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [poky] [PATCH 1/1] devtool: Fix the wrong variable in srcuri_entry
  2023-06-13 12:56 ` [PATCH 1/1] " Charlie Wu
  2023-06-13 13:30   ` [poky] " Alexander Kanavin
@ 2023-06-13 20:43   ` Richard Purdie
  2023-06-16 14:00     ` Charlie Wu
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2023-06-13 20:43 UTC (permalink / raw)
  To: chiachiwu, poky; +Cc: ryanoleary

On Tue, 2023-06-13 at 12:56 +0000, Charlie Wu via
lists.yoctoproject.org wrote:
> devtool crashes when running "update-recipe" and append changes on the recipe.
> "$ devtool update-recipe -a <layer> <recipe>"
> Traceback (most recent call last):
> ...
> File "/ovss/ovss_quanta/poky/scripts/lib/devtool/standard.py", line 1636, in srcuri_entry
>     return 'file://%s%s' % (basepath, paramstr)
>                             ^^^^^^^^
> NameError: cannot access free variable 'basepath' where it is not associated with a value in enclosing scope
> 
> The input variable 'fname' should have the same meaning as the variable 'basepath'.
> Modify the 'fname' to 'basepath' and solve the issue.
> 
> Signed-off-by: Charlie Wu <chiachiwu@google.com>
> ---
>  scripts/lib/devtool/standard.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
> index 852672810a..86ca77f718 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -1629,7 +1629,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
>      else:
>          patchdir_params = {'patchdir': relpatchdir}
>  
> -    def srcuri_entry(fname):
> +    def srcuri_entry(basepath):
>          if patchdir_params:
>              paramstr = ';' + ';'.join('%s=%s' % (k,v) for k,v in patchdir_params.items())
>          else:

Thanks for the patch. As Alex mentions, this needs to go to the OE-Core
mailing list. I also wondered if we're missing a test case since the
selftests should catch issues like this?

Could you see if there is something we should add to "oe-selftest -r
devtool" to catch this issue?

Thanks,

Richard


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [poky] [PATCH 1/1] devtool: Fix the wrong variable in srcuri_entry
  2023-06-13 20:43   ` Richard Purdie
@ 2023-06-16 14:00     ` Charlie Wu
  0 siblings, 0 replies; 5+ messages in thread
From: Charlie Wu @ 2023-06-16 14:00 UTC (permalink / raw)
  To: Richard Purdie; +Cc: poky, ryanoleary

[-- Attachment #1: Type: text/plain, Size: 3045 bytes --]

Hi Richard,

I set up the environment to run "oe-selftest -r devtool" and all test cases
are passed.
I revisited our use case and checked the code again, I think this might be
related to kmeta
<https://docs.yoctoproject.org/4.0.10/kernel-dev/advanced.html?highlight=kmeta#recipe-space-metadata>
.
Since kmeta is using the folder name, thus the function
"_remove_file_entries" will not remove the .scc and .cfg files here
<https://github.com/openembedded/openembedded-core/blob/master/scripts/lib/devtool/standard.py#L1685>
and
put them into the "remaining" list.
And we call the problematic function "srcuri_entry" when the "remaining"
list is not empty.

I think we do not have recipes using kmeta inside openembedded-core, which
makes it hard to add another unit test for this.
Or we have other ways to make the "remaining" list not empty, but I do not
know how.

I will check the guide
<https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded> and
change to upload the patch to openembedded-core these days.

Thanks,
Charlie


On Wed, Jun 14, 2023 at 4:44 AM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Tue, 2023-06-13 at 12:56 +0000, Charlie Wu via
> lists.yoctoproject.org wrote:
> > devtool crashes when running "update-recipe" and append changes on the
> recipe.
> > "$ devtool update-recipe -a <layer> <recipe>"
> > Traceback (most recent call last):
> > ...
> > File "/ovss/ovss_quanta/poky/scripts/lib/devtool/standard.py", line
> 1636, in srcuri_entry
> >     return 'file://%s%s' % (basepath, paramstr)
> >                             ^^^^^^^^
> > NameError: cannot access free variable 'basepath' where it is not
> associated with a value in enclosing scope
> >
> > The input variable 'fname' should have the same meaning as the variable
> 'basepath'.
> > Modify the 'fname' to 'basepath' and solve the issue.
> >
> > Signed-off-by: Charlie Wu <chiachiwu@google.com>
> > ---
> >  scripts/lib/devtool/standard.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/lib/devtool/standard.py
> b/scripts/lib/devtool/standard.py
> > index 852672810a..86ca77f718 100644
> > --- a/scripts/lib/devtool/standard.py
> > +++ b/scripts/lib/devtool/standard.py
> > @@ -1629,7 +1629,7 @@ def _update_recipe_patch(recipename, workspace,
> srctree, rd, appendlayerdir, wil
> >      else:
> >          patchdir_params = {'patchdir': relpatchdir}
> >
> > -    def srcuri_entry(fname):
> > +    def srcuri_entry(basepath):
> >          if patchdir_params:
> >              paramstr = ';' + ';'.join('%s=%s' % (k,v) for k,v in
> patchdir_params.items())
> >          else:
>
> Thanks for the patch. As Alex mentions, this needs to go to the OE-Core
> mailing list. I also wondered if we're missing a test case since the
> selftests should catch issues like this?
>
> Could you see if there is something we should add to "oe-selftest -r
> devtool" to catch this issue?
>
> Thanks,
>
> Richard
>

[-- Attachment #2: Type: text/html, Size: 4062 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-16 14:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-13 12:56 [PULL][PATCH 0/1] devtool: Fix the wrong variable in srcuri_entry Charlie Wu
2023-06-13 12:56 ` [PATCH 1/1] " Charlie Wu
2023-06-13 13:30   ` [poky] " Alexander Kanavin
2023-06-13 20:43   ` Richard Purdie
2023-06-16 14:00     ` Charlie Wu

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.