diff mbox series

[v2] gcc-runtime: Move gdb pretty printer file to auto-load location

Message ID 20240130162049.2019289-1-raj.khem@gmail.com
State Accepted, archived
Commit d24e16d192f21aa68b5274496efaba1d913f37c2
Headers show
Series [v2] gcc-runtime: Move gdb pretty printer file to auto-load location | expand

Commit Message

Khem Raj Jan. 30, 2024, 4:20 p.m. UTC
When debugging a C++ program on target using libcstdc++, gdb does not
find the pretty printer python support, this is because the init file is
installed into /usr/lib which is excluded from gdb's default list of
directories to load config's from, where as defaults to load from
datadir is still on, it therefore does not load this file

warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".

This leaves the libstdc++ pretty-printers disabled even though added via
IMAGE_INSTALL += "gcc-runtime-dbg"

Add missing runtime dependency on datetime python module for the pretty
printer to work/load successfully.

Once the pretty-printer gdb file is moved out of libdir, it may become
empty therefore delete it if its empty.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Fix build on mingw

 meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Richard Purdie Feb. 2, 2024, 10:58 p.m. UTC | #1
On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
> When debugging a C++ program on target using libcstdc++, gdb does not
> find the pretty printer python support, this is because the init file is
> installed into /usr/lib which is excluded from gdb's default list of
> directories to load config's from, where as defaults to load from
> datadir is still on, it therefore does not load this file
> 
> warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> 
> This leaves the libstdc++ pretty-printers disabled even though added via
> IMAGE_INSTALL += "gcc-runtime-dbg"
> 
> Add missing runtime dependency on datetime python module for the pretty
> printer to work/load successfully.
> 
> Once the pretty-printer gdb file is moved out of libdir, it may become
> empty therefore delete it if its empty.
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> v2: Fix build on mingw
> 
>  meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
> index 64b6168ba76..004deb6e41f 100644
> --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> @@ -85,6 +85,8 @@ do_install () {
>  		cd ${B}/${TARGET_SYS}/$d/
>  		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
>  	done
> +	install -d ${D}${datadir}/gdb/auto-load/${libdir}
> +	mv ${D}${libdir}/libstdc++*-gdb.py ${D}${datadir}/gdb/auto-load/${libdir}
>  	if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
>  		install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include 
>  		mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> @@ -99,6 +101,9 @@ do_install () {
>  	if [ -d ${D}${infodir} ]; then
>  		rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
>  	fi
> +	if [ -d ${D}${libdir} ]; then
> +		rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
> +	fi
>  }
>  
>  do_install:append:class-target () {
> @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
>  
>  # include python debugging scripts
>  FILES:${PN}-dbg += "\
> -    ${libdir}/libstdc++.*-gdb.py \
>      ${datadir}/gcc-${BINV}/python/libstdcxx \
> +    ${datadir}/gdb/auto-load \
>  "
> +# Needed by libstdcxx pretty printer
> +RDEPENDS:${PN}-dbg += "python3-datetime"
>  
>  FILES:libg2c = "${target_libdir}/libg2c.so.*"
>  SUMMARY:libg2c = "Companion runtime library for g77"

https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio

Missing or unbuildable dependency chain was: ['selftest-ed',
'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime', 'bash']

https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533

Cheers,

Richard
Khem Raj Feb. 3, 2024, 12:23 a.m. UTC | #2
On Fri, Feb 2, 2024 at 2:58 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
> > When debugging a C++ program on target using libcstdc++, gdb does not
> > find the pretty printer python support, this is because the init file is
> > installed into /usr/lib which is excluded from gdb's default list of
> > directories to load config's from, where as defaults to load from
> > datadir is still on, it therefore does not load this file
> >
> > warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> >
> > This leaves the libstdc++ pretty-printers disabled even though added via
> > IMAGE_INSTALL += "gcc-runtime-dbg"
> >
> > Add missing runtime dependency on datetime python module for the pretty
> > printer to work/load successfully.
> >
> > Once the pretty-printer gdb file is moved out of libdir, it may become
> > empty therefore delete it if its empty.
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> > v2: Fix build on mingw
> >
> >  meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > index 64b6168ba76..004deb6e41f 100644
> > --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > @@ -85,6 +85,8 @@ do_install () {
> >               cd ${B}/${TARGET_SYS}/$d/
> >               oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
> >       done
> > +     install -d ${D}${datadir}/gdb/auto-load/${libdir}
> > +     mv ${D}${libdir}/libstdc++*-gdb.py ${D}${datadir}/gdb/auto-load/${libdir}
> >       if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
> >               install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> >               mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > @@ -99,6 +101,9 @@ do_install () {
> >       if [ -d ${D}${infodir} ]; then
> >               rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
> >       fi
> > +     if [ -d ${D}${libdir} ]; then
> > +             rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
> > +     fi
> >  }
> >
> >  do_install:append:class-target () {
> > @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
> >
> >  # include python debugging scripts
> >  FILES:${PN}-dbg += "\
> > -    ${libdir}/libstdc++.*-gdb.py \
> >      ${datadir}/gcc-${BINV}/python/libstdcxx \
> > +    ${datadir}/gdb/auto-load \
> >  "
> > +# Needed by libstdcxx pretty printer
> > +RDEPENDS:${PN}-dbg += "python3-datetime"
> >
> >  FILES:libg2c = "${target_libdir}/libg2c.so.*"
> >  SUMMARY:libg2c = "Companion runtime library for g77"
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio
>
> Missing or unbuildable dependency chain was: ['selftest-ed',
> 'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime', 'bash']
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533

Hmm, so I wonder if using RRECOMMEND is better here. Where is bash
being pulled from ?

>
> Cheers,
>
> Richard
>
Richard Purdie Feb. 3, 2024, 7:53 a.m. UTC | #3
On Fri, 2024-02-02 at 16:23 -0800, Khem Raj wrote:
> On Fri, Feb 2, 2024 at 2:58 PM Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > 
> > On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
> > > When debugging a C++ program on target using libcstdc++, gdb does not
> > > find the pretty printer python support, this is because the init file is
> > > installed into /usr/lib which is excluded from gdb's default list of
> > > directories to load config's from, where as defaults to load from
> > > datadir is still on, it therefore does not load this file
> > > 
> > > warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> > > 
> > > This leaves the libstdc++ pretty-printers disabled even though added via
> > > IMAGE_INSTALL += "gcc-runtime-dbg"
> > > 
> > > Add missing runtime dependency on datetime python module for the pretty
> > > printer to work/load successfully.
> > > 
> > > Once the pretty-printer gdb file is moved out of libdir, it may become
> > > empty therefore delete it if its empty.
> > > 
> > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > ---
> > > v2: Fix build on mingw
> > > 
> > >  meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > index 64b6168ba76..004deb6e41f 100644
> > > --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > @@ -85,6 +85,8 @@ do_install () {
> > >               cd ${B}/${TARGET_SYS}/$d/
> > >               oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
> > >       done
> > > +     install -d ${D}${datadir}/gdb/auto-load/${libdir}
> > > +     mv ${D}${libdir}/libstdc++*-gdb.py ${D}${datadir}/gdb/auto-load/${libdir}
> > >       if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
> > >               install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > >               mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > @@ -99,6 +101,9 @@ do_install () {
> > >       if [ -d ${D}${infodir} ]; then
> > >               rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
> > >       fi
> > > +     if [ -d ${D}${libdir} ]; then
> > > +             rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
> > > +     fi
> > >  }
> > > 
> > >  do_install:append:class-target () {
> > > @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
> > > 
> > >  # include python debugging scripts
> > >  FILES:${PN}-dbg += "\
> > > -    ${libdir}/libstdc++.*-gdb.py \
> > >      ${datadir}/gcc-${BINV}/python/libstdcxx \
> > > +    ${datadir}/gdb/auto-load \
> > >  "
> > > +# Needed by libstdcxx pretty printer
> > > +RDEPENDS:${PN}-dbg += "python3-datetime"
> > > 
> > >  FILES:libg2c = "${target_libdir}/libg2c.so.*"
> > >  SUMMARY:libg2c = "Companion runtime library for g77"
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio
> > 
> > Missing or unbuildable dependency chain was: ['selftest-ed',
> > 'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime', 'bash']
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533
> 
> Hmm, so I wonder if using RRECOMMEND is better here. Where is bash
> being pulled from ?

bash appears to be a dependency of python3-datetime. I don't think a
RRECOMMEND will help unfortunately.

Cheers,

Richard
Tim Orling Feb. 4, 2024, 3:55 a.m. UTC | #4
On Fri, Feb 2, 2024 at 11:53 PM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Fri, 2024-02-02 at 16:23 -0800, Khem Raj wrote:
> > On Fri, Feb 2, 2024 at 2:58 PM Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > >
> > > On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
> > > > When debugging a C++ program on target using libcstdc++, gdb does not
> > > > find the pretty printer python support, this is because the init
> file is
> > > > installed into /usr/lib which is excluded from gdb's default list of
> > > > directories to load config's from, where as defaults to load from
> > > > datadir is still on, it therefore does not load this file
> > > >
> > > > warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading
> has been declined by your `auto-load safe-path' set to
> "$debugdir:$datadir/auto-load".
> > > >
> > > > This leaves the libstdc++ pretty-printers disabled even though added
> via
> > > > IMAGE_INSTALL += "gcc-runtime-dbg"
> > > >
> > > > Add missing runtime dependency on datetime python module for the
> pretty
> > > > printer to work/load successfully.
> > > >
> > > > Once the pretty-printer gdb file is moved out of libdir, it may
> become
> > > > empty therefore delete it if its empty.
> > > >
> > > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > ---
> > > > v2: Fix build on mingw
> > > >
> > > >  meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
> > > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc
> b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > index 64b6168ba76..004deb6e41f 100644
> > > > --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > @@ -85,6 +85,8 @@ do_install () {
> > > >               cd ${B}/${TARGET_SYS}/$d/
> > > >               oe_runmake 'DESTDIR=${D}'
> MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
> > > >       done
> > > > +     install -d ${D}${datadir}/gdb/auto-load/${libdir}
> > > > +     mv ${D}${libdir}/libstdc++*-gdb.py
> ${D}${datadir}/gdb/auto-load/${libdir}
> > > >       if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
> > > >               install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > >               mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/*
> ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > @@ -99,6 +101,9 @@ do_install () {
> > > >       if [ -d ${D}${infodir} ]; then
> > > >               rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
> > > >       fi
> > > > +     if [ -d ${D}${libdir} ]; then
> > > > +             rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
> > > > +     fi
> > > >  }
> > > >
> > > >  do_install:append:class-target () {
> > > > @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
> > > >
> > > >  # include python debugging scripts
> > > >  FILES:${PN}-dbg += "\
> > > > -    ${libdir}/libstdc++.*-gdb.py \
> > > >      ${datadir}/gcc-${BINV}/python/libstdcxx \
> > > > +    ${datadir}/gdb/auto-load \
> > > >  "
> > > > +# Needed by libstdcxx pretty printer
> > > > +RDEPENDS:${PN}-dbg += "python3-datetime"
> > > >
> > > >  FILES:libg2c = "${target_libdir}/libg2c.so.*"
> > > >  SUMMARY:libg2c = "Companion runtime library for g77"
> > >
> > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio
> > >
> > > Missing or unbuildable dependency chain was: ['selftest-ed',
> > > 'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime', 'bash']
> > >
> > > https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533
> >
> > Hmm, so I wonder if using RRECOMMEND is better here. Where is bash
> > being pulled from ?
>
> bash appears to be a dependency of python3-datetime. I don't think a
> RRECOMMEND will help unfortunately.
>

It seems to be required for tests/ (test_venv.py, test_subprocess.py and
test_zipfile/test_core.py are the obvious ones)
https://github.com/search?q=repo%3Apython%2Fcpython+%28%22bash%22+OR+%22bash+required%22%29+path%3A%2F%5ELib%5C%2Ftest%5C%2F%2F&type=code

I didn’t see any hard requirement in Lib/datetime.py nor its test cases.
But searching on a phone can lead to missing things…


> Cheers,
>
> Richard
>
>
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#194830):
> https://lists.openembedded.org/g/openembedded-core/message/194830
> Mute This Topic: https://lists.openembedded.org/mt/104056687/924729
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> ticotimo@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Richard Purdie Feb. 4, 2024, 10:28 a.m. UTC | #5
On Sat, 2024-02-03 at 19:55 -0800, Tim Orling wrote:
> 
> 
> On Fri, Feb 2, 2024 at 11:53 PM Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> > On Fri, 2024-02-02 at 16:23 -0800, Khem Raj wrote:
> > > On Fri, Feb 2, 2024 at 2:58 PM Richard Purdie
> > > <richard.purdie@linuxfoundation.org> wrote:
> > > > 
> > > > On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
> > > > > When debugging a C++ program on target using libcstdc++, gdb does not
> > > > > find the pretty printer python support, this is because the init file is
> > > > > installed into /usr/lib which is excluded from gdb's default list of
> > > > > directories to load config's from, where as defaults to load from
> > > > > datadir is still on, it therefore does not load this file
> > > > > 
> > > > > warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> > > > > 
> > > > > This leaves the libstdc++ pretty-printers disabled even though added via
> > > > > IMAGE_INSTALL += "gcc-runtime-dbg"
> > > > > 
> > > > > Add missing runtime dependency on datetime python module for the pretty
> > > > > printer to work/load successfully.
> > > > > 
> > > > > Once the pretty-printer gdb file is moved out of libdir, it may become
> > > > > empty therefore delete it if its empty.
> > > > > 
> > > > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > ---
> > > > > v2: Fix build on mingw
> > > > > 
> > > > >   meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
> > > > >   1 file changed, 8 insertions(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > index 64b6168ba76..004deb6e41f 100644
> > > > > --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > @@ -85,6 +85,8 @@ do_install () {
> > > > >                cd ${B}/${TARGET_SYS}/$d/
> > > > >                oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
> > > > >        done
> > > > > +     install -d ${D}${datadir}/gdb/auto-load/${libdir}
> > > > > +     mv ${D}${libdir}/libstdc++*-gdb.py ${D}${datadir}/gdb/auto-load/${libdir}
> > > > >        if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
> > > > >                install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > >                mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > > @@ -99,6 +101,9 @@ do_install () {
> > > > >        if [ -d ${D}${infodir} ]; then
> > > > >                rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
> > > > >        fi
> > > > > +     if [ -d ${D}${libdir} ]; then
> > > > > +             rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
> > > > > +     fi
> > > > >   }
> > > > > 
> > > > >   do_install:append:class-target () {
> > > > > @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
> > > > > 
> > > > >   # include python debugging scripts
> > > > >   FILES:${PN}-dbg += "\
> > > > > -    ${libdir}/libstdc++.*-gdb.py \
> > > > >       ${datadir}/gcc-${BINV}/python/libstdcxx \
> > > > > +    ${datadir}/gdb/auto-load \
> > > > >   "
> > > > > +# Needed by libstdcxx pretty printer
> > > > > +RDEPENDS:${PN}-dbg += "python3-datetime"
> > > > > 
> > > > >   FILES:libg2c = "${target_libdir}/libg2c.so.*"
> > > > >   SUMMARY:libg2c = "Companion runtime library for g77"
> > > > 
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio
> > > > 
> > > > Missing or unbuildable dependency chain was: ['selftest-ed',
> > > > 'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime', 'bash']
> > > > 
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533
> > > 
> > > Hmm, so I wonder if using RRECOMMEND is better here. Where is bash
> > > being pulled from ?
> > 
> > bash appears to be a dependency of python3-datetime. I don't think a
> > RRECOMMEND will help unfortunately.
> > 
> 
> 
> It seems to be required for tests/ (test_venv.py, test_subprocess.py and test_zipfile/test_core.py are the obvious ones)
> https://github.com/search?q=repo%3Apython%2Fcpython+%28%22bash%22+OR+%22bash+required%22%29+path%3A%2F%5ELib%5C%2Ftest%5C%2F%2F&type=code
> 
> I didn’t see any hard requirement in Lib/datetime.py nor its test cases. But searching on a phone can lead to missing things…

The dependency is definitely coming from the python3 tests.

It looks like whilst the python3-ptest is conditional on enabling
ptests, the python3-tests package is not, and it is that which contains
the bash dependency.

Cheers,

Richard
Tim Orling Feb. 4, 2024, 4:36 p.m. UTC | #6
On Sun, Feb 4, 2024 at 2:28 AM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Sat, 2024-02-03 at 19:55 -0800, Tim Orling wrote:
> >
> >
> > On Fri, Feb 2, 2024 at 11:53 PM Richard Purdie <
> richard.purdie@linuxfoundation.org> wrote:
> > > On Fri, 2024-02-02 at 16:23 -0800, Khem Raj wrote:
> > > > On Fri, Feb 2, 2024 at 2:58 PM Richard Purdie
> > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > >
> > > > > On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
> > > > > > When debugging a C++ program on target using libcstdc++, gdb
> does not
> > > > > > find the pretty printer python support, this is because the init
> file is
> > > > > > installed into /usr/lib which is excluded from gdb's default
> list of
> > > > > > directories to load config's from, where as defaults to load from
> > > > > > datadir is still on, it therefore does not load this file
> > > > > >
> > > > > > warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py"
> auto-loading has been declined by your `auto-load safe-path' set to
> "$debugdir:$datadir/auto-load".
> > > > > >
> > > > > > This leaves the libstdc++ pretty-printers disabled even though
> added via
> > > > > > IMAGE_INSTALL += "gcc-runtime-dbg"
> > > > > >
> > > > > > Add missing runtime dependency on datetime python module for the
> pretty
> > > > > > printer to work/load successfully.
> > > > > >
> > > > > > Once the pretty-printer gdb file is moved out of libdir, it may
> become
> > > > > > empty therefore delete it if its empty.
> > > > > >
> > > > > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > > ---
> > > > > > v2: Fix build on mingw
> > > > > >
> > > > > >   meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
> > > > > >   1 file changed, 8 insertions(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc
> b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > index 64b6168ba76..004deb6e41f 100644
> > > > > > --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > @@ -85,6 +85,8 @@ do_install () {
> > > > > >                cd ${B}/${TARGET_SYS}/$d/
> > > > > >                oe_runmake 'DESTDIR=${D}'
> MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
> > > > > >        done
> > > > > > +     install -d ${D}${datadir}/gdb/auto-load/${libdir}
> > > > > > +     mv ${D}${libdir}/libstdc++*-gdb.py
> ${D}${datadir}/gdb/auto-load/${libdir}
> > > > > >        if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include
> ]; then
> > > > > >                install -d
> ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > > >                mv
> ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/*
> ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > > > @@ -99,6 +101,9 @@ do_install () {
> > > > > >        if [ -d ${D}${infodir} ]; then
> > > > > >                rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
> > > > > >        fi
> > > > > > +     if [ -d ${D}${libdir} ]; then
> > > > > > +             rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
> > > > > > +     fi
> > > > > >   }
> > > > > >
> > > > > >   do_install:append:class-target () {
> > > > > > @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
> > > > > >
> > > > > >   # include python debugging scripts
> > > > > >   FILES:${PN}-dbg += "\
> > > > > > -    ${libdir}/libstdc++.*-gdb.py \
> > > > > >       ${datadir}/gcc-${BINV}/python/libstdcxx \
> > > > > > +    ${datadir}/gdb/auto-load \
> > > > > >   "
> > > > > > +# Needed by libstdcxx pretty printer
> > > > > > +RDEPENDS:${PN}-dbg += "python3-datetime"
> > > > > >
> > > > > >   FILES:libg2c = "${target_libdir}/libg2c.so.*"
> > > > > >   SUMMARY:libg2c = "Companion runtime library for g77"
> > > > >
> > > > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio
> > > > >
> > > > > Missing or unbuildable dependency chain was: ['selftest-ed',
> > > > > 'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime',
> 'bash']
> > > > >
> > > > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533
> > > >
> > > > Hmm, so I wonder if using RRECOMMEND is better here. Where is bash
> > > > being pulled from ?
> > >
> > > bash appears to be a dependency of python3-datetime. I don't think a
> > > RRECOMMEND will help unfortunately.
> > >
> >
> >
> > It seems to be required for tests/ (test_venv.py, test_subprocess.py and
> test_zipfile/test_core.py are the obvious ones)
> >
> https://github.com/search?q=repo%3Apython%2Fcpython+%28%22bash%22+OR+%22bash+required%22%29+path%3A%2F%5ELib%5C%2Ftest%5C%2F%2F&type=code
> >
> > I didn’t see any hard requirement in Lib/datetime.py nor its test cases.
> But searching on a phone can lead to missing things…
>
> The dependency is definitely coming from the python3 tests.
>
> It looks like whilst the python3-ptest is conditional on enabling
> ptests, the python3-tests package is not, and it is that which contains
> the bash dependency.
>
> So perhaps we should rework python3 recipe to package tests/ into -ptest?


> Cheers,
>
> Richard
>
>
Khem Raj Feb. 4, 2024, 6 p.m. UTC | #7
On Sun, Feb 4, 2024 at 8:37 AM Tim Orling <ticotimo@gmail.com> wrote:
>
>
>
> On Sun, Feb 4, 2024 at 2:28 AM Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
>>
>> On Sat, 2024-02-03 at 19:55 -0800, Tim Orling wrote:
>> >
>> >
>> > On Fri, Feb 2, 2024 at 11:53 PM Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
>> > > On Fri, 2024-02-02 at 16:23 -0800, Khem Raj wrote:
>> > > > On Fri, Feb 2, 2024 at 2:58 PM Richard Purdie
>> > > > <richard.purdie@linuxfoundation.org> wrote:
>> > > > >
>> > > > > On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
>> > > > > > When debugging a C++ program on target using libcstdc++, gdb does not
>> > > > > > find the pretty printer python support, this is because the init file is
>> > > > > > installed into /usr/lib which is excluded from gdb's default list of
>> > > > > > directories to load config's from, where as defaults to load from
>> > > > > > datadir is still on, it therefore does not load this file
>> > > > > >
>> > > > > > warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
>> > > > > >
>> > > > > > This leaves the libstdc++ pretty-printers disabled even though added via
>> > > > > > IMAGE_INSTALL += "gcc-runtime-dbg"
>> > > > > >
>> > > > > > Add missing runtime dependency on datetime python module for the pretty
>> > > > > > printer to work/load successfully.
>> > > > > >
>> > > > > > Once the pretty-printer gdb file is moved out of libdir, it may become
>> > > > > > empty therefore delete it if its empty.
>> > > > > >
>> > > > > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> > > > > > ---
>> > > > > > v2: Fix build on mingw
>> > > > > >
>> > > > > >   meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
>> > > > > >   1 file changed, 8 insertions(+), 1 deletion(-)
>> > > > > >
>> > > > > > diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
>> > > > > > index 64b6168ba76..004deb6e41f 100644
>> > > > > > --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
>> > > > > > +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
>> > > > > > @@ -85,6 +85,8 @@ do_install () {
>> > > > > >                cd ${B}/${TARGET_SYS}/$d/
>> > > > > >                oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
>> > > > > >        done
>> > > > > > +     install -d ${D}${datadir}/gdb/auto-load/${libdir}
>> > > > > > +     mv ${D}${libdir}/libstdc++*-gdb.py ${D}${datadir}/gdb/auto-load/${libdir}
>> > > > > >        if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
>> > > > > >                install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
>> > > > > >                mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
>> > > > > > @@ -99,6 +101,9 @@ do_install () {
>> > > > > >        if [ -d ${D}${infodir} ]; then
>> > > > > >                rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
>> > > > > >        fi
>> > > > > > +     if [ -d ${D}${libdir} ]; then
>> > > > > > +             rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
>> > > > > > +     fi
>> > > > > >   }
>> > > > > >
>> > > > > >   do_install:append:class-target () {
>> > > > > > @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
>> > > > > >
>> > > > > >   # include python debugging scripts
>> > > > > >   FILES:${PN}-dbg += "\
>> > > > > > -    ${libdir}/libstdc++.*-gdb.py \
>> > > > > >       ${datadir}/gcc-${BINV}/python/libstdcxx \
>> > > > > > +    ${datadir}/gdb/auto-load \
>> > > > > >   "
>> > > > > > +# Needed by libstdcxx pretty printer
>> > > > > > +RDEPENDS:${PN}-dbg += "python3-datetime"
>> > > > > >
>> > > > > >   FILES:libg2c = "${target_libdir}/libg2c.so.*"
>> > > > > >   SUMMARY:libg2c = "Companion runtime library for g77"
>> > > > >
>> > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio
>> > > > >
>> > > > > Missing or unbuildable dependency chain was: ['selftest-ed',
>> > > > > 'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime', 'bash']
>> > > > >
>> > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533
>> > > >
>> > > > Hmm, so I wonder if using RRECOMMEND is better here. Where is bash
>> > > > being pulled from ?
>> > >
>> > > bash appears to be a dependency of python3-datetime. I don't think a
>> > > RRECOMMEND will help unfortunately.
>> > >
>> >
>> >
>> > It seems to be required for tests/ (test_venv.py, test_subprocess.py and test_zipfile/test_core.py are the obvious ones)
>> > https://github.com/search?q=repo%3Apython%2Fcpython+%28%22bash%22+OR+%22bash+required%22%29+path%3A%2F%5ELib%5C%2Ftest%5C%2F%2F&type=code
>> >
>> > I didn’t see any hard requirement in Lib/datetime.py nor its test cases. But searching on a phone can lead to missing things…
>>
>> The dependency is definitely coming from the python3 tests.
>>
>> It looks like whilst the python3-ptest is conditional on enabling
>> ptests, the python3-tests package is not, and it is that which contains
>> the bash dependency.
>>
> So perhaps we should rework python3 recipe to package tests/ into -ptest?

if test package is pulling in bash and imposing it on non ptest builds
then it would be good to
fix that.

>
>>
>> Cheers,
>>
>> Richard
>>
Richard Purdie Feb. 4, 2024, 7:04 p.m. UTC | #8
On Sun, 2024-02-04 at 10:00 -0800, Khem Raj wrote:
> On Sun, Feb 4, 2024 at 8:37 AM Tim Orling <ticotimo@gmail.com> wrote:
> > 
> > 
> > 
> > On Sun, Feb 4, 2024 at 2:28 AM Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> > > 
> > > On Sat, 2024-02-03 at 19:55 -0800, Tim Orling wrote:
> > > > 
> > > > 
> > > > On Fri, Feb 2, 2024 at 11:53 PM Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> > > > > On Fri, 2024-02-02 at 16:23 -0800, Khem Raj wrote:
> > > > > > On Fri, Feb 2, 2024 at 2:58 PM Richard Purdie
> > > > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > > > > 
> > > > > > > On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
> > > > > > > > When debugging a C++ program on target using libcstdc++, gdb does not
> > > > > > > > find the pretty printer python support, this is because the init file is
> > > > > > > > installed into /usr/lib which is excluded from gdb's default list of
> > > > > > > > directories to load config's from, where as defaults to load from
> > > > > > > > datadir is still on, it therefore does not load this file
> > > > > > > > 
> > > > > > > > warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> > > > > > > > 
> > > > > > > > This leaves the libstdc++ pretty-printers disabled even though added via
> > > > > > > > IMAGE_INSTALL += "gcc-runtime-dbg"
> > > > > > > > 
> > > > > > > > Add missing runtime dependency on datetime python module for the pretty
> > > > > > > > printer to work/load successfully.
> > > > > > > > 
> > > > > > > > Once the pretty-printer gdb file is moved out of libdir, it may become
> > > > > > > > empty therefore delete it if its empty.
> > > > > > > > 
> > > > > > > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > > > > ---
> > > > > > > > v2: Fix build on mingw
> > > > > > > > 
> > > > > > > >   meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
> > > > > > > >   1 file changed, 8 insertions(+), 1 deletion(-)
> > > > > > > > 
> > > > > > > > diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > > > index 64b6168ba76..004deb6e41f 100644
> > > > > > > > --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > > > +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > > > @@ -85,6 +85,8 @@ do_install () {
> > > > > > > >                cd ${B}/${TARGET_SYS}/$d/
> > > > > > > >                oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
> > > > > > > >        done
> > > > > > > > +     install -d ${D}${datadir}/gdb/auto-load/${libdir}
> > > > > > > > +     mv ${D}${libdir}/libstdc++*-gdb.py ${D}${datadir}/gdb/auto-load/${libdir}
> > > > > > > >        if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
> > > > > > > >                install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > > > > >                mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > > > > > @@ -99,6 +101,9 @@ do_install () {
> > > > > > > >        if [ -d ${D}${infodir} ]; then
> > > > > > > >                rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
> > > > > > > >        fi
> > > > > > > > +     if [ -d ${D}${libdir} ]; then
> > > > > > > > +             rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
> > > > > > > > +     fi
> > > > > > > >   }
> > > > > > > > 
> > > > > > > >   do_install:append:class-target () {
> > > > > > > > @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
> > > > > > > > 
> > > > > > > >   # include python debugging scripts
> > > > > > > >   FILES:${PN}-dbg += "\
> > > > > > > > -    ${libdir}/libstdc++.*-gdb.py \
> > > > > > > >       ${datadir}/gcc-${BINV}/python/libstdcxx \
> > > > > > > > +    ${datadir}/gdb/auto-load \
> > > > > > > >   "
> > > > > > > > +# Needed by libstdcxx pretty printer
> > > > > > > > +RDEPENDS:${PN}-dbg += "python3-datetime"
> > > > > > > > 
> > > > > > > >   FILES:libg2c = "${target_libdir}/libg2c.so.*"
> > > > > > > >   SUMMARY:libg2c = "Companion runtime library for g77"
> > > > > > > 
> > > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio
> > > > > > > 
> > > > > > > Missing or unbuildable dependency chain was: ['selftest-ed',
> > > > > > > 'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime', 'bash']
> > > > > > > 
> > > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533
> > > > > > 
> > > > > > Hmm, so I wonder if using RRECOMMEND is better here. Where is bash
> > > > > > being pulled from ?
> > > > > 
> > > > > bash appears to be a dependency of python3-datetime. I don't think a
> > > > > RRECOMMEND will help unfortunately.
> > > > > 
> > > > 
> > > > 
> > > > It seems to be required for tests/ (test_venv.py, test_subprocess.py and test_zipfile/test_core.py are the obvious ones)
> > > > https://github.com/search?q=repo%3Apython%2Fcpython+%28%22bash%22+OR+%22bash+required%22%29+path%3A%2F%5ELib%5C%2Ftest%5C%2F%2F&type=code
> > > > 
> > > > I didn’t see any hard requirement in Lib/datetime.py nor its test cases. But searching on a phone can lead to missing things…
> > > 
> > > The dependency is definitely coming from the python3 tests.
> > > 
> > > It looks like whilst the python3-ptest is conditional on enabling
> > > ptests, the python3-tests package is not, and it is that which contains
> > > the bash dependency.
> > > 
> > So perhaps we should rework python3 recipe to package tests/ into -ptest?
> 
> if test package is pulling in bash and imposing it on non ptest builds
> then it would be good to
> fix that.

I've sent a couple of patches which create a common "no-gplv3" include
file and move configuration there which works around this.

Cheers,

Richard
Khem Raj Feb. 4, 2024, 7:06 p.m. UTC | #9
On Sun, Feb 4, 2024 at 11:04 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Sun, 2024-02-04 at 10:00 -0800, Khem Raj wrote:
> > On Sun, Feb 4, 2024 at 8:37 AM Tim Orling <ticotimo@gmail.com> wrote:
> > >
> > >
> > >
> > > On Sun, Feb 4, 2024 at 2:28 AM Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> > > >
> > > > On Sat, 2024-02-03 at 19:55 -0800, Tim Orling wrote:
> > > > >
> > > > >
> > > > > On Fri, Feb 2, 2024 at 11:53 PM Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> > > > > > On Fri, 2024-02-02 at 16:23 -0800, Khem Raj wrote:
> > > > > > > On Fri, Feb 2, 2024 at 2:58 PM Richard Purdie
> > > > > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > > > > >
> > > > > > > > On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
> > > > > > > > > When debugging a C++ program on target using libcstdc++, gdb does not
> > > > > > > > > find the pretty printer python support, this is because the init file is
> > > > > > > > > installed into /usr/lib which is excluded from gdb's default list of
> > > > > > > > > directories to load config's from, where as defaults to load from
> > > > > > > > > datadir is still on, it therefore does not load this file
> > > > > > > > >
> > > > > > > > > warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> > > > > > > > >
> > > > > > > > > This leaves the libstdc++ pretty-printers disabled even though added via
> > > > > > > > > IMAGE_INSTALL += "gcc-runtime-dbg"
> > > > > > > > >
> > > > > > > > > Add missing runtime dependency on datetime python module for the pretty
> > > > > > > > > printer to work/load successfully.
> > > > > > > > >
> > > > > > > > > Once the pretty-printer gdb file is moved out of libdir, it may become
> > > > > > > > > empty therefore delete it if its empty.
> > > > > > > > >
> > > > > > > > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > > > > > ---
> > > > > > > > > v2: Fix build on mingw
> > > > > > > > >
> > > > > > > > >   meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
> > > > > > > > >   1 file changed, 8 insertions(+), 1 deletion(-)
> > > > > > > > >
> > > > > > > > > diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > > > > index 64b6168ba76..004deb6e41f 100644
> > > > > > > > > --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > > > > +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > > > > @@ -85,6 +85,8 @@ do_install () {
> > > > > > > > >                cd ${B}/${TARGET_SYS}/$d/
> > > > > > > > >                oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
> > > > > > > > >        done
> > > > > > > > > +     install -d ${D}${datadir}/gdb/auto-load/${libdir}
> > > > > > > > > +     mv ${D}${libdir}/libstdc++*-gdb.py ${D}${datadir}/gdb/auto-load/${libdir}
> > > > > > > > >        if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
> > > > > > > > >                install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > > > > > >                mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > > > > > > @@ -99,6 +101,9 @@ do_install () {
> > > > > > > > >        if [ -d ${D}${infodir} ]; then
> > > > > > > > >                rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
> > > > > > > > >        fi
> > > > > > > > > +     if [ -d ${D}${libdir} ]; then
> > > > > > > > > +             rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
> > > > > > > > > +     fi
> > > > > > > > >   }
> > > > > > > > >
> > > > > > > > >   do_install:append:class-target () {
> > > > > > > > > @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
> > > > > > > > >
> > > > > > > > >   # include python debugging scripts
> > > > > > > > >   FILES:${PN}-dbg += "\
> > > > > > > > > -    ${libdir}/libstdc++.*-gdb.py \
> > > > > > > > >       ${datadir}/gcc-${BINV}/python/libstdcxx \
> > > > > > > > > +    ${datadir}/gdb/auto-load \
> > > > > > > > >   "
> > > > > > > > > +# Needed by libstdcxx pretty printer
> > > > > > > > > +RDEPENDS:${PN}-dbg += "python3-datetime"
> > > > > > > > >
> > > > > > > > >   FILES:libg2c = "${target_libdir}/libg2c.so.*"
> > > > > > > > >   SUMMARY:libg2c = "Companion runtime library for g77"
> > > > > > > >
> > > > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio
> > > > > > > >
> > > > > > > > Missing or unbuildable dependency chain was: ['selftest-ed',
> > > > > > > > 'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime', 'bash']
> > > > > > > >
> > > > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533
> > > > > > >
> > > > > > > Hmm, so I wonder if using RRECOMMEND is better here. Where is bash
> > > > > > > being pulled from ?
> > > > > >
> > > > > > bash appears to be a dependency of python3-datetime. I don't think a
> > > > > > RRECOMMEND will help unfortunately.
> > > > > >
> > > > >
> > > > >
> > > > > It seems to be required for tests/ (test_venv.py, test_subprocess.py and test_zipfile/test_core.py are the obvious ones)
> > > > > https://github.com/search?q=repo%3Apython%2Fcpython+%28%22bash%22+OR+%22bash+required%22%29+path%3A%2F%5ELib%5C%2Ftest%5C%2F%2F&type=code
> > > > >
> > > > > I didn’t see any hard requirement in Lib/datetime.py nor its test cases. But searching on a phone can lead to missing things…
> > > >
> > > > The dependency is definitely coming from the python3 tests.
> > > >
> > > > It looks like whilst the python3-ptest is conditional on enabling
> > > > ptests, the python3-tests package is not, and it is that which contains
> > > > the bash dependency.
> > > >
> > > So perhaps we should rework python3 recipe to package tests/ into -ptest?
> >
> > if test package is pulling in bash and imposing it on non ptest builds
> > then it would be good to
> > fix that.
>
> I've sent a couple of patches which create a common "no-gplv3" include
> file and move configuration there which works around this.
>

ah thanks Richard. So ignore v3 of this patch and take this one ( v2 ) instead.

> Cheers,
>
> Richard
Richard Purdie Feb. 4, 2024, 7:09 p.m. UTC | #10
On Sun, 2024-02-04 at 08:36 -0800, Tim Orling wrote:
> 
> 
> On Sun, Feb 4, 2024 at 2:28 AM Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> > On Sat, 2024-02-03 at 19:55 -0800, Tim Orling wrote:
> > > 
> > > 
> > > On Fri, Feb 2, 2024 at 11:53 PM Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> > > > On Fri, 2024-02-02 at 16:23 -0800, Khem Raj wrote:
> > > > > On Fri, Feb 2, 2024 at 2:58 PM Richard Purdie
> > > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > > > 
> > > > > > On Tue, 2024-01-30 at 08:20 -0800, Khem Raj wrote:
> > > > > > > When debugging a C++ program on target using libcstdc++, gdb does not
> > > > > > > find the pretty printer python support, this is because the init file is
> > > > > > > installed into /usr/lib which is excluded from gdb's default list of
> > > > > > > directories to load config's from, where as defaults to load from
> > > > > > > datadir is still on, it therefore does not load this file
> > > > > > > 
> > > > > > > warning: File "/usr/lib/libstdc++.so.6.0.33-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> > > > > > > 
> > > > > > > This leaves the libstdc++ pretty-printers disabled even though added via
> > > > > > > IMAGE_INSTALL += "gcc-runtime-dbg"
> > > > > > > 
> > > > > > > Add missing runtime dependency on datetime python module for the pretty
> > > > > > > printer to work/load successfully.
> > > > > > > 
> > > > > > > Once the pretty-printer gdb file is moved out of libdir, it may become
> > > > > > > empty therefore delete it if its empty.
> > > > > > > 
> > > > > > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > > > ---
> > > > > > > v2: Fix build on mingw
> > > > > > > 
> > > > > > >   meta/recipes-devtools/gcc/gcc-runtime.inc | 9 ++++++++-
> > > > > > >   1 file changed, 8 insertions(+), 1 deletion(-)
> > > > > > > 
> > > > > > > diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > > index 64b6168ba76..004deb6e41f 100644
> > > > > > > --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > > +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> > > > > > > @@ -85,6 +85,8 @@ do_install () {
> > > > > > >                cd ${B}/${TARGET_SYS}/$d/
> > > > > > >                oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
> > > > > > >        done
> > > > > > > +     install -d ${D}${datadir}/gdb/auto-load/${libdir}
> > > > > > > +     mv ${D}${libdir}/libstdc++*-gdb.py ${D}${datadir}/gdb/auto-load/${libdir}
> > > > > > >        if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
> > > > > > >                install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > > > >                mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
> > > > > > > @@ -99,6 +101,9 @@ do_install () {
> > > > > > >        if [ -d ${D}${infodir} ]; then
> > > > > > >                rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
> > > > > > >        fi
> > > > > > > +     if [ -d ${D}${libdir} ]; then
> > > > > > > +             rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
> > > > > > > +     fi
> > > > > > >   }
> > > > > > > 
> > > > > > >   do_install:append:class-target () {
> > > > > > > @@ -182,9 +187,11 @@ RRECOMMENDS:${PN}-dbg = ""
> > > > > > > 
> > > > > > >   # include python debugging scripts
> > > > > > >   FILES:${PN}-dbg += "\
> > > > > > > -    ${libdir}/libstdc++.*-gdb.py \
> > > > > > >       ${datadir}/gcc-${BINV}/python/libstdcxx \
> > > > > > > +    ${datadir}/gdb/auto-load \
> > > > > > >   "
> > > > > > > +# Needed by libstdcxx pretty printer
> > > > > > > +RDEPENDS:${PN}-dbg += "python3-datetime"
> > > > > > > 
> > > > > > >   FILES:libg2c = "${target_libdir}/libg2c.so.*"
> > > > > > >   SUMMARY:libg2c = "Companion runtime library for g77"
> > > > > > 
> > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6381/steps/14/logs/stdio
> > > > > > 
> > > > > > Missing or unbuildable dependency chain was: ['selftest-ed',
> > > > > > 'virtual/x86_64-poky-linux-compilerlibs', 'python3-datetime', 'bash']
> > > > > > 
> > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8533
> > > > > 
> > > > > Hmm, so I wonder if using RRECOMMEND is better here. Where is bash
> > > > > being pulled from ?
> > > > 
> > > > bash appears to be a dependency of python3-datetime. I don't think a
> > > > RRECOMMEND will help unfortunately.
> > > > 
> > > 
> > > 
> > > It seems to be required for tests/ (test_venv.py, test_subprocess.py and test_zipfile/test_core.py are the obvious ones)
> > > https://github.com/search?q=repo%3Apython%2Fcpython+%28%22bash%22+OR+%22bash+required%22%29+path%3A%2F%5ELib%5C%2Ftest%5C%2F%2F&type=code
> > > 
> > > I didn’t see any hard requirement in Lib/datetime.py nor its test cases. But searching on a phone can lead to missing things…
> > 
> > The dependency is definitely coming from the python3 tests.
> > 
> > It looks like whilst the python3-ptest is conditional on enabling
> > ptests, the python3-tests package is not, and it is that which contains
> > the bash dependency.
> > 
> > 
> 
> So perhaps we should rework python3 recipe to package tests/ into -ptest?

ptests are packaged conditionally so it all gets a bit messy.

I've worked around it in a no-gplv3 inc file for now.

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 64b6168ba76..004deb6e41f 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -85,6 +85,8 @@  do_install () {
 		cd ${B}/${TARGET_SYS}/$d/
 		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
 	done
+	install -d ${D}${datadir}/gdb/auto-load/${libdir}
+	mv ${D}${libdir}/libstdc++*-gdb.py ${D}${datadir}/gdb/auto-load/${libdir}
 	if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
 		install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include 
 		mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
@@ -99,6 +101,9 @@  do_install () {
 	if [ -d ${D}${infodir} ]; then
 		rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
 	fi
+	if [ -d ${D}${libdir} ]; then
+		rmdir --ignore-fail-on-non-empty -p ${D}${libdir}
+	fi
 }
 
 do_install:append:class-target () {
@@ -182,9 +187,11 @@  RRECOMMENDS:${PN}-dbg = ""
 
 # include python debugging scripts
 FILES:${PN}-dbg += "\
-    ${libdir}/libstdc++.*-gdb.py \
     ${datadir}/gcc-${BINV}/python/libstdcxx \
+    ${datadir}/gdb/auto-load \
 "
+# Needed by libstdcxx pretty printer
+RDEPENDS:${PN}-dbg += "python3-datetime"
 
 FILES:libg2c = "${target_libdir}/libg2c.so.*"
 SUMMARY:libg2c = "Companion runtime library for g77"