[Python-Dev] Setting frame evaluation function (i.e.:PyInterpreterState.frame_eval)

2019-10-16 Thread Fabio Zadrozny
Hi All,

I'm trying to upgrade the pydevd debugger to the latest version of CPython
(3.8), however I'm having some issues being able to access
`PyInterpreterState.eval_frame` when compiling, so, I'd like to ask if
someone can point me in the right direction.

What I'm trying to do is compile something like:

#include "pystate.h"
...
PyThreadState *ts = PyThreadState_Get();
PyInterpreterState *interp = ts->interp;
interp->eval_frame = my_frame_eval_func;

and the error I'm having is:

_pydevd_frame_eval/pydevd_frame_evaluator.c(7534): error C2037: left of
'eval_frame' specifies undefined struct/union '_is'

So, it seems that now "pystate.h" only has a forward reference to "_is" and
a typedef from " PyInterpreterState" to "_is" and "_is" is defined in
"include/internal/pycore_pystate.h", which doesn't seem like I should be
including (in fact, if I try to include it I get an error saying that I
would need to define Py_BUILD_CORE)... so, can someone point me to the
proper way to set the frame evaluation function on CPython 3.8?

Thanks,

Fabio
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/BJAO35DB4KDC2EWV553YEU3VLRNYJSQ6/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: How do I install Python 3.8.0 on Linux (not possible? no one is doing this?)

2019-10-16 Thread Charalampos Stratakis



- Original Message -
> From: devloca...@gmail.com
> To: python-dev@python.org
> Sent: Wednesday, October 16, 2019 1:35:17 AM
> Subject: [Python-Dev] How do I install Python 3.8.0 on Linux (not possible? 
> no one is doing this?)
> 
> I cannot get Python 3.8.0 installed on Linux ( RHEL 8 / CentOS 8).
> 
> It's not available in any package repo.  When I try to build from source,
> there are dependencies missing (3), that I cannot find anywhere.
> 
> More info here: (I did not want to write this up twice)
> 
> https://www.reddit.com/r/Python/comments/digewe/python_38_not_possible_to_install_on_linux_why/
> 
> The latest version of Python 3 available to me on Linux was released over
> three years ago ( Python 3.6.0 ), I don't understand why.
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/ZP3RSTYWBCPBEYNUGH2THA5OVRLYO3RX/
> Code of Conduct: http://python.org/psf/codeofconduct/
> 

Hello,

I am sorry for your experience. I can understand it can be frustrating, however 
I find the overall condescending tone of the email and the reddit thread a 
little bit unnecessary.

So I'll try and shed some light here as one of the folks maintaining Python for 
RHEL and Fedora.

For RHEL8 and CentOS 8 most of the development headers were moved to a 
different repository. You will need to enable it first and then you can do dnf 
builddep:

On CentOS 8 it's the Powertools repo: yum config-manager --set-enabled 
PowerTools

On RHEL8 it's the coder ready builder repo: subscription-manager repos --enable 
"codeready-builder-for-rhel-8-*-rpms"

Now as numerous other have pointed out, RHEL is a stable slow moving 
distribution, subject to various procedures and rigorous testing. Every package 
change needs to go through a long chain which ensures that the package will 
work flawlessly with the rest of the distribution. Unfortunately we can't just 
dump a new interpreter in the system and expect things to work, this applies 
for many other distros as well since python is at the moment really intertwined 
with the linux ecosystem. You can read this comment from LWN which does a far 
better job explaining what is happening than I: https://lwn.net/Articles/796301/

Also I would advise against installing Python 3.8 systemwide, as this will most 
possibly break the operating system, since many packages depend on it and will 
be incompatible with the new release, dnf being only one example. However you 
can install it on whatever other location you would like in the system and 
develop on top of it (be sure to use the --prefix= flag during 
configure).

A rolling distribution might be a better fit for you. However if you use Fedora 
we already package Python 3.8 as the python38 package. The system interpreter 
will be updated to 3.8 with Fedora 32.

Finally as mentioned by others, this would be a better fit for python-list, as 
this mailing list is mostly used to the development of cpython itself.

-- 
Regards,

Charalampos Stratakis
Software Engineer
Python Maintenance Team, Red Hat
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/PRICMR3LPGJGYAVFJCMOTKGZQDRZW2MH/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Setting frame evaluation function (i.e.:PyInterpreterState.frame_eval)

2019-10-16 Thread Victor Stinner
Hi Fabio,

Right, the PyInterpreterState structure is now opaque. You need to
include pycore_pystate.h which requires to define the
Py_BUILD_CORE_MODULE macro. That's the internal C API which "should
not be used", but it's ok to use it for very specific use cases, like
debuggers.

Maybe we should provide an interpreter method to set
interp->eval_frame, to avoid to pull the annoying internal C API.

Victor

Le mer. 16 oct. 2019 à 15:47, Fabio Zadrozny  a écrit :
>
> Hi All,
>
> I'm trying to upgrade the pydevd debugger to the latest version of CPython 
> (3.8), however I'm having some issues being able to access 
> `PyInterpreterState.eval_frame` when compiling, so, I'd like to ask if 
> someone can point me in the right direction.
>
> What I'm trying to do is compile something like:
>
> #include "pystate.h"
> ...
> PyThreadState *ts = PyThreadState_Get();
> PyInterpreterState *interp = ts->interp;
> interp->eval_frame = my_frame_eval_func;
>
> and the error I'm having is:
>
> _pydevd_frame_eval/pydevd_frame_evaluator.c(7534): error C2037: left of 
> 'eval_frame' specifies undefined struct/union '_is'
>
> So, it seems that now "pystate.h" only has a forward reference to "_is" and a 
> typedef from " PyInterpreterState" to "_is" and "_is" is defined in 
> "include/internal/pycore_pystate.h", which doesn't seem like I should be 
> including (in fact, if I try to include it I get an error saying that I would 
> need to define Py_BUILD_CORE)... so, can someone point me to the proper way 
> to set the frame evaluation function on CPython 3.8?
>
> Thanks,
>
> Fabio
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at 
> https://mail.python.org/archives/list/python-dev@python.org/message/BJAO35DB4KDC2EWV553YEU3VLRNYJSQ6/
> Code of Conduct: http://python.org/psf/codeofconduct/



-- 
Night gathers, and now my watch begins. It shall not end until my death.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/DJTZJ3GEFNLEJL3MCKIZMU5TYLYPSMTT/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Setting frame evaluation function (i.e.:PyInterpreterState.frame_eval)

2019-10-16 Thread Fabio Zadrozny
On Wed, Oct 16, 2019 at 11:14 AM Victor Stinner  wrote:

> Hi Fabio,
>
> Right, the PyInterpreterState structure is now opaque. You need to
> include pycore_pystate.h which requires to define the
> Py_BUILD_CORE_MODULE macro. That's the internal C API which "should
> not be used", but it's ok to use it for very specific use cases, like
> debuggers.
>
> Maybe we should provide an interpreter method to set
> interp->eval_frame, to avoid to pull the annoying internal C API.
>
>
Hi Victor,

Thank you very much, that did the trick!

I agree it'd be nicer to have some method to set up the frame evaluation
function instead of pulling up the internal C API, but it's also *very*
specialized, so, I'm not sure how much it's worth it (I'm happy with just
being able to do it, even if it's not very straightforward).

Best Regards,

Fabio

Le mer. 16 oct. 2019 à 15:47, Fabio Zadrozny  a écrit :
> >
> > Hi All,
> >
> > I'm trying to upgrade the pydevd debugger to the latest version of
> CPython (3.8), however I'm having some issues being able to access
> `PyInterpreterState.eval_frame` when compiling, so, I'd like to ask if
> someone can point me in the right direction.
> >
> > What I'm trying to do is compile something like:
> >
> > #include "pystate.h"
> > ...
> > PyThreadState *ts = PyThreadState_Get();
> > PyInterpreterState *interp = ts->interp;
> > interp->eval_frame = my_frame_eval_func;
> >
> > and the error I'm having is:
> >
> > _pydevd_frame_eval/pydevd_frame_evaluator.c(7534): error C2037: left of
> 'eval_frame' specifies undefined struct/union '_is'
> >
> > So, it seems that now "pystate.h" only has a forward reference to "_is"
> and a typedef from " PyInterpreterState" to "_is" and "_is" is defined in
> "include/internal/pycore_pystate.h", which doesn't seem like I should be
> including (in fact, if I try to include it I get an error saying that I
> would need to define Py_BUILD_CORE)... so, can someone point me to the
> proper way to set the frame evaluation function on CPython 3.8?
> >
> > Thanks,
> >
> > Fabio
> > ___
> > Python-Dev mailing list -- python-dev@python.org
> > To unsubscribe send an email to python-dev-le...@python.org
> > https://mail.python.org/mailman3/lists/python-dev.python.org/
> > Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/BJAO35DB4KDC2EWV553YEU3VLRNYJSQ6/
> > Code of Conduct: http://python.org/psf/codeofconduct/
>
>
>
> --
> Night gathers, and now my watch begins. It shall not end until my death.
>
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/AQNRC2FUWZFXNUETXUNPTMT52WXLFCUT/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Setting frame evaluation function (i.e.:PyInterpreterState.frame_eval)

2019-10-16 Thread Victor Stinner
Would you mind to open an issue at bugs.python.org? You can put me
("vstinner") in the nosy list.

Victor

Le mer. 16 oct. 2019 à 17:07, Fabio Zadrozny  a écrit :
>
>
> On Wed, Oct 16, 2019 at 11:14 AM Victor Stinner  wrote:
>>
>> Hi Fabio,
>>
>> Right, the PyInterpreterState structure is now opaque. You need to
>> include pycore_pystate.h which requires to define the
>> Py_BUILD_CORE_MODULE macro. That's the internal C API which "should
>> not be used", but it's ok to use it for very specific use cases, like
>> debuggers.
>>
>> Maybe we should provide an interpreter method to set
>> interp->eval_frame, to avoid to pull the annoying internal C API.
>>
>
> Hi Victor,
>
> Thank you very much, that did the trick!
>
> I agree it'd be nicer to have some method to set up the frame evaluation 
> function instead of pulling up the internal C API, but it's also *very* 
> specialized, so, I'm not sure how much it's worth it (I'm happy with just 
> being able to do it, even if it's not very straightforward).
>
> Best Regards,
>
> Fabio
>
>> Le mer. 16 oct. 2019 à 15:47, Fabio Zadrozny  a écrit :
>> >
>> > Hi All,
>> >
>> > I'm trying to upgrade the pydevd debugger to the latest version of CPython 
>> > (3.8), however I'm having some issues being able to access 
>> > `PyInterpreterState.eval_frame` when compiling, so, I'd like to ask if 
>> > someone can point me in the right direction.
>> >
>> > What I'm trying to do is compile something like:
>> >
>> > #include "pystate.h"
>> > ...
>> > PyThreadState *ts = PyThreadState_Get();
>> > PyInterpreterState *interp = ts->interp;
>> > interp->eval_frame = my_frame_eval_func;
>> >
>> > and the error I'm having is:
>> >
>> > _pydevd_frame_eval/pydevd_frame_evaluator.c(7534): error C2037: left of 
>> > 'eval_frame' specifies undefined struct/union '_is'
>> >
>> > So, it seems that now "pystate.h" only has a forward reference to "_is" 
>> > and a typedef from " PyInterpreterState" to "_is" and "_is" is defined in 
>> > "include/internal/pycore_pystate.h", which doesn't seem like I should be 
>> > including (in fact, if I try to include it I get an error saying that I 
>> > would need to define Py_BUILD_CORE)... so, can someone point me to the 
>> > proper way to set the frame evaluation function on CPython 3.8?
>> >
>> > Thanks,
>> >
>> > Fabio
>> > ___
>> > Python-Dev mailing list -- python-dev@python.org
>> > To unsubscribe send an email to python-dev-le...@python.org
>> > https://mail.python.org/mailman3/lists/python-dev.python.org/
>> > Message archived at 
>> > https://mail.python.org/archives/list/python-dev@python.org/message/BJAO35DB4KDC2EWV553YEU3VLRNYJSQ6/
>> > Code of Conduct: http://python.org/psf/codeofconduct/
>>
>>
>>
>> --
>> Night gathers, and now my watch begins. It shall not end until my death.



-- 
Night gathers, and now my watch begins. It shall not end until my death.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/TKVGFOTNJ25YMZNYHG3OHVWOLEXAT4AR/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: How official binaries are built?

2019-10-16 Thread Inada Naoki
Thank you for your response.
And I'm sorry about ignoring this. Gmail marked it as spam.

On Tue, Oct 15, 2019 at 6:20 PM Ned Deily  wrote:
>
> We currently do not use those options to build the binaries for the 
> python.org macOS installers.  The main reason is that the Pythons we provide 
> are built to support a wide-range of macOS releases and to do so safely we 
> build the binaries on the oldest version of macOS supported by that 
> installer.  So, for example, the 10.9+ installer variant is built on a 10.9 
> system.  Some of the optimization features either aren't available or are 
> less robust on older build tools.

It makes sense.

>   And I believe it is more important for the python.org macOS installers to 
> continue to provide a single installer that is usable on many systems and can 
> be used in a broad range of applications and by a broad range of users rather 
> than trying to optimize performance for a specific application: you can 
> always build your own Python.
>
> As far as what other distributors of Python for macOS do, what we do 
> shouldn't necessarily constrain them.  I don't see any problem with Homebrew 
> optimizing for a particular user's installation.  I see that MacPorts, 
> another distributor of Python on macOS, provides a non-default variant that 
> uses --enable-optimizations.
>
> https://github.com/macports/macports-ports/blob/master/lang/python37/Portfile
>
> --
>   Ned Deily
>   n...@python.org -- []
>


-- 
Inada Naoki  
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/GN7AYLJGZKS3HEINE5AU7WMK3RHAYBHN/
Code of Conduct: http://python.org/psf/codeofconduct/