01:05
Julian has quit [Quit: leaving]
04:24
fotis has joined #pypy
04:28
fotis has quit [Ping timeout: 252 seconds]
04:58
<
mattip >
something changed in the way _hpy_backend tests are skipped on linux32 and windows64
04:58
<
mattip >
and the skipping gives a KeyError
04:58
<
mattip >
that is on linux32
05:42
<
mattip >
whohoo, we have over 600 packages on conda for pypy-windows (and over 1000 for pypy-posix)
06:10
<
LarstiQ >
those `awaiting-parents` also look promising in that just waiting might be enough to get them done
06:31
<
mattip >
I tried adding a CI job but tox + azure pipelines is not working like I thought
07:03
lritter has joined #pypy
07:08
lritter has quit [Ping timeout: 265 seconds]
07:21
otisolsen70 has joined #pypy
08:05
otisolsen70_ has joined #pypy
08:06
otisolsen70_ has quit [Read error: Connection reset by peer]
08:09
otisolsen70 has quit [Ping timeout: 265 seconds]
08:57
<
ctismer >
mattip: I just saw that issue 2674
_does_ apply of course. Did not see the extension (tired from debugging).
09:02
<
ctismer >
mattip: How comes that this three-years-old issue was never handled? Client vanished?
09:23
<
mattip >
that issue has a pretty minimum reproducer. Let me see if I can turn it into a failing test
09:42
slav0nic has joined #pypy
10:34
stkrdknmibalz has quit [Quit: WeeChat 3.0.1]
10:54
<
ctismer >
mattip: Well, that was not criticising. But when inheritance is not working, why does no other extension complain as well? May be the usage of inheritance is very uncommon for extensions.
11:08
<
mattip >
So we have bases=(object, noddy) where noddy is a c-extension type with an added attribute,
11:08
<
mattip >
so its tp_basicsize is larger than object's tp_basicsize
11:09
<
mattip >
and I seem to recall some logic where the tp_allocate uses the largets tp_basicsize of all the base classes
11:09
<
mattip >
but I don't recall any rule about that changing which tp_new is called for the derived class
11:09
<
mattip >
shouldn't it still be the tp_new of the first base class?
11:20
otisolsen70 has joined #pypy
11:28
<
ctismer >
Ahaa, then it's different. I remember something about inheritance. That is quite some calculation obtaining the right MRO.
11:29
<
ctismer >
My case is even simpler.
11:37
<
mattip >
(I pushed a test to the issue-2674 branch)
11:37
<
mattip >
what is your case like? I didn't find time to try out your code
11:45
<
ctismer >
it is simply this "nothing":
11:46
<
mattip >
so no dual inheritance?
11:47
<
ctismer >
QObject is a builtin wrapped Qt type in PySide. No, simple inheritance.
11:47
<
mattip >
neither as an hg repo nor a git repo
11:47
<
ctismer >
Do you support Py_tp_call?
11:49
<
ctismer >
you paste this link into your shell. It appends to your cloned git repos. No?
11:50
<
ctismer >
what is the response in the shell?
11:51
* ctismer
can also send you a .zip with the whole checkout
12:01
<
LarstiQ >
not sure why these aren't just branches :shrug:
12:03
<
ctismer >
Aaah, sorry, I forgot what I'm doing ðĪŠ
12:05
<
ctismer >
exactly, open it in the browser and choose how you want to download - that gives you the link for the terminal
12:09
<
mattip >
strange, git clone ... from LarstiQ 's message does not work for me
12:10
<
mattip >
git version 2.25.1
12:10
<
cfbolz >
me neither
12:12
<
mattip >
when I look at the "CPython QtCore.QObject.__new__", I see it is "built-in method
__new__ of Shiboken.ObjectType object"
12:12
<
mattip >
is it something different in PyPy?
12:12
<
ctismer >
ok, I will try to paste a direct link, what I download.
12:15
<
ctismer >
>>>> QtCore.QObject.__new__
12:15
<
ctismer >
<builtin_function_or_method object at 0x00007f90ef1467c8>
12:16
<
ctismer >
>>> QtCore.QObject.__new__
12:16
<
ctismer >
<built-in method
__new__ of Shiboken.ObjectType object at 0x7faa0906e4e0>
12:17
<
mattip >
so somehow the tp_new is not getting assigned correctly, even though the mro is quite straightforward
12:17
<
mattip >
[<class 'PySide6.QtCore.QObject'>, <class 'Shiboken.Object'>, <class 'object'>]
12:18
<
ctismer >
here is what the link is in terminal:
12:19
<
mattip >
right, but first you need a clone, so first
12:20
<
ctismer >
yes. That was in the setup instruction link, probably scrolled away :)
12:23
<
ctismer >
the above class is correctly initialized. Just in the inheritance case, the Py_tp_new slot should be called that does a quite complex dance.
12:24
<
mattip >
on PyPy, what is Shiboken.ObjectType.__new__ ?
12:24
<
mattip >
it should be the same as QtCore.QObject.__new__
12:25
<
mattip >
and different from object.__new__
12:30
<
ctismer >
don't you mean Shiboken.Object.__new__ ?
12:30
<
ronan >
mattip: note that in 2674, the issue might just be that PyType_FromSpec() isn't called
12:31
<
mattip >
ronan: thanks. It does seem to be a different issue
12:31
<
ctismer >
but we
_are_ using PyType_FromSpec
12:32
<
ronan >
BTW, I don't think we can support creating raw PyHeapTypeObjects
12:32
<
mattip >
ctismer: ok, ronan was specifically referring to issue 2674, not your case.
12:32
<
ctismer >
therefore I asked if you are supporting `Py_tp_new`
12:32
<
ctismer >
ah, sorry :)
12:33
<
mattip >
we support everything, excecpt we have bugs, so we are trying to figure out what the bug is
12:34
<
mattip >
again: what is QtCore.QObject.__new__, is it Shiboken.ObjectType.__new__ or is it object.__new__ ?
12:36
<
mattip >
ronan: why can't we support creating PyHeapTypeObjects? We pass the tests for PyHeapTypeObject in cpyext/test/test_typeobjects.py
12:36
<
mattip >
ronan: is there a test missing?
12:37
<
mattip >
ctismer: building PySide6 requires going through too many hoops. Now I need to sign up to be a qt developer in order to get the libraries.
12:38
<
ronan >
mattip: look at what PyType_FromSpec() is doing, we're not replicating any of it when peoplpe bypass it
12:41
<
ronan >
also, CPython docs are explicit that the only supported way of creating heap types is through PyType_FromSpec() and friends
12:42
<
ctismer >
mattip: it is
12:42
<
ctismer >
>>>> QtCore.QObject.__mro__
12:42
<
ctismer >
>>>> QtCore.QObject.__mro__[0].__new__
12:42
<
ctismer >
(<class 'PySide6.QtCore.QObject'>, <class 'Shiboken.Object'>, <class 'object'>)
12:42
<
ctismer >
<builtin_function_or_method object at 0x00007f8b587ec4f0>
12:42
<
ctismer >
>>>> QtCore.QObject.__mro__[1].__new__
12:42
<
ctismer >
>>>> QtCore.QObject.__mro__[2].__new__
12:42
<
ctismer >
<function object.__new__ at 0x000000010a61abd0>
12:42
<
ctismer >
<function object.__new__ at 0x000000010a61abd0>
12:44
<
mattip >
so the problem is that the Shiboken.Object.__new__ is object.__new__
12:44
<
mattip >
when it should be a different tp_new
12:45
<
ctismer >
but why does it work in Python?
12:46
<
ctismer >
you mean, initialization is going this path??? That is quite different from Python. But when this is so, then the fix is easy :-D
12:50
<
mattip >
it seems we have no tests at all of PyType_FromSpec nor any of PyType_FromSpecWithBases
12:51
<
ctismer >
right (this is not for me, but I discovered exactly that...)
13:07
<
ctismer >
mattip: and that is used in CPython.
13:08
<
ctismer >
here is what you saw in the __mro__:
13:11
<
mattip >
thanks. We need a test we can put into test_typeobjects.py, or as a stand-alone C file we can add
13:11
<
mattip >
to cpyext/test/ like cpyext/test/banana.c
13:13
<
ctismer >
not clear for me how the layout should be. Does Shiboken.Object.__new__ call Shiboken.__ObjectType.__new__ in some way?
13:15
Julian has joined #pypy
13:15
* ctismer
thinks this is a dumb question. Simulate classes with Python and try it, right?
13:16
<
mattip >
and guess who commented on that issue almost exactly 3 years ago?
13:17
<
ctismer >
*huestel*
13:18
<
antocuni >
mattip: it's the same problem I complained about in an email which I sent to the C-API mailing list, which got ignored
13:19
<
mattip >
right, I was just writing that
13:20
<
antocuni >
CPython devs are so busy trying not to break anything that they don't have time to fix bugs :)
13:21
otisolsen70_ has joined #pypy
13:25
otisolsen70 has quit [Ping timeout: 265 seconds]
13:25
<
vstinner >
antocuni: (rolling eyes)
13:39
<
ctismer >
mattip: sorry that I was so stubborn and did not see the obvious. Many thanks!!
14:06
<
mattip >
I converted the test to use PyType_FromSpec and use the Py_tp_new slot, which works
14:07
<
mattip >
multiple inheritence still does not, but PySide is not using multiple inheritance
14:07
otisolsen70_ has quit [Quit: Leaving]
14:08
<
mattip >
so somehow the creation of Shiboken.Object is different to what I am doing in the test
14:09
<
mattip >
here is the test
14:11
<
LarstiQ >
mattip, cfbolz: sorry, pasted the wrong thing. But seems you figured that out.
14:12
<
mattip >
maybe because Shiboken.Object uses {Py_tp_base, (&PyType_Type)} ?
14:12
Julian has quit [Ping timeout: 252 seconds]
14:15
<
mattip >
well adding a Py_tp_base breaks things, but for some obscure reason it is setting tp_doc inappropriately
14:21
<
mattip >
but it is still calling the tp_new from the spec
14:24
Julian has joined #pypy
14:24
* ctismer
busy building, will try sth. soon
14:25
<
ctismer >
great that PyPy forces me to make the implementation better, really!
14:26
<
mattip >
ctismer: the mro is showing Shiboken.Object, not Shiboken.ObjectType
14:27
<
ctismer >
yes. Dunno if that is wrong or right ATM.
14:27
<
mattip >
Shiboken.Object, from pyside-setup/sources/shiboken6/libshiboken/basewrapper.cpp line 229
14:27
<
mattip >
does not have a Py_tp_new
14:28
<
ctismer >
I am just supplying one, hoping for a crash
14:29
<
mattip >
how is Shiboken.ObjectType.__new__ getting assigned to PySide6.QtCore.QObject.__new__
14:33
<
ctismer >
just tested it, no change at all
14:35
<
ctismer >
I was not aware that this needs to be assigned. (confused ATM)
14:46
<
ctismer >
"how is Shiboken.ObjectType.__new__ getting assigned to PySide6.QtCore.QObject.__new__": That works through some registration of types, probably something that PyPy cannot see. I will send some log, again building...
14:48
* ctismer
walking the dog
15:02
Julian has quit [Ping timeout: 265 seconds]
15:05
Julian has joined #pypy
15:09
dmalcolm_ has joined #pypy
15:11
dmalcolm has quit [Ping timeout: 252 seconds]
15:30
jacob22 has quit [Quit: Konversation terminated!]
15:45
Julian has quit [Ping timeout: 265 seconds]
15:49
Julian has joined #pypy
15:49
<
ctismer >
mattip: I am sending you the log files.
15:54
<
ctismer >
You see in line 169 that after this, the __new__- call comes, but not in PyPy.
15:57
<
ronan >
ctismer: looks like it's a metaclass problem
15:58
Julian has quit [Ping timeout: 252 seconds]
15:59
yuiza has joined #pypy
15:59
<
ronan >
ctismer: what's type(Obj) on pypy?
15:59
<
ctismer >
ronan: no, that's secondary. The real problem is that `SbkObjectTypeTpNew` gets not called, and we try to figure out where it's wrong.
16:00
<
ronan >
ctismer: that doesn't seem secondary, it's the first place where cpython and pypy diverge
16:02
<
ctismer >
no! Look at line 170. Python inserts a lot that PyPy skips. The metaobjects are secondary.
16:03
<
ronan >
ctismer: line 170 is cpython creating the class Obj, by calling the metaclass
16:06
Atque has joined #pypy
16:09
Julian has joined #pypy
16:12
<
ctismer >
ronan: "what's type(Obj) on pypy?" How should I know that? The thing is crashing when creating.
16:13
<
ctismer >
but it's an ordinary Python class that inherits from QtCore.QObject.
16:15
<
ronan >
ctismer: ahhh, sorry, I thought it was crashing when calling Obj()
16:17
<
ronan >
ctismer: yes, I thought it crashed on line 10
16:18
Julian has quit [Ping timeout: 265 seconds]
16:19
<
ctismer >
yes, it crashes on line 10. The instantiation is the problem.
16:19
Julian has joined #pypy
16:20
<
ctismer >
Ah, sorry!!! Then I can tell. Wait
16:23
yuiza_ has joined #pypy
16:23
<
ctismer >
ronan: hey :)
16:23
<
ctismer >
>>> type(Obj)
16:23
<
ctismer >
>>>> type(Obj)
16:23
<
ctismer >
<class 'type'>
16:23
<
ctismer >
<class 'Shiboken.ObjectType'>
16:24
<
ronan >
ctismer: well, the question becomes wny does it fail at computing the metaclass?
16:25
<
ctismer >
the inheritance gets simply ignored?
16:25
Julian has quit [Ping timeout: 245 seconds]
16:25
<
ronan >
wait, what about type(QtCore.QObject)?
16:26
<
ctismer >
at least this does not look like an error on the PySide side
16:26
<
ctismer >
ok, wait...
16:29
<
ctismer >
>>>> type(QtCore.QObject)
16:29
<
ctismer >
<class 'Shiboken.ObjectType'>
16:29
<
ctismer >
<class 'type'>
16:29
<
ctismer >
>>> type(QtCore.QObject)
16:32
<
ctismer >
>>>> Obj.__mro__
16:32
<
ctismer >
(<class '__main__.Obj'>, <class 'PySide6.QtCore.QObject'>, <class 'Shiboken.Object'>, <class 'object'>)
16:32
<
ctismer >
>>> Obj.__mro__
16:32
<
ctismer >
(<class '__main__.Obj'>, <class 'PySide6.QtCore.QObject'>, <class 'Shiboken.Object'>, <class 'object'>)
16:33
<
ronan >
ctismer: SbkObject_TypeF looks wrong, you're calling PyType_FromSpec() and then setting the type
16:33
<
ctismer >
PyPy seems to ignore the mro, as it is used in dictobject.c, how can that work?
16:33
<
ronan >
pypy ignores modifications done after PyType_Ready()
16:33
<
ctismer >
thanks, good point!
16:37
Julian has joined #pypy
16:40
<
ctismer >
ronan: I did not know how to set the meta type correctly before calling SbkType_FromSpec. Is that possible?
16:43
greedom has joined #pypy
16:43
<
ctismer >
I think I must use the direct API, because I cannot set the meta type with the Limited API.
16:44
Julian has quit [Ping timeout: 260 seconds]
16:45
<
ctismer >
which is possible to do, since the Limited API cannot be used at all, because that contradicts PyPy's structure. :-D
16:53
<
ctismer >
ronan: 1024 thanks for your reasoning, now I know what to implement tomorrow.
16:55
Julian has joined #pypy
17:05
yuiza has left #pypy [#pypy]
17:07
<
ronan >
ctismer: I think you can use Py_tp_base, or PyType_FromSpecWithBases
17:08
Julian has quit [Ping timeout: 265 seconds]
17:09
<
ctismer >
yes I read about that but did not understand - seems to need a helper class?
17:11
yuiza_ is now known as yizawa
17:14
greedom has quit [Remote host closed the connection]
17:15
greedom has joined #pypy
17:19
Julian has joined #pypy
17:25
Julian has quit [Ping timeout: 260 seconds]
17:25
greedom has quit [Remote host closed the connection]
17:31
<
ronan >
I guess we should have PyType_Modified() regenerate the pypy-internal type and document it as being mandatory to call after any direct modification of the PyTypeObject
17:38
Julian has joined #pypy
17:48
ctismer has quit [Ping timeout: 250 seconds]
17:49
fijal has quit [Ping timeout: 252 seconds]
17:49
ctismer has joined #pypy
17:50
fijal has joined #pypy
18:04
<
ctismer >
ronan: I think it can work with a helper class spliced in.
18:33
<
ctismer >
But PyType_Modified would be a great simplification. And it would also enable my switchable features for PyPy !!
19:08
jacob22 has joined #pypy
20:04
Julian has quit [Quit: leaving]
21:04
mattip has quit [Ping timeout: 240 seconds]
22:15
slav0nic has quit [Ping timeout: 260 seconds]
22:42
stkrdknmibalz has joined #pypy