cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
Smigwell has quit [Remote host closed the connection]
tsaka__ has quit [Remote host closed the connection]
tsaka__ has joined #pypy
jcea has quit [Quit: jcea]
<mattip> buildbot hgpoller hasn't triggered default
<mattip> there was an error https://paste.ubuntu.com/p/b5Hff8w9y5/
<mattip> searching for other reports of "exceptions.AttributeError: 'LogsResource' object has no attribute 'body'"
<mattip> didn't show me anything
<mattip> but we may be one of the few groups using hgpoller
krono has quit [Ping timeout: 246 seconds]
krono has joined #pypy
bbot2 has quit [Quit: buildmaster reconfigured: bot disconnecting]
<mattip> maybe a restart will clear it?
bbot2 has joined #pypy
<mattip> yup, that did it
<bbot2> Started: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2416 [mattip: force build, msvcrt]
oberstet has joined #pypy
tsaka__ has quit [Ping timeout: 272 seconds]
tsaka__ has joined #pypy
DRMacIver has quit [Ping timeout: 244 seconds]
EWDurbin has quit [Ping timeout: 244 seconds]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2416 [mattip: force build, msvcrt]
michelp has quit [Ping timeout: 260 seconds]
jaraco has quit [Ping timeout: 272 seconds]
jaraco has joined #pypy
michelp has joined #pypy
EWDurbin has joined #pypy
DRMacIver has joined #pypy
krono has quit [Changing host]
krono has joined #pypy
jaraco has joined #pypy
michelp has joined #pypy
EWDurbin has joined #pypy
DRMacIver has joined #pypy
jaraco has quit [Changing host]
michelp has quit [Changing host]
EWDurbin has quit [Changing host]
DRMacIver has quit [Changing host]
tsaka__ has quit [Read error: No route to host]
todda7 has joined #pypy
<mattip> there is something wrong with the msvcrt branch, but I don't see it
<mattip> after some point any "print xxx" statement fails in tests
<mattip> what happens if I reduce the number of parallel runs to 1
<bbot2> Started: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2417 [mattip: force build, msvcrt]
<antocuni> mattip: I don't know anything about the msvcrt branch, but feel free to use me as your rubber duck, if you need
<antocuni> (or even if you just need some empathy 😅)
<mattip> antocuni: thanks. The idea is that we use a cpython as host when running tests
todda7 has quit [Ping timeout: 240 seconds]
<mattip> it is compiled with msvc9, which uses a msvcrt9 runtime to provide things like errno and malloc and FILE* and fd integers from os.open()
<antocuni> and we use a different version?
<mattip> but we are running tests that are meant to test semantics of the compiled pypy, which uses msvc16 or so, which has its own runtime
<antocuni> I see
<antocuni> that's why you are using rposix.* instead of os.* in tests?
<mattip> this is especially important when using the FdValidator in rposix, which compiles and installs a "suppress_iph" handler
<antocuni> what is "iph"?
<mattip> invalid parameter handling
<mattip> so if you call c_open(fd) in msvc on a bad file int, it will crash the exe by default
<mattip> if you install a iph routine, and your routine does nothing (like ours does), the app can continue
<mattip> msvc9 has something more primitive in _PyVerifyFd
<mattip> but only for invalid fd
<mattip> so if you call something like strftime, and it gets an invalid parameter, the test crashes
<mattip> (it calls strftime via ctypes, which uses the msvc9 version of strftime)
<antocuni> what is the test which crashes?
<mattip> in module/time/test/test_time
<mattip> theoretically we avoid it by pre-checking the parameters before the calls, see the stanza in interp_time
<mattip> which I tried to modify in 7deb6620f275 for the missing parameters when using msvc10 or higher
<mattip> but these kind of games are all around the code base
<mattip> and cause subtle failures and incompatibilites
<mattip> anyhow, I thought, ok, let's replace the clib detection routine in llctypes ( see c29b9a2b5664)
<mattip> and then change all the untranslated os calls to rposix ones
<antocuni> ?
<mattip> no, the py3.7 lib-python ones
<mattip> "invalid format string"
<antocuni> ok, now I am even more confused
<antocuni> I thought we were talking about tests which were failing because we mix cpython's msvcrt runtime with our own
<antocuni> but if it's a lib-python test, then it's run on top of a translated pypy, so there shouldn't be any mixture
<mattip> right. So I want to fix the failing libpython test, so I write a untranslated one,
<mattip> and it can't pass because in the mean time what is considered an invalid format string by msvc changed
<antocuni> ah, I see
<mattip> same thing with thread tests: we can't test locks because we allocate some via the host python and some via compiled code
<mattip> so, like many of my branches, I got to 90% but there is still something wrong that is taking 90% of the time to fix
<mattip> or even find
<antocuni> the big question is: do we want to support this? It might be fine to just say that we can't run those tests untranslated
Smigwell has joined #pypy
<mattip> well, how do we fix things then?
<mattip> winioconsole is stuck, the py3.7 branch cannot run lib-python tests to completion without some strange pytest crash, ...
<mattip> there are weird unicode locale conversion errors ...
<mattip> another approach that might be easier would be to compile cpython2.7 with the same msvc compiler
<antocuni> or to run untranslated tests with a compiled pypy
<mattip> anyhow, this is getting kind of long. Thanks for listening
<mattip> what I would _really_ like to do is release a 7.3.2 with a prototype hpy
<antocuni> mattip: I fear I wasn't terribly helpful, though. But indeed, if doing the "correct" thing proves to be too hard or consume too much time, the workaround of recompiling cpython sounds like a good compromise to me
<antocuni> at the moment, the pypy hpy is not compatible with the github one, but I plan to fix it soon
<cfbolz> (note that for 64 bit windows we need a recompiled CPython to translate anyway)
<cfbolz> *we will need
<mattip> right, that's what got me thinking along those lines
* antocuni --> lunch
ronan has quit [Remote host closed the connection]
ronan has joined #pypy
ronan is now known as Guest41816
LordKalma has joined #pypy
<LordKalma> hey guys! I saw on the cffi docs to reach you guys here.
<LordKalma> I'm having this funny problem. I have this library that doesn't compile with MSVC because MS can't implement C99 properly... Anyway, I built a shared library, on windows, with mingw, and now I was trying to make a cffi interface
<LordKalma> I managed to make setuptools use mingw, all okay
<LordKalma> but funny thing is that cffi wants the dll to be a .so
Smigwell has quit [Quit: Smigwell]
<LordKalma> in fact, it's more bizarre than that. If I put the library on set_source as libraries=["mylib"], it wants the dll, having the file as .so yields a linker error
<LordKalma> but then, after compilation, it gives an error, and a dependency walker shows me that the pyc wants a .so file
<LordKalma> if I declare the .so file (just renaming the dll) as extra_objects in set_source, all is good
<LordKalma> but it's weird to have a .so on windows...
jacob22 has joined #pypy
jacob22_ has quit [Read error: Connection reset by peer]
Guest41816 has quit [Quit: Leaving]
ronan__ has joined #pypy
ronan__ is now known as ronan
todda7 has joined #pypy
lritter has joined #pypy
_whitelogger has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2417 [mattip: force build, msvcrt]
<mattip> hmm, it seems the nulano fork for win64 is based on this fork of cpython for vs2017
<mattip> but that doesn't work with vs2019
<antocuni> side note: at some point, we need to think about a medium term strategy for compiling rpython code, because I fear that eventually python2.7 is going to stop working/compiling
<antocuni> so we could end up maintaining our own stripped down version of cpython2.7, with just enough modules to complete a translation
LordKalma has left #pypy ["Leaving"]
<mattip> it seems we are fast approaching that for windows anyway
<ronan> antocuni: may I point out that this is completely bonkers? ;-)
Rhy0lite has joined #pypy
jthistle has joined #pypy
<antocuni> ronan: why?
<antocuni> if I do "hg branches" I see these two lines:
<antocuni> hpy-update-vendored 100132:c2750e487506
<antocuni> hpy-update-vendored:hpy-update-vendored-fixes 100075:51d5c4483974
<antocuni> what is the 2nd line? I guess it has something to do with topics, but I'm not sure how to interpret it
speeder39_ has joined #pypy
<ronan> the 2nd line means topic 'hpy-update-vendored-fixes' on the branch 'hpy-update-vendored'
<antocuni> and why do we have a topic?
<antocuni> ronan: do you plan do continue the work on the branch, or should I continue it?
<ronan> I'm working on it
<antocuni> ah cool
<antocuni> what are you doing?
<ronan> wondering how to fix translation
<ronan> there's an issue with the HPyDef_Slot hack
<ronan> when an HPyDef has kind == HPyDef_Kind_Slot, we cast to HPyDef_Slot, but that only works untranslated
<ronan> we could add HPyDef_Slot to the C source, but I think that would cause a warning during compilation
marky1991 has joined #pypy
* antocuni tries test_ztranslation
<antocuni> ronan: test_ztranslation fails with an unrelated error: http://paste.openstack.org/show/796991/
<ronan> antocuni: yes, but that's only a test_ztranslation issue
<ronan> I'm not too interested in fixing it, tbh
<antocuni> ok, but it needs to be fixed anyway :). test_ztranslation is too useful, we can't remove it
<antocuni> anyway, I think it's better if I go back working on the main hpy repo, to avoid conflicts. Moreover, I'm working on hpy only today, then I'll do some days of vacation
<ronan> test_ztranslation becomes a complete mess as soon as we import from pypy.objespace.std
<ronan> Nowadays, I'd rather rely on the rpython check in Heptapod CI
<antocuni> as you prefer, but I speak of experience: I originally introduced test_ztranslation because fixing _hpy_universal translation was too hard without it
<antocuni> moreover, the time invested in fixing it will pay for itself in the future, whenever we will need to fix translation again
<antocuni> anyway, what is the error you get with HPyDef_Slot? The cast looks innocent to me
<ronan> the problem is that it only exists in llapi.py, not in the actual generated C source
<antocuni> you should be able to fix it by adding the relevant code to post_include_bits
<antocuni> and while you are at it, maybe rename to _pypy_HPyDef_Slot or so
marky1991 has quit [Ping timeout: 240 seconds]
<ronan> I think the cast is UB, but it's not like we really care
<antocuni> UB?
<ronan> undefined behaviour
<antocuni> ah yes, sure
<ronan> I was thinking of adding it to a header in src/, is post_include_bits better?
<antocuni> a header is fine as well; currently we use post_include_bits for similar stuff, but indeed if it grows too much, a header is better
<mattip> so now there is a vs2019 project for cpython 2.7
<mattip> and I have a python2.7 built with it. I think I will try to run the buildbot worker with it, let's see what happens
<arigato> mattip: as antocuni mentioned, maybe we should just use pypy2.exe instead of cpython to run untranslated tests
<mattip> sure, even the JIT ones?
<arigato> it doesn't matter, but why not?
<mattip> I thought there was some issues, confusion with logs and stuff
<arigato> at least it should be translated with the same version of the compilers that we test with (unless it was compiled on a different machine with a different configuration=
<mattip> like what happens when you are running untranslated tests and you set PYPYLOG
<arigato> if there are issues, it would be better to fix them than attempt to use a non-standard cpython (even though that's what we're doing right now for win64)
<arigato> "ah"
<mattip> but maybe that is only a handful of tests
<arigato> or it can be worked around, e.g. by changing the name "PYPYLOG" somewhere
<mattip> "translated with the same version of the compilers that we test with" - was what I was trying to do with the msvcrt branch
<mattip> but I can't get it to work
<mattip> or maybe you meant something else
<arigato> I meant, making sure the host version and the tests are using the same clib and there is only one clib in total around
<arigato> but I meant it by making sure the host python was a pypy translated using the same machinery as the one installed on the test machine
<arigato> so there would never me two different clibs
<arigato> s/me/be
<mattip> got it
<mattip> so then we either use a cpython or pypy built with the target compiler
<mattip> which is more likely to work sustainably? I guess you are saying pypy
<arigato> well maybe it's not working because we probably can't use some official pypy2.exe if it was built on another machine
<arigato> so I have no idea
<arigato> if building our own cpython is easy, go with it, I guess
<mattip> took 10 minutes, once I had the pieces installed (visual studio was needed to upgrade the project files)
<arigato> it's necessary right now for win64, but soon we'll have the same choice there, of either continuing to use our hackish cpython6464 or always using pypy2-win64.exe
<arigato> OK
<arigato> in fact we have the choice right now, because we can build a pypy2-win64.exe, just not with all extra modules yet
<mattip> let me switch to win32 pypy2 and kick the rpython build bot, lets see how many new failures there are
<arigato> OK
<mattip> nothing is simple it seems. Right now, in order to run pypy-as-python, it needs to be the python seen by the buildbot
<mattip> but that means it needs to be the python running the buildbot, or I need to do some PYTHONSCRIPT startup stuff
<mattip> but that means (for windows) it needs pywin32 - see the exception above
speeder39_ has quit [Quit: Connection closed for inactivity]
jcea has joined #pypy
Smigwell has joined #pypy
dddddd_ has joined #pypy
dddddd has quit [Ping timeout: 256 seconds]
marky1991 has joined #pypy
kristjansson has joined #pypy
otisolsen70 has joined #pypy
otisolsen70_ has joined #pypy
otisolsen70 has quit [Ping timeout: 265 seconds]
epony has quit [Ping timeout: 258 seconds]
marky1991 has quit [Ping timeout: 264 seconds]
otisolsen70_ has quit [Remote host closed the connection]
otisolsen70_ has joined #pypy
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
Rhy0lite has quit [Ping timeout: 265 seconds]
<antocuni> ronan: I "fixed" test_ztranslation, see 88860eab0122
<antocuni> it still fails for the HPyDef_Slot problem, as expected
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
marky1991 has quit [Ping timeout: 265 seconds]
<mattip> yeah, pywin32 heavily uses swig, so we need things like PyInitialize, PySys_SetArgv, ...
Rhy0lite has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/rpython-win-x86-32/builds/320 [mattip: test new cpython]
<bbot2> Exception: http://buildbot.pypy.org/builders/rpython-win-x86-32/builds/320 [mattip: test new cpython]
otisolsen70__ has joined #pypy
otisolsen70__ has quit [Remote host closed the connection]
otisolsen70_ has quit [Ping timeout: 265 seconds]
dddddd_ is now known as dddddd
jacob22 has quit [Read error: Connection reset by peer]
jacob22 has joined #pypy
todda7 has quit [Read error: Connection reset by peer]
<bbot2> Started: http://buildbot.pypy.org/builders/rpython-win-x86-32/builds/321 [mattip: test with pypy2 as python]
<bbot2> Failure: http://buildbot.pypy.org/builders/rpython-win-x86-32/builds/321 [mattip: test with pypy2 as python]
<bbot2> Started: http://buildbot.pypy.org/builders/rpython-win-x86-32/builds/322 [mattip: test with pypy2 as python]
<mattip> I "tricked" buildbot by renaming the python that runs the worker to python_for_buildbot.exe for now
<mattip> if this works, we can change the buildbot scripts to use "pypy" instead of "python" as the host for testing
epony has joined #pypy
_whitelogger has joined #pypy
epony has quit [Remote host closed the connection]
<bbot2> Failure: http://buildbot.pypy.org/builders/rpython-win-x86-32/builds/322 [mattip: test with pypy2 as python]
epony has joined #pypy
<mattip> not too bad, there are new obvious failures like rlib.test.test_clibffi calling del without gc.collect
<mattip> and some tests that do not close files
<mattip> this one crashes translator\c\test\test_standalone.py
lritter has quit [Ping timeout: 264 seconds]
oberstet has quit [Read error: Connection reset by peer]
oberstet has joined #pypy
Smigwell has left #pypy [#pypy]
Rhy0lite has quit [Quit: Leaving]
pmp-p has quit [Ping timeout: 256 seconds]
pmp-p has joined #pypy
oberstet has quit [Quit: Leaving]
altendky has quit [Ping timeout: 244 seconds]
altendky has joined #pypy
wallet42_ has quit [Ping timeout: 260 seconds]