Skip to content

Depreciation warnings in pyhelper.c #53

@rcmlz

Description

@rcmlz

python: Python 3.12.12 on NixOS

When installing via

zef install --debug "Inline::Python:ver<0.5>:auth<cpan:NINE>"

I get the follwoing depreciation warnings

[Inline::Python] Building with plugin: Zef::Service::Shell::DistributionBuilder
[Inline::Python] Command: /nix/store/vcp12dhqxp1sl51qj40qbzbxff1av68v-rakudo-2025.04/bin/rakudo -e exit((require ::(q|Distribution::Builder::MakeFromJSON|)).new(:meta(Distribution::Path.new("/tmp/nix-shell-25255-0/zef-distribution-builder/2026-01-28/1769601934-25346-8".IO).meta.hash)).build(q|/tmp/nix-shell-25255-0/.zef.1769601910.25346/Inline%3A%3APython%3Aver%3C0.5%3E%3Aauth%3Ccpan%3ANINE%3E.tar.gz/Inline-Python-0.5|)??0!!1)
[Inline::Python] gcc pyhelper.c -I/nix/store/jd20rkmqmkfkcvk2wl2lmzz7acq4svlr-python3-3.12.12/include/python3.12 -I/nix/store/jd20rkmqmkfkcvk2wl2lmzz7acq4svlr-python3-3.12.12/include/python3.12  -fno-strict-overflow -Wsign-compare -I/nix/store/cvd68krxqrwgrsigszs0al2i8dnvlwk4-libxcrypt-4.4.38/include -DNDEBUG -g -O3 -Wall  -L/nix/store/jd20rkmqmkfkcvk2wl2lmzz7acq4svlr-python3-3.12.12/lib -lpython3.12 -ldl -L/nix/store/cvd68krxqrwgrsigszs0al2i8dnvlwk4-libxcrypt-4.4.38/lib -lm  -shared -fPIC -o resources/libraries/libpyhelper.so
[Inline::Python] pyhelper.c: In function 'py_init_python':
[Inline::Python] pyhelper.c:19:5: warning: 'Py_SetProgramName' is deprecated [-Wdeprecated-declarations]
[Inline::Python]    19 |     Py_SetProgramName(L"python");
[Inline::Python]       |     ^~~~~~~~~~~~~~~~~
[Inline::Python] In file included from /nix/store/jd20rkmqmkfkcvk2wl2lmzz7acq4svlr-python3-3.12.12/include/python3.12/Python.h:94,
[Inline::Python]                  from pyhelper.c:1:
[Inline::Python] /nix/store/jd20rkmqmkfkcvk2wl2lmzz7acq4svlr-python3-3.12.12/include/python3.12/pylifecycle.h:37:38: note: declared here
[Inline::Python]    37 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
[Inline::Python]       |                                      ^~~~~~~~~~~~~~~~~
[Inline::Python] pyhelper.c:23:5: warning: 'PySys_SetArgv' is deprecated [-Wdeprecated-declarations]
[Inline::Python]    23 |     PySys_SetArgv(_python_argc, _python_argv);  /* Tk needs this */
[Inline::Python]       |     ^~~~~~~~~~~~~
[Inline::Python] In file included from /nix/store/jd20rkmqmkfkcvk2wl2lmzz7acq4svlr-python3-3.12.12/include/python3.12/Python.h:96:
[Inline::Python] /nix/store/jd20rkmqmkfkcvk2wl2lmzz7acq4svlr-python3-3.12.12/include/python3.12/sysmodule.h:13:38: note: declared here
[Inline::Python]    13 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
[Inline::Python]       |                                      ^~~~~~~~~~~~~
[Inline::Python] pyhelper.c: In function 'py_string_as_string':
[Inline::Python] pyhelper.c:146:12: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
[Inline::Python]   146 |     return PyUnicode_AsUTF8(obj);
[Inline::Python]       |            ^~~~~~~~~~~~~~~~~~~~~
[Inline::Python] pyhelper.c: In function 'py_raise_missing_method':
[Inline::Python] pyhelper.c:262:30: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
[Inline::Python]   262 |         char *c_class_name = PyUnicode_AsUTF8(class_name);
[Inline::Python]       |                              ^~~~~~~~~~~~~~~~
[Inline::Python] pyhelper.c: In function 'perl6_invoke':
[Inline::Python] pyhelper.c:362:18: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
[Inline::Python]   362 |     char * buf = PyUnicode_AsUTF8AndSize(name, &length);
[Inline::Python]       |                  ^~~~~~~~~~~~~~~~~~~~~~~
[Inline::Python] pyhelper.c: In function 'py_call_method':
[Inline::Python] pyhelper.c:323:12: warning: 'py_retval' may be used uninitialized [-Wmaybe-uninitialized]
[Inline::Python]   323 |     return py_retval;
[Inline::Python]       |            ^~~~~~~~~
[Inline::Python] pyhelper.c:317:15: note: 'py_retval' was declared here
[Inline::Python]   317 |     PyObject *py_retval = PyObject_CallObject(method, args);
[Inline::Python]       |               ^~~~~~~~~

I did try it step by step

git clone https://github.com/niner/Inline-Python
cd Inline-Python
raku configure.pl
zef test . --debug

and then get, besides the depreication warnings, the follwing error

===> Testing: Inline::Python:ver<0.5>:auth<cpan:NINE>
[Inline::Python] Testing with plugin: Zef::Service::TAP
[Inline::Python] 1..13
[Inline::Python] t/call.t ................ All 13 subtests passed 
[Inline::Python] 1..302
[Inline::Python] t/call_back.t ........... All 302 subtests passed 
[Inline::Python] 1..3
[Inline::Python] t/callables.t ........... All 3 subtests passed 
[Inline::Python] 1..3
[Inline::Python] t/date.t ................ All 3 subtests passed 
[Inline::Python] 1..2
[Inline::Python] t/eval.t ................ All 2 subtests passed 
[Inline::Python] 1..2
[Inline::Python] # Subtest: Direct run values
[Inline::Python] t/eval_return_values.t .. All 2 subtests passed 
[Inline::Python] t/exceptions.t .......... No subtests run
[Inline::Python] t/import.t .............. No subtests run
[Inline::Python] 1..8
[Inline::Python] t/inherit.t ............. All 8 subtests passed 
[Inline::Python] t/invoke.t .............. No subtests run
[Inline::Python] t/matplotlib.t .......... No subtests run
[Inline::Python] 1..12
[Inline::Python] t/p6_to_py.t ............ All 12 subtests passed 
[Inline::Python] t/py_to_p6.t ............ No subtests run
[Inline::Python] 
[Inline::Python] Test Summary Report
[Inline::Python] -------------------
[Inline::Python] t/call.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: Bad plan.  You planned 13 tests but ran 0.
[Inline::Python] t/call_back.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: Bad plan.  You planned 302 tests but ran 0.
[Inline::Python] t/callables.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: Bad plan.  You planned 3 tests but ran 0.
[Inline::Python] t/date.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: Bad plan.  You planned 3 tests but ran 0.
[Inline::Python] t/eval.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: Bad plan.  You planned 2 tests but ran 0.
[Inline::Python] t/eval_return_values.t (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: Bad plan.  You planned 2 tests but ran 0.
[Inline::Python] t/exceptions.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: No plan found in TAP output
[Inline::Python] t/import.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: No plan found in TAP output
[Inline::Python] t/inherit.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: Bad plan.  You planned 8 tests but ran 0.
[Inline::Python] t/invoke.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: No plan found in TAP output
[Inline::Python] t/matplotlib.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: No plan found in TAP output
[Inline::Python] t/p6_to_py.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: Bad plan.  You planned 12 tests but ran 0.
[Inline::Python] t/py_to_p6.t  (Wstat: 11 Tests: 0 Failed: 0)
[Inline::Python] Non-zero wait status: 11
[Inline::Python]   Parse errors: No plan found in TAP output
[Inline::Python] Files=13, Tests=0,  155 wallclock secs
[Inline::Python] Result: FAILED
===> Testing [FAIL]: Inline::Python:ver<0.5>:auth<cpan:NINE>
Aborting due to test failure: Inline::Python:ver<0.5>:auth<cpan:NINE> (use --force-test to override)

and e.g.

prove6 -Ilib t/call.t

gives

t/call.t .. All 13 subtests passed 

Test Summary Report
-------------------
t/call.t (Wstat: 11 Tests: 0 Failed: 0)
Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 13 tests but ran 0.
Files=1, Tests=0,  5 wallclock secs
Result: FAILED

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions