public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/29308] New: [gdb/build] python 3.10 problems
@ 2022-06-30 17:01 vries at gcc dot gnu.org
  2022-06-30 17:48 ` [Bug build/29308] " simark at simark dot ca
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2022-06-30 17:01 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

            Bug ID: 29308
           Summary: [gdb/build] python 3.10 problems
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On openSUSE tumbleweed I build with --with-python=python3, and python3 has
recently been bumped to:
...
$ /usr/bin/python3 --version
Python 3.10.5
...

Consequently, I run into build failures, due to (reproducing outside build):
...
$ python3.10 ./gdb/python/python-config.py --includes
./gdb/python/python-config.py:7: DeprecationWarning: The distutils package is
deprecated and slated for removal in Python 3.12. Use setuptools or check PEP
632 for potential alternatives
  from distutils import sysconfig
/data/vries/gdb_versions/devel/binutils-gdb.git/./gdb/python/python-config.py:7:
DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig
instead
  from distutils import sysconfig
-I/usr/include/python3.10 -I/usr/include/python3.10
...

The message suggests using module sysconfig, but there's no suppport for
get_python_inc in there.

The PEP also doesn't list a solution.

Also setuptools is mentioned, but that doesn't seem to provide a get_python_inc
replacement either.

Looking in python3-config, it's no longer a python script, but a shell script,
so we can't find an example there either.

For now working around it by using --with-python=/usr/bin/python3.8.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.10 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
@ 2022-06-30 17:48 ` simark at simark dot ca
  2022-07-01  9:27 ` vries at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: simark at simark dot ca @ 2022-06-30 17:48 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
Why do we ship our own python-config.py?  We could maybe rely on the
python-config scripts shipped with Python installations.  I guess that
python-config scripts were maybe not always there in the past?

We would append `-config` to the python executable.  Since you passed
--with-python=python3, it means python3 is in your PATH, so python3-config
should also exist in your PATH.

My guess is that since python-config scripts are now shell scripts, they can be
executed on the build machine even cross-compiling.  So maybe it would simplify
the case described here:

https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport

Not sure.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.10 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
  2022-06-30 17:48 ` [Bug build/29308] " simark at simark dot ca
@ 2022-07-01  9:27 ` vries at gcc dot gnu.org
  2022-07-01  9:28 ` vries at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-01  9:27 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Simon Marchi from comment #1)
> Why do we ship our own python-config.py? 

Here ( https://sourceware.org/pipermail/gdb-patches/2010-May/074836.html ) is
mentioned:
...
python-config is a python script so it won't work when build != host.
...

> We could maybe rely on the
> python-config scripts shipped with Python installations. 

I'll give that a try.

> I guess that
> python-config scripts were maybe not always there in the past?
> 

AFAICT, the python-config shell script was introduced starting 3.4.

>From looking at the cpython.git sources, the python-config python script
appeared in 2.7, but looking at the original commit of
gdb/python/python-config.py is mentions a copy from 2.6.5, so perhaps I'm
missing something.

> We would append `-config` to the python executable.  Since you passed
> --with-python=python3, it means python3 is in your PATH, so python3-config
> should also exist in your PATH.
> 

FWIW, I need to install python3-devel to get python3-config, in addition to the
python3 package, but that's not a problem of course.  I need to install lots of
-devel packages to be able to build gdb.

> My guess is that since python-config scripts are now shell scripts, they can
> be executed on the build machine even cross-compiling.  So maybe it would
> simplify the case described here:
> 
> https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport
> 
> Not sure.

AFAICT, that was exactly the purpose of moving to a shell script.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.10 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
  2022-06-30 17:48 ` [Bug build/29308] " simark at simark dot ca
  2022-07-01  9:27 ` vries at gcc dot gnu.org
@ 2022-07-01  9:28 ` vries at gcc dot gnu.org
  2022-07-01  9:35 ` vries at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-01  9:28 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #2)
> > My guess is that since python-config scripts are now shell scripts, they can
> > be executed on the build machine even cross-compiling.  So maybe it would
> > simplify the case described here:
> > 
> > https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport
> > 
> > Not sure.
> 
> AFAICT, that was exactly the purpose of moving to a shell script.

See https://bugs.python.org/issue16235 .

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.10 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-07-01  9:28 ` vries at gcc dot gnu.org
@ 2022-07-01  9:35 ` vries at gcc dot gnu.org
  2022-07-01  9:53 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-01  9:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 14189
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14189&action=edit
Demonstrator patch

This (configure-only, leaving configure.ac alone for now) patch fixes the build
for me.

I guess this will break pre 3.4 python setup.

So perhaps, it's an idea to first try python's python-config, and if that
doesn't work, fall back on gdb's.

Also note the added --embed, which is required starting 3.8, but unsupported
before, we'll probably have to do trial and error there as well.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.10 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-07-01  9:35 ` vries at gcc dot gnu.org
@ 2022-07-01  9:53 ` vries at gcc dot gnu.org
  2022-07-01 15:14 ` kevinb at redhat dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-01  9:53 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kevinb at redhat dot com

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Kevin, I saw you submit a patch for python 3.11 support (
https://sourceware.org/pipermail/gdb-patches/2022-June/190460.html ).

Did you also run into this build issue?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.10 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-07-01  9:53 ` vries at gcc dot gnu.org
@ 2022-07-01 15:14 ` kevinb at redhat dot com
  2022-07-01 15:18 ` simark at simark dot ca
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kevinb at redhat dot com @ 2022-07-01 15:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

--- Comment #6 from Kevin Buettner <kevinb at redhat dot com> ---
(In reply to Tom de Vries from comment #5)
> Kevin, I saw you submit a patch for python 3.11 support (
> https://sourceware.org/pipermail/gdb-patches/2022-June/190460.html ).
> 
> Did you also run into this build issue?

I haven't yet seen the build issues that you mention here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.10 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-07-01 15:14 ` kevinb at redhat dot com
@ 2022-07-01 15:18 ` simark at simark dot ca
  2022-07-02  9:17 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: simark at simark dot ca @ 2022-07-01 15:18 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

--- Comment #7 from Simon Marchi <simark at simark dot ca> ---
> FWIW, I need to install python3-devel to get python3-config, in addition to the python3 package, but that's not a problem of course.  I need to install lots of -devel packages to be able to build gdb.

I would expect that you need python3-devel anyway, since that's probably what
provides Python.h?

> I guess this will break pre 3.4 python setup.
>
> So perhaps, it's an idea to first try python's python-config, and if that doesn't work, fall back on gdb's.

I don't think it's a big deal to break pre-Python 3.4.  We currently support
Python pre-3.4, just because there wasn't a specific reason not to.  It didn't
require significantly more work to do so.  This could be a good reason to start
requiring Python >= 3.4, if doing so makes things significantly simpler.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.10 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-07-01 15:18 ` simark at simark dot ca
@ 2022-07-02  9:17 ` vries at gcc dot gnu.org
  2022-07-02  9:43 ` [Bug build/29308] [gdb/build] python 3.12 problems vries at gcc dot gnu.org
  2022-09-01  9:09 ` vries at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-02  9:17 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Simon Marchi from comment #7)
> > FWIW, I need to install python3-devel to get python3-config, in addition to the python3 package, but that's not a problem of course.  I need to install lots of -devel packages to be able to build gdb.
> 
> I would expect that you need python3-devel anyway, since that's probably
> what provides Python.h?
> 

True.

> > I guess this will break pre 3.4 python setup.
> >
> > So perhaps, it's an idea to first try python's python-config, and if that doesn't work, fall back on gdb's.
> 
> I don't think it's a big deal to break pre-Python 3.4.  We currently support
> Python pre-3.4, just because there wasn't a specific reason not to.  It
> didn't require significantly more work to do so.  This could be a good
> reason to start requiring Python >= 3.4, if doing so makes things
> significantly simpler.

Crossref https://sourceware.org/pipermail/gdb-patches/2022-January/184908.html
.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.12 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2022-07-02  9:17 ` vries at gcc dot gnu.org
@ 2022-07-02  9:43 ` vries at gcc dot gnu.org
  2022-09-01  9:09 ` vries at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-02  9:43 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[gdb/build] python 3.10     |[gdb/build] python 3.12
                   |problems                    |problems

--- Comment #9 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Kevin Buettner from comment #6)
> (In reply to Tom de Vries from comment #5)
> > Kevin, I saw you submit a patch for python 3.11 support (
> > https://sourceware.org/pipermail/gdb-patches/2022-June/190460.html ).
> > 
> > Did you also run into this build issue?
> 
> I haven't yet seen the build issues that you mention here.

I've now tried with 3.11, and seen the same deprecation warning, but indeed not
this build problem.

After trying again with 3.10, still the same deprecation warning, but now this
build also succeeds.  Hmm...

Anyway, this is going to hit us with python 3.12, updating $subject.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/29308] [gdb/build] python 3.12 problems
  2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2022-07-02  9:43 ` [Bug build/29308] [gdb/build] python 3.12 problems vries at gcc dot gnu.org
@ 2022-09-01  9:09 ` vries at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-01  9:09 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29308

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 CC|                            |lsix at lancelotsix dot com
   Target Milestone|---                         |13.1

--- Comment #10 from Tom de Vries <vries at gcc dot gnu.org> ---
Looks like this was fixed in
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=be2057b902e834bba6fe7d3ded16177ec5624f3b
.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-09-01  9:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30 17:01 [Bug build/29308] New: [gdb/build] python 3.10 problems vries at gcc dot gnu.org
2022-06-30 17:48 ` [Bug build/29308] " simark at simark dot ca
2022-07-01  9:27 ` vries at gcc dot gnu.org
2022-07-01  9:28 ` vries at gcc dot gnu.org
2022-07-01  9:35 ` vries at gcc dot gnu.org
2022-07-01  9:53 ` vries at gcc dot gnu.org
2022-07-01 15:14 ` kevinb at redhat dot com
2022-07-01 15:18 ` simark at simark dot ca
2022-07-02  9:17 ` vries at gcc dot gnu.org
2022-07-02  9:43 ` [Bug build/29308] [gdb/build] python 3.12 problems vries at gcc dot gnu.org
2022-09-01  9:09 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).