Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 855077 - media-libs/portmidi-234-r1 fails to compile with: "error: lvalue required as increment operand" in pyportmidi/_pyportmidi.c
Summary: media-libs/portmidi-234-r1 fails to compile with: "error: lvalue required as ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Professional Audio Applications Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: py310, python3.10-compat
  Show dependency tree
 
Reported: 2022-06-29 10:35 UTC by Bas Weelinck
Modified: 2022-07-02 13:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info output (emerge_info.txt,6.54 KB, text/plain)
2022-06-29 10:36 UTC, Bas Weelinck
Details
Build log of portmidi-234-r1 (portmidi-build-fail.log,47.79 KB, text/plain)
2022-06-29 10:38 UTC, Bas Weelinck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bas Weelinck 2022-06-29 10:35:41 UTC
When building portmidi with GCC 11 on all Python targets building fails with the following error:

x86_64-pc-linux-gnu-gcc -O2 -pipe -fPIC -I../pm_common -I../porttime -I/usr/include/python3.10 -c pyportmidi/_pyportmidi.c -o /var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/trunk_build-python3_10/temp.linux-x86_64-3.10/pyportmidi/_pyportmidi.o
pyportmidi/_pyportmidi.c: In function ‘__pyx_tp_dealloc_11_pyportmidi_Output’:
pyportmidi/_pyportmidi.c:3455:5: error: lvalue required as increment operand
 3455 |     ++Py_REFCNT(o);
      |     ^~
pyportmidi/_pyportmidi.c:3458:5: error: lvalue required as decrement operand
 3458 |     --Py_REFCNT(o);
      |     ^~
pyportmidi/_pyportmidi.c: In function ‘__pyx_tp_dealloc_11_pyportmidi_Input’:
pyportmidi/_pyportmidi.c:3634:5: error: lvalue required as increment operand
 3634 |     ++Py_REFCNT(o);
      |     ^~

etc.

I'm compiling with GCC 11 and for all Python targets (3.8, 3.9, 3.10)

The error in question seems to occur within the 3.10 bindings specifically.

Reproducible: Always

Steps to Reproduce:
1. Try to emerge media-libs/portmidi
Actual Results:  
Build failure

Expected Results:  
Merges

N/A
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-29 10:36:32 UTC
Please include the full build.log and emerge --info.
Comment 2 Bas Weelinck 2022-06-29 10:36:52 UTC
Created attachment 788666 [details]
emerge --info output
Comment 3 Bas Weelinck 2022-06-29 10:38:00 UTC
Created attachment 788669 [details]
Build log of portmidi-234-r1
Comment 4 Bas Weelinck 2022-06-29 10:39:55 UTC
I didn't see an upload dialog in the "bug create" screen anymore, otherwise I would've added these files upon bug creation. Perhaps I just didn't look well enough.
Comment 5 Honza Macháček 2022-06-30 13:03:41 UTC
The problem is in python-3.10 compatibility.

media-libs/portmidi-234 compiles well for me, media-libs/portmidi-234-r1 fails the reported way.

The main difference is python compatibility, 3.7 to 3.9 for 234, and 3.8 to 3.11 for 234-r1. I get the lvalue problem while compiling for python-3.10:

 * python3_9: running distutils-r1_run_phase distutils-r1_python_compile
python3.9 setup.py build -j 1
Assuming Linux platform
running build
running build_py

...

x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -L/var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/trunk_build -O2 -pipe /var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/trunk_build-python3_9/temp.linux-x86_64-3.9/pyportmidi/_pyportmidi.o -L/usr/lib64 -lportmidi -lasound -lpthread -o /var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/trunk_build-python3_9/lib/pyportmidi/_pyportmidi.cpython-39-x86_64-linux-gnu.so
 * python3_10: running distutils-r1_run_phase distutils-r1_python_compile
python3.10 setup.py build -j 1
/var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/trunk/pm_python/setup.py:5: Dep
recationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or
 check PEP 632 for potential alternatives
  from distutils.core import setup, Command
Assuming Linux platform
running build
running build_py
creating /var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/trunk_build-python3_10
/lib/pyportmidi
copying pyportmidi/__init__.py -> /var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmi
di/trunk_build-python3_10/lib/pyportmidi
copying pyportmidi/midi.py -> /var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/t
runk_build-python3_10/lib/pyportmidi
package init file 'pyportmidi/tests/__init__.py' not found (or not a regular file)
package init file 'pyportmidi/tests/__init__.py' not found (or not a regular file)
warning: build_py: byte-compiling is disabled, skipping.

running build_ext
skipping 'pyportmidi/_pyportmidi.c' Cython extension (up-to-date)
building 'pyportmidi._pyportmidi' extension
creating /var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/trunk_build-python3_10
/temp.linux-x86_64-3.10
creating /var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/trunk_build-python3_10
/temp.linux-x86_64-3.10/pyportmidi
x86_64-pc-linux-gnu-gcc -O2 -pipe -fPIC -I../pm_common -I../porttime -I/usr/include/python3.10 -c pyportmidi/
_pyportmidi.c -o /var/tmp/portage/media-libs/portmidi-234-r1/work/portmedia-code-r234/portmidi/trunk_build-py
thon3_10/temp.linux-x86_64-3.10/pyportmidi/_pyportmidi.o
pyportmidi/_pyportmidi.c: In function ‘__pyx_tp_dealloc_11_pyportmidi_Output’:
pyportmidi/_pyportmidi.c:3455:5: error: lvalue required as increment operand
 3455 |     ++Py_REFCNT(o);
      |     ^~
pyportmidi/_pyportmidi.c:3458:5: error: lvalue required as decrement operand
 3458 |     --Py_REFCNT(o);
      |     ^~
pyportmidi/_pyportmidi.c: In function ‘__pyx_tp_dealloc_11_pyportmidi_Input’:
pyportmidi/_pyportmidi.c:3634:5: error: lvalue required as increment operand
 3634 |     ++Py_REFCNT(o);
      |     ^~
pyportmidi/_pyportmidi.c:3637:5: error: lvalue required as decrement operand
 3637 |     --Py_REFCNT(o);
      |     ^~

...
(a set of warnings follows, similar to those reported while compiling for python-3.9)
Comment 6 Honza Macháček 2022-06-30 15:03:02 UTC
Use media-libs/portmidi -python is likely the way to go until media-libs/portmidi ebuild gets substantially upgraded.

portmidi-234, that is portmedia-code-r234 apparently no longer exists outside Gentoo servers. It is 2 yeras old, and not available at Sourceforge anymore:
https://sourceforge.net/p/portmedia/activity/?page=0&limit=100#61d4b950a6297fef5da0d013

There is r276 at Sourceforge, without python bindings:
https://sourceforge.net/p/portmedia/code/HEAD/tree/

The last version with pm_python was r273:
https://sourceforge.net/p/portmedia/code/273/tree/

but that has the same problem with Python 3.10

portmidi developement has been moved to GitHub:
https://github.com/PortMidi/portmidi

and the portmidi part of the portmedia project at Sourceforge is updated from there. These updates, however, no longer contain python bindings.

Various language bindings and other bells and whistles have been separated to repositories of their own, and there is a call for developers for them:
https://github.com/PortMidi

This is the case of Python bindings:
https://github.com/PortMidi/pm_python

Whoever manages to update the code for Python 3.10 may likely apply to be its developer.

Portsmf and scorealign from the original portmedia package have got their own projects at GitHub:
https://github.com/rbdannenberg/portsmf
https://github.com/rbdannenberg/scorealign

(the portmidi Readme.md erroneously advertises the portsmf repository as
https://github.com/PortMidi/portsmf
which does not exist)

Proper reorganisation of the media-libs/portmidi ebuild will likely require some non-trivial work.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-01 08:09:16 UTC
Thanks for the summary. I wonder, does anyone here hitting this bug actually use the Python bindings?
Comment 8 Bernd 2022-07-01 16:42:08 UTC
I hit the bug today as well, while moving to default Python 3.10. Don't need the python bindings though, just have python set in make.conf. Only revdep which I have installed is denemo, which doesn't require the python bindings.
Comment 9 Bas Weelinck 2022-07-02 10:28:28 UTC
I installed it specifically for the Python bindings at the time, as I was doing some scripting with it. But that was many years ago, and honestly I forgot I had it installed until it broke two days ago.
Comment 10 Larry the Git Cow gentoo-dev 2022-07-02 13:00:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e175c886cb3b6f04c290f93374d6de3022ac6c4

commit 6e175c886cb3b6f04c290f93374d6de3022ac6c4
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-07-02 13:00:05 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-07-02 13:00:23 +0000

    media-libs/portmidi: drop broken Python bindings
    
    Closes: https://bugs.gentoo.org/855077
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/portmidi/portmidi-234-r2.ebuild | 120 +++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)
Comment 11 Larry the Git Cow gentoo-dev 2022-07-02 13:01:57 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aac5fb7f14a39b73a851dcb3c9a3d3b8e520d53e

commit aac5fb7f14a39b73a851dcb3c9a3d3b8e520d53e
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-07-02 13:01:47 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-07-02 13:01:47 +0000

    media-libs/portmidi: drop broken Python 3.10+
    
    Bug: https://bugs.gentoo.org/855077
    Bug: https://bugs.gentoo.org/846029
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/portmidi/portmidi-234-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)