Skip to contentSkip to conversation

devtool/standard.py: Allow recipe to disable menuconfig logic

PATCH In review Tom Hochstein 4 participants 10 messages Nov 20, 2019 – Jan 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 devtool/standard.py: Allow recipe to disable menuconfig logic

u-boot.inc supports u-boot recipes with or without menuconfig [1]. However, running devtool on a u-boot recipe that does not support menuconfig results in an error:

cp: cannot stat '/home/r60874/upstream/fsl-xwayland/tmp/work/imx8mmevk-fsl-linux/u-boot-imx/2018.03-r0/u-boot-imx-2018.03//.config': No such file or directory

The problem is the devtool logic assumes that any recipe with a do_menuconfig task will generate a .config in do_configure().

Fix the problem by removing the assumption with a flag that the recipe can control, like this:

do_configure() {
if [ menuconfig-supported ]; then
...
else
DEVTOOL_DISABLE_MENUCONFIG=true
fi
}

[1] https://github.com/openembedded/openembedded-core/commit/11278e3b2c75be80645b9841763a97dbb35daadc

---
 scripts/lib/devtool/standard.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/lib/devtool/standard.py +4 -2
index 8d9c1a3022..66bd1415c3 100644
@@ -940,8 +940,10 @@ def modify(args, config, basepath, workspace):
                         '}\n')
             if rd.getVarFlag('do_menuconfig','task'):
                 f.write('\ndo_configure_append() {\n'
-                '    cp ${B}/.config ${S}/.config.baseline\n'
-                '    ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n'
+                '        cp ${B}/.config ${S}/.config.baseline\n'
+                '        ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    fi\n'
                 '}\n')
             if initial_rev:
                 f.write('\n# initial_rev: %s\n' % initial_rev)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 u-boot.inc: Fix devtool build u-boot for u-boot without menuconfig

For u-boot recipes without menuconfig support, running devtool results in a do_configure error:

cp: cannot stat '/home/r60874/upstream/fsl-xwayland/tmp/work/imx8mmevk-fsl-linux/u-boot-imx/2018.03-r0/u-boot-imx-2018.03//.config': No such file or directory

The problem arises because u-boot.inc supports recipes with and without menuconfig.

Fix the problem by properly setting DEVTOOL_DISABLE_MENUCONFIG so that devtool can control logic that applies only for menuconfig support.

---
 meta/recipes-bsp/u-boot/u-boot.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-bsp/u-boot/u-boot.inc +2 -0
index 9a754fd09b..d241347bf7 100644
@@ -87,6 +87,8 @@ do_configure () {
         fi
         merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
         cml1_do_configure
+    else
+        DEVTOOL_DISABLE_MENUCONFIG=true
     fi
 }
 
Signature · 1 line
2.17.1
#2 lore raw
In reply to Tom Hochstein
Quoted 47 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Tom Hochstein
Sent: den 20 november 2019 20:26
To: [email protected]
Subject: [OE-core] [PATCH 1/2] devtool/standard.py: Allow recipe to disable menuconfig logic

u-boot.inc supports u-boot recipes with or without menuconfig [1]. However, running devtool on a u-boot recipe that does not support menuconfig
results in an error:

cp: cannot stat '/home/r60874/upstream/fsl-xwayland/tmp/work/imx8mmevk- fsl-linux/u-boot-imx/2018.03-r0/u-boot-imx-2018.03//.config': No such file or directory

The problem is the devtool logic assumes that any recipe with a do_menuconfig task
will generate a .config in do_configure().

Fix the problem by removing the assumption with a flag that the recipe can control,
like this:

do_configure() {
if [ menuconfig-supported ]; then
...
else
DEVTOOL_DISABLE_MENUCONFIG=true
fi
}

[1] https://github.com/openembedded/openembedded-
core/commit/11278e3b2c75be80645b9841763a97dbb35daadc

---
 scripts/lib/devtool/standard.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/lib/devtool/standard.py +0 -0
index 8d9c1a3022..66bd1415c3 100644

scripts/lib/devtool/standard.py def modify(args, config, basepath, workspace): · line 946

Quoted 9 lines
scripts/lib/devtool/standard.py +4 -2
@@ -940,8 +940,10 @@ def modify(args, config, basepath, workspace):
                         '}\n')
             if rd.getVarFlag('do_menuconfig','task'):
                 f.write('\ndo_configure_append() {\n'
-                '    cp ${B}/.config ${S}/.config.baseline\n'
-                '    ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n'
+                '        cp ${B}/.config ${S}/.config.baseline\n'
+                '        ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    fi\n'

Why do you need the extra variable? Why not just check if the .config file exists before copying it:

                '    if -e ${B}/.config; then\n'
                '        cp ${B}/.config ${S}/.config.baseline\n'
                '        ln -sfT ${B}/.config ${S}/.config.new\n'
                '    fi\n'
Quoted 5 lines
scripts/lib/devtool/standard.py +0 -1
                 '}\n')
             if initial_rev:
                 f.write('\n# initial_rev: %s\n' % initial_rev)
--

2.17.1

//Peter

#3 lore raw
Quoted 35 lines

-----Original Message-----
From: Peter Kjellerstedt <[email protected]>
Sent: Thursday, November 21, 2019 4:24 AM
To: Tom Hochstein <[email protected]>; [email protected]
Subject: RE: [OE-core] [PATCH 1/2] devtool/standard.py: Allow recipe to disable menuconfig logic

Quoted 9 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Tom Hochstein
Sent: den 20 november 2019 20:26
To: [email protected]
Subject: [OE-core] [PATCH 1/2] devtool/standard.py: Allow recipe to disable menuconfig logic

scripts/lib/devtool/standard.py def modify(args, config, basepath, workspace): · line 946

Quoted 9 lines
scripts/lib/devtool/standard.py +4 -2
@@ -940,8 +940,10 @@ def modify(args, config, basepath, workspace):
                         '}\n')
             if rd.getVarFlag('do_menuconfig','task'):
                 f.write('\ndo_configure_append() {\n'
-                '    cp ${B}/.config ${S}/.config.baseline\n'
-                '    ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n'
+                '        cp ${B}/.config ${S}/.config.baseline\n'
+                '        ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    fi\n'

Why do you need the extra variable? Why not just check if the .config file exists before copying it:

                '    if -e ${B}/.config; then\n'
                '        cp ${B}/.config ${S}/.config.baseline\n'
                '        ln -sfT ${B}/.config ${S}/.config.new\n'
                '    fi\n'
Quoted 7 lines
Quoted 5 lines
scripts/lib/devtool/standard.py +0 -1
                 '}\n')
             if initial_rev:
                 f.write('\n# initial_rev: %s\n' % initial_rev)
--

2.17.1

//Peter

I wanted to preserve the existing error handling in the case that menuconfig is supported and .config is unexpectedly missing. Having the cp fail immediately seems best.

Tom

#4 lore raw
In reply to Tom Hochstein

Hi,

Quoted 20 lines · Tom Hochstein

u-boot.inc supports u-boot recipes with or without menuconfig [1]. However, running devtool on a u-boot recipe that does not support menuconfig results in an error:

cp: cannot stat '/home/r60874/upstream/fsl-xwayland/tmp/work/imx8mmevk-fsl-linux/u-boot-imx/2018.03-r0/u-boot-imx-2018.03//.config': No such file or directory

The problem is the devtool logic assumes that any recipe with a do_menuconfig task will generate a .config in do_configure().

Fix the problem by removing the assumption with a flag that the recipe can control, like this:

do_configure() {
if [ menuconfig-supported ]; then
...
else
DEVTOOL_DISABLE_MENUCONFIG=true
fi
}

Quoted 3 lines

[1] https://github.com/openembedded/openembedded-core/commit/11278e3b2c75be80645b9841763a97dbb35daadc

I'm experiencing this issue since moving to zeus. Your fix in this series works fine for me and I would really like to see this merged in zeus.

Thanks,
Frieder

Quoted 22 lines
---
  scripts/lib/devtool/standard.py | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
scripts/lib/devtool/standard.py +4 -2
index 8d9c1a3022..66bd1415c3 100644
@@ -940,8 +940,10 @@ def modify(args, config, basepath, workspace):
                          '}\n')
              if rd.getVarFlag('do_menuconfig','task'):
                  f.write('\ndo_configure_append() {\n'
-                '    cp ${B}/.config ${S}/.config.baseline\n'
-                '    ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n'
+                '        cp ${B}/.config ${S}/.config.baseline\n'
+                '        ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    fi\n'
                  '}\n')
              if initial_rev:
                  f.write('\n# initial_rev: %s\n' % initial_rev)
#5 lore raw

I made a PR as well:

https://github.com/openembedded/openembedded-core/pull/57

Tom

Quoted 65 lines

-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Wednesday, December 4, 2019 10:44 AM
To: Tom Hochstein <[email protected]>; [email protected]
Subject: Re: [OE-core] [PATCH 1/2] devtool/standard.py: Allow recipe to disable menuconfig logic

Hi,

Quoted 5 lines · Tom Hochstein

u-boot.inc supports u-boot recipes with or without menuconfig [1]. However, running devtool on a u-boot recipe that does not support menuconfig results in an error:

cp: cannot stat '/home/r60874/upstream/fsl-xwayland/tmp/work/imx8mmevk-fsl-linux/u-boot-imx/2018.03-r0/u-boot-imx-

2018.03//.config': No such file or directory

Quoted 15 lines

The problem is the devtool logic assumes that any recipe with a do_menuconfig task will generate a .config in do_configure().

Fix the problem by removing the assumption with a flag that the recipe can control, like this:

do_configure() {
if [ menuconfig-supported ]; then
...
else
DEVTOOL_DISABLE_MENUCONFIG=true
fi
}

Quoted 1 line

[1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopenembedded%2Fopenembedded-

core%2Fcommit%2F11278e3b2c75be80645b9841763a97dbb35daadc&amp;data=02%7C01%7Ctom.hochstein%40nxp.com%7C5d668f64 d3a044abb11e08d778d92bef%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637110746452407756&amp;sdata=AHjvw91G8N7 Wuf%2BORB%2B5E7cxE5cciCpnEktIqkoFKMY%3D&amp;reserved=0

Quoted 2 lines

I'm experiencing this issue since moving to zeus. Your fix in this series works fine for me and I would really like to see this merged in zeus.

Thanks,
Frieder

Quoted 22 lines
---
  scripts/lib/devtool/standard.py | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
scripts/lib/devtool/standard.py +4 -2
index 8d9c1a3022..66bd1415c3 100644
@@ -940,8 +940,10 @@ def modify(args, config, basepath, workspace):
                          '}\n')
              if rd.getVarFlag('do_menuconfig','task'):
                  f.write('\ndo_configure_append() {\n'
-                '    cp ${B}/.config ${S}/.config.baseline\n'
-                '    ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n'
+                '        cp ${B}/.config ${S}/.config.baseline\n'
+                '        ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    fi\n'
                  '}\n')
              if initial_rev:
                  f.write('\n# initial_rev: %s\n' % initial_rev)
#6 lore raw
Quoted 5 lines · Tom Hochstein

I made a PR as well:

https://github.com/openembedded/openembedded-core/pull/57

Tom

I don't think PRs are accepted for oe-core. Your patches should be ok, if someone reviews and applies them.

Dear maintainers, could you consider to review/apply this fix for master/zeus? It fixes an annoying issue when working with devtool and u-boot.

Quoted 66 lines
Quoted 66 lines

-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Wednesday, December 4, 2019 10:44 AM
To: Tom Hochstein <[email protected]>; [email protected]
Subject: Re: [OE-core] [PATCH 1/2] devtool/standard.py: Allow recipe to disable menuconfig logic

Hi,

Quoted 5 lines · Tom Hochstein

u-boot.inc supports u-boot recipes with or without menuconfig [1]. However, running devtool on a u-boot recipe that does not support menuconfig results in an error:

cp: cannot stat '/home/r60874/upstream/fsl-xwayland/tmp/work/imx8mmevk-fsl-linux/u-boot-imx/2018.03-r0/u-boot-imx-

2018.03//.config': No such file or directory

Quoted 15 lines

The problem is the devtool logic assumes that any recipe with a do_menuconfig task will generate a .config in do_configure().

Fix the problem by removing the assumption with a flag that the recipe can control, like this:

do_configure() {
if [ menuconfig-supported ]; then
...
else
DEVTOOL_DISABLE_MENUCONFIG=true
fi
}

Quoted 1 line

[1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopenembedded%2Fopenembedded-

core%2Fcommit%2F11278e3b2c75be80645b9841763a97dbb35daadc&amp;data=02%7C01%7Ctom.hochstein%40nxp.com%7C5d668f64 d3a044abb11e08d778d92bef%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637110746452407756&amp;sdata=AHjvw91G8N7 Wuf%2BORB%2B5E7cxE5cciCpnEktIqkoFKMY%3D&amp;reserved=0

Quoted 2 lines

I'm experiencing this issue since moving to zeus. Your fix in this series works fine for me and I would really like to see this merged in zeus.

Thanks,
Frieder

Quoted 22 lines
---
   scripts/lib/devtool/standard.py | 6 ++++--
   1 file changed, 4 insertions(+), 2 deletions(-)
scripts/lib/devtool/standard.py +4 -2
index 8d9c1a3022..66bd1415c3 100644
@@ -940,8 +940,10 @@ def modify(args, config, basepath, workspace):
                           '}\n')
               if rd.getVarFlag('do_menuconfig','task'):
                   f.write('\ndo_configure_append() {\n'
-                '    cp ${B}/.config ${S}/.config.baseline\n'
-                '    ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n'
+                '        cp ${B}/.config ${S}/.config.baseline\n'
+                '        ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    fi\n'
                   '}\n')
               if initial_rev:
                   f.write('\n# initial_rev: %s\n' % initial_rev)
#7 lore raw
Quoted 5 lines · Schrempf Frieder
Quoted 4 lines · Tom Hochstein

I made a PR as well:

https://github.com/openembedded/openembedded-core/pull/57

Quoted 8 lines
Quoted 1 line

Tom

I don't think PRs are accepted for oe-core. Your patches should be ok, if someone reviews and applies them.

Dear maintainers, could you consider to review/apply this fix for master/zeus? It fixes an annoying issue when working with devtool and u-boot.

Ping again.

Can someone please at least look at these patches or give any reason why no one cares about them?

Thanks!

Quoted 67 lines
Quoted 67 lines
Quoted 67 lines

-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Wednesday, December 4, 2019 10:44 AM
To: Tom Hochstein <[email protected]>; [email protected]
Subject: Re: [OE-core] [PATCH 1/2] devtool/standard.py: Allow recipe to disable menuconfig logic

Hi,

Quoted 5 lines · Tom Hochstein

u-boot.inc supports u-boot recipes with or without menuconfig [1]. However, running devtool on a u-boot recipe that does not support menuconfig results in an error:

cp: cannot stat '/home/r60874/upstream/fsl-xwayland/tmp/work/imx8mmevk-fsl-linux/u-boot-imx/2018.03-r0/u-boot-imx-

2018.03//.config': No such file or directory

Quoted 15 lines

The problem is the devtool logic assumes that any recipe with a do_menuconfig task will generate a .config in do_configure().

Fix the problem by removing the assumption with a flag that the recipe can control, like this:

do_configure() {
if [ menuconfig-supported ]; then
...
else
DEVTOOL_DISABLE_MENUCONFIG=true
fi
}

Quoted 1 line

[1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopenembedded%2Fopenembedded-

core%2Fcommit%2F11278e3b2c75be80645b9841763a97dbb35daadc&amp;data=02%7C01%7Ctom.hochstein%40nxp.com%7C5d668f64 d3a044abb11e08d778d92bef%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637110746452407756&amp;sdata=AHjvw91G8N7 Wuf%2BORB%2B5E7cxE5cciCpnEktIqkoFKMY%3D&amp;reserved=0

Quoted 2 lines

I'm experiencing this issue since moving to zeus. Your fix in this series works fine for me and I would really like to see this merged in zeus.

Thanks,
Frieder

Quoted 22 lines
---
    scripts/lib/devtool/standard.py | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)
scripts/lib/devtool/standard.py +4 -2
index 8d9c1a3022..66bd1415c3 100644
@@ -940,8 +940,10 @@ def modify(args, config, basepath, workspace):
                            '}\n')
                if rd.getVarFlag('do_menuconfig','task'):
                    f.write('\ndo_configure_append() {\n'
-                '    cp ${B}/.config ${S}/.config.baseline\n'
-                '    ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n'
+                '        cp ${B}/.config ${S}/.config.baseline\n'
+                '        ln -sfT ${B}/.config ${S}/.config.new\n'
+                '    fi\n'
                    '}\n')
                if initial_rev:
                    f.write('\n# initial_rev: %s\n' % initial_rev)
#8 lore raw
Quoted 17 lines · Schrempf Frieder
Quoted 7 lines · Schrempf Frieder
Quoted 5 lines · Tom Hochstein

I made a PR as well:

https://github.com/openembedded/openembedded-core/pull/57

Tom

Quoted 8 lines

I don't think PRs are accepted for oe-core. Your patches should be ok,
if someone reviews and applies them.

Dear maintainers, could you consider to review/apply this fix for master/zeus? It fixes an annoying issue when working with devtool and
u-boot.

Quoted 4 lines

Ping again.

Can someone please at least look at these patches or give any reason why no one cares about them?

Sorry, the project is struggling with failing automated tests and struggling to find people able to review patches for some subject areas.

I don't know devtool very well and its hard for me to say if this is a good change or if there is some other way we should be fixing this.

Of particular concern is there is no automated testing in this area and devtool has good tests in general.

Not good answers I know, sorry :(.

I'll add this to -next for wider testing and see if I can find someone to review.

Cheers,

Richard

#9 lore raw
Quoted 27 lines · Richard Purdie
Quoted 17 lines · Schrempf Frieder
Quoted 7 lines · Schrempf Frieder
Quoted 5 lines · Tom Hochstein

I made a PR as well:

https://github.com/openembedded/openembedded-core/pull/57

Tom

Quoted 8 lines

I don't think PRs are accepted for oe-core. Your patches should be ok,
if someone reviews and applies them.

Dear maintainers, could you consider to review/apply this fix for master/zeus? It fixes an annoying issue when working with devtool and
u-boot.

Quoted 4 lines

Ping again.

Can someone please at least look at these patches or give any reason why no one cares about them?

Sorry, the project is struggling with failing automated tests and struggling to find people able to review patches for some subject areas.

Quoted 7 lines

I don't know devtool very well and its hard for me to say if this is a good change or if there is some other way we should be fixing this.

Of particular concern is there is no automated testing in this area and devtool has good tests in general.

Not good answers I know, sorry :(.

Thanks for replying and providing the background information.

Quoted 3 lines

I'll add this to -next for wider testing and see if I can find someone to review.

Ok, thanks!
I would help myself, if I had the time and knowledge to do so.

Quoted 6 lines

Cheers,

Richard