Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 955499 - dev-libs/json-parser-1.1.0_p20211208: error: ‘PyInt_FromLong’ was not declared in this scope
Summary: dev-libs/json-parser-1.1.0_p20211208: error: ‘PyInt_FromLong’ was not declare...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Petr Vaněk
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 954128
  Show dependency tree
 
Reported: 2025-05-06 08:48 UTC by vowstar
Modified: 2025-05-08 11:41 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,8.14 KB, text/x-log)
2025-05-06 08:50 UTC, vowstar
Details
emerge --info (emerge.info,22.57 KB, text/plain)
2025-05-06 08:53 UTC, vowstar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vowstar 2025-05-06 08:48:42 UTC
Build failed with python 3.12 and python 3.13

Reproducible: Always

Steps to Reproduce:
1. enable python targets python3_12 and python3_13

*/* PYTHON_TARGETS: python3_12
2. sudo emerge -1v =dev-libs/json-parser-1.1.0_p20211208
3. build failed
Actual Results:  
Key output:

2025-05-06 16:41:36,074 root INFO x86_64-pc-linux-gnu-g++ -march=znver4 -mtune=znver4 -O2 -pipe -DNDEBUG -fPIC -I/usr/include/python3.12 -c ./jsonparser.cpp -o /var/tmp/portage/dev-libs/json-parser-1.1.0_p20211208/work/json-parser-531a49062975d6d2cd5d69b75ad5481a8c0e18c5-python3_12/build0/temp.linux-x86_64-cpython-312/jsonparser.o
In file included from ./jsonparser.cpp:1141:
./wrap_json.c: In function ‘PyObject* convert_value(json_value*)’:
./wrap_json.c:61:21: error: ‘PyInt_FromLong’ was not declared in this scope; did you mean ‘PyLong_FromLong’?
   61 |             value = PyInt_FromLong(data->u.integer);
      |                     ^~~~~~~~~~~~~~
      |                     PyLong_FromLong
error: command '/usr/bin/x86_64-pc-linux-gnu-g++' failed with exit code 1
 * ERROR: dev-libs/json-parser-1.1.0_p20211208::gentoo failed (compile phase):
 *   Wheel build failed

Expected Results:  
Build success
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-06 08:50:08 UTC
Please always include the full build.log and emerge --info.
Comment 2 vowstar 2025-05-06 08:50:12 UTC
Created attachment 927831 [details]
build.log
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-06 08:50:25 UTC
commit 51a6ba6c18e4cd0cbb928bf4a1d5ad6704e600a5
Author: Petr Vaněk <arkamar@gentoo.org>
Date:   Wed May 22 10:44:28 2024 +0200

    dev-libs/json-parser: enable py3.13

    Signed-off-by: Petr Vaněk <arkamar@gentoo.org>
Comment 4 vowstar 2025-05-06 08:53:48 UTC
Created attachment 927832 [details]
emerge --info
Comment 5 vowstar 2025-05-06 09:05:28 UTC
I have sent a pull request to fix this bug.
Comment 6 Petr Vaněk gentoo-dev 2025-05-06 09:16:48 UTC
It is not py3.13 only, some change triggered this in all supported python versions. It is funny, I noticed this bug today morning as well :)

@vowstart: I will look to your PR soon, thanks!
Comment 7 Petr Vaněk gentoo-dev 2025-05-06 10:06:34 UTC
This issue was introduced in commit 85b95309d93c ("dev-python/lxml: Fix building with cython-3.1*") which makes cython-3.1.0_rc1 available in my system. I think cython is to blame here.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-06 10:09:48 UTC
Ah, I'm sorry then - I went off memory and thought it got removed in py3.13.
Comment 9 Petr Vaněk gentoo-dev 2025-05-06 12:26:27 UTC
For completeness, it was this change https://github.com/cython/cython/commit/9af421163cb8081414be347038dee7a82b29e8dd
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2025-05-06 14:25:10 UTC
(In reply to Petr Vaněk from comment #7)
> This issue was introduced in commit 85b95309d93c ("dev-python/lxml: Fix
> building with cython-3.1*") which makes cython-3.1.0_rc1 available in my
> system. I think cython is to blame here.

No.  The package is to blame for relying on Cython providing these functions that were never part of the public API.
Comment 11 Larry the Git Cow gentoo-dev 2025-05-08 11:41:32 UTC
The bug has been closed via the following commit(s):

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

commit fb89b4e2acc3c63b7b118c168dd5d779b60f7a72
Author:     Huang Rui <vowstar@gmail.com>
AuthorDate: 2025-05-06 09:00:00 +0000
Commit:     Petr Vaněk <arkamar@gentoo.org>
CommitDate: 2025-05-08 11:40:38 +0000

    dev-libs/json-parser: fix bug 954840 and 955499
    
    Closes: https://bugs.gentoo.org/954840
    Closes: https://bugs.gentoo.org/955499
    Signed-off-by: Huang Rui <vowstar@gmail.com>
    Upstream-PR: https://github.com/json-parser/json-parser/pull/182
    Closes: https://github.com/gentoo/gentoo/pull/41956
    Signed-off-by: Petr Vaněk <arkamar@gentoo.org>

 .../json-parser-1.1.0-fix-suspicious-version.patch | 31 +++++++++++++++++
 .../files/json-parser-1.1.0-python3-pylong.patch   | 40 ++++++++++++++++++++++
 .../json-parser/json-parser-1.1.0_p20211208.ebuild | 10 ++++--
 3 files changed, 78 insertions(+), 3 deletions(-)