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
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
<bbot2> Exception: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5525 [mattip: build release, release-pypy3.7-v7.x]
lritter has quit [Ping timeout: 260 seconds]
jcea has quit [Quit: jcea]
epony has quit [Ping timeout: 258 seconds]
glyph has quit [Quit: End of line.]
glyph has joined #pypy
mattip_ is now known as mattip
<mattip> cool, just as the macos buldbot began to fail, someone submitted a pr to fix it
marvin_ has quit [Remote host closed the connection]
marvin_ has joined #pypy
<antocuni> mattip: I finally merged hpy into py3.6 :)
<antocuni> (although it's not completely up to date with the latest git version, I'll explain more in an upcoming pypy-dev email)
<arigato> I personally think it's too early to include _hpy_universal in an official pypy release, because tomorrow it won't be usable any more, but well
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6009 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7200 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5203 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5526 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1382 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/648 [mattip: build release, release-pypy3.7-v7.x]
oberstet has joined #pypy
<mattip> ok, unless there is an outcry I don't plan on releasing hpy in 7.3.2.
<antocuni> sure
<antocuni> arigato: I agree about official releases, but it's useful to have nightly builds
<mattip> +1 for nightlies
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6009 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1382 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7200 [mattip: build release, release-pypy3.7-v7.x]
dnshane has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
dnshane has joined #pypy
dmalcolm has quit [Ping timeout: 260 seconds]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5203 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/648 [mattip: build release, release-pypy3.7-v7.x]
<mattip> tos9 or anyone else with a macOS, could you try to get
<mattip> the complete compilation error from the newly failing cffi test_ffi_backend tests on the 3.7 release
<mattip> there are three newly-failing tests
<mattip> I put more information on issue 14454
<bbot2> Exception: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5526 [mattip: build release, release-pypy3.7-v7.x]
jacob22 has quit [Read error: Connection reset by peer]
jacob22 has joined #pypy
<danchr> mattip: I think I fixed it :)
<danchr> perhaps the reason this has started failing is that Clang gives an error when implicitly declaring a library function — whereas that used to work just fine
<mattip> danchr: thanks, and thanks for that PR, it came just in time
<danchr> that wasn't even intentional ;)
<danchr> just lucky
<danchr> FWIW the changes to get Boehm working weren't _quite_ sufficient
YannickJadoul has joined #pypy
<danchr> not sure why…
<mattip> about the MACOSX_DEPLOYMENT_TARGET and sysconfig in general, it is not easy to figure out what is the right strategy
oberstet has quit [Remote host closed the connection]
<mattip> since it impacts so many downstream projects: virtualenv, setuptools, and more
<danchr> yeah, it's probably not a safe change
<danchr> or rather; it should be dealt with as part of larger cleanup of the layout/distutils stuff
<danchr> which I'd like to take a stab at, but I'm not entirely sure where to start
<mattip> danchr: it depends on what the goal is.
<mattip> PyPy as installed from the tarballs tries to mimic a virtualenv, and install everything inside a base directory
<danchr> yeah, but if you're actually _installing_ pypy, that's a rather odd layout
<mattip> unlike, say, debian packaging that spreads things out to /usr/local
<mattip> so there is a basic conflict here. I wonder if templating could be used to solve it
<danchr> from my perspective, there are two issues here: 1) PyPy needs to know where to find its bundled modules and 2) the bundled modules, pip, venv, distutils, etc., need to adapt to whatever layout used
<danchr> once you know how to do #1, you can figure out what to do with #2
<danchr> on macOS at least, part of getting packaging “right” is made easier by the fact that the executable actually refers to the dynamic library by a path, and that path is editable using install_name_tool
<mattip> at the end of the day, PyPy should use the same methods CPython uses
<danchr> well, that would essentially imply migrating PyPy to autotools
<mattip> we have a Makefile, although the buildbots do not use it
<danchr> ./configure is the hard part :)
<mgorny> Here's a hack we're using for some time
<danchr> one option is to extract a small library, written in C and using autotools, which would define the relevant symbols which pypy could then load and link against
<mgorny> Where @EPREFIX@ is subst at build time
<mgorny> But it still relies on pypy exec being in the usual place
<mgorny> (And symlinked to /usr/bin)
<danchr> mgorny: what I like to achieve is packaging PyPy in a way where it essentially corresponds to CPython and every other tool, rather than stashing it in ${prefix}/pypy with symlinks in ${prefix}/bin
<simpson> Same sort of thing is done in nixpkgs; here's lining up Tk on Darwin: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/python/pypy/tk_tcl_paths.patch
<mattip> (sorry to interrupt with some spam)
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6010 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7201 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5204 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5527 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1383 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/649 [mattip: build release, release-pypy3.7-v7.x]
<mattip> </spam>
<danchr> mattip: what's your opinion of the small-exta-library idea? it might it much easier to mimic CPython in a limited fashion without applying a major overhaul to the RPython toolchain
<danchr> +r
<mgorny> That sounds like an ugly hack that's going to replace one problem with another
<mgorny> (How do you install multiple pypy versions? )
<simpson> (Same way as installing multiple versions of anything else: Use Nix, or something like Gentoo's switchable profiles)
<simpson> (But also yeah, ugly hacks should not go unquestioned.)
<mattip> danchr: pypy.exe is actually a very thin wrapper over libpypy-c.dylib
<mattip> this is the entire C code:
<mattip> int pypy_main_startup(int, char*[]); int main(int argc, char* argv[]) { return pypy_main_startup(argc, argv); }
<mattip> mgorny: do you mean multiple pypy versions as in python2.7, python3.6, python3.7 or pypy versions as in pypy7.3.0, pypy7.3.1, pypy7.3.2?
<danchr> ah, so a simpler solution might be to autotoolify pypy-c?
<mattip> yup
<mattip> and then percolate the variables into pypy_main_startup
<mattip> or some other helper functions
<danchr> so essentially, pypy-c would have some structure which defined the state of how to initialize PyPy, and pypy_main_startup() would take that state as an argument
<danchr> perhaps we could rely on the linker by having a weakly imported symbol instead, and thus not changing the signature of pypy_main_startup()?
<danchr> the RPython code would simply check whether that symbol is NULL
<mattip> sure
<danchr> the advantage to that is that it probably wouldn't break embedding or running unconfigured quite as much
<mattip> I think the code that you are looking for is in pypy/interpreter/appmain.py, in setup_bootstrap_path
<mattip> it is tricky, there are some comments there about what is permitted
<danchr> I was looking in pypy/module/sys/initpath.py
<danchr> no appmain.py in either default or py3.7?
<danchr> ah, app_main.py :)
<mattip> sorry
* mattip off, can chat later
<YannickJadoul> How would I go about debugging a function of the C API that segfaults?
<YannickJadoul> PyUnicode_DecodeUTF16 seems to crash when used in pybind11, but getting a stacktrace with gdb isn't exactly helpful
<mgorny> mattip: the former is sufficient for me
<mgorny> danchr: tbh, you don't really need autoconf if it's just about substituting paths
<mgorny> a trivial python script would do
<danchr> yeah, autotools is probably overkill
ronan has quit [Remote host closed the connection]
ronan has joined #pypy
ronan is now known as Guest64181
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7201 [mattip: build release, release-pypy3.7-v7.x]
dmalcolm has joined #pypy
Dejan has quit [Quit: Leaving]
pmp-p has quit [Ping timeout: 258 seconds]
pmp-p has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6010 [mattip: build release, release-pypy3.7-v7.x]
epony has joined #pypy
<mgorny> mattip: final release today?
<mattip> mgorny: fingers crossed
<mattip> not today, still need to run py2.7 and py3.6, but this should be the version
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1383 [mattip: build release, release-pypy3.7-v7.x]
<mattip> YannickJadoul: can you capture the input
<mattip> then add it to an untranslated test in pypy/modulue/cpyext/test/test_unicodeobject.py
Dejan has joined #pypy
<mattip> or directly add it to a test in pypy/interpreter/test/test_unicodehelper.py
<mattip> since it is a thin wrapper around
<YannickJadoul> mattip: Yes, that should be possible
<mattip> str_decode_utf_16_helper(string, errors, final=True, errorhandler=None, byteorder=byteorder)
<YannickJadoul> Aha, I see
<YannickJadoul> Thanks! I'll give that a shot
<mattip> it seems we are missing 16-bit tests, I only see test_ utf_16_encode_decode in pypy/module/_codecs/test/test_codecs.py
<mattip> but there are probably more around
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6011 [mattip: build release, release-pypy3.6-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7202 [mattip: build release, release-pypy3.6-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1384 [mattip: build release, release-pypy3.6-v7.x]
<YannickJadoul> mattip: I'm now noticing that even without adding a test, `pypy -m pytest pypy/module/cpyext/test/test_unicodeobject.py` already crashes
<YannickJadoul> `pypy/module/cpyext/test/test_unicodeobject.py .Aborted (core dumped)`
<mattip> that is with pypy2, right?
<YannickJadoul> Yes
<YannickJadoul> A recent `default`, `100376:c74733ad05b6` if I'm not misusing hg
<mattip> :(
<mattip> does the buildbot agree that test fails?
<YannickJadoul> Haven't checked yet
<mattip> what platform/os?
<YannickJadoul> Seems not
<YannickJadoul> Linux, 64-bit
<YannickJadoul> Ubuntu ... 18.04, I think
<YannickJadoul> Host-pypy 7.3.1 (though that probably doesn't matter?)
<YannickJadoul> Verbose pytest output:
<YannickJadoul> pypy/module/cpyext/test/test_unicodeobject.py::AppTestUnicodeObject::test_unicodeobject PASSEDAborted (core dumped)
<mattip> can reproduce
<YannickJadoul> Happy to try helping debugging, but not sure how to start
<mattip> src/typeobject.c:18: _PyPy_subtype_dealloc: Assertion `base' failed
<mattip> well, running tests on top of cpython2.7 is the more accepted way to work
<mattip> that error comes from the host pypy, not the translated pypy, so something is getting confused
<YannickJadoul> Oh :-/
<YannickJadoul> Let me see if I can reproduce the pybind11 & utf-16 issue, then, with CPython
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5204 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5205 [mattip: build release, release-pypy3.6-v7.x]
cjmcdonald has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/649 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/650 [mattip: build release, release-pypy3.6-v7.x]
oberstet has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7202 [mattip: build release, release-pypy3.6-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6011 [mattip: build release, release-pypy3.6-v7.x]
<YannickJadoul> OK, I can reproduce the original issue with UTF-16, with CPython as host!
<YannickJadoul> (adding `test("\x00= <\xd8\x82\xdf5\xd8\x00\xdcz\x00", None)` to `test_decode_utf16`, for the record; but I'll try debugging myself)
<YannickJadoul> (scratch that; I missed a byte at the front)
<bbot2> Exception: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5527 [mattip: build release, release-pypy3.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5528 [mattip: build release, release-pypy3.6-v7.x]
Guest64181 is now known as ronan
rubdos_ has joined #pypy
rubdos has quit [Ping timeout: 260 seconds]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1384 [mattip: build release, release-pypy3.6-v7.x]
<mattip> I _think_ the problem with running untranslated cpyext tests with pypy (on linux) is something like
<mattip> we have functions written in C, like _PyPy_subtype_dealloc
<mattip> these are compiled into the shared object and linked into the test
<mattip> but we already have _PyPy_subtype_dealloc in the libpypy-c.so running the test, so that is the one used to compare to
<mattip> when checking "while (base->tp_dealloc != &_PyPy_subtype_dealloc)"
<YannickJadoul> Right, that would make sense, I guess
<mattip> it's just a theory right now. These tests run on windows using pypy as a host
<YannickJadoul> I can't reproduce the original segfault, btw
<YannickJadoul> I confirmed that it's the `assert m.good_utf16_string() == u"b‽🎂𝐀z"` in pybind11 that makes things crash
<YannickJadoul> Did any unicode get fixed between 7.3.1 and 7.3.2? Should I test with 7.3.2rc2?
jacob22 has quit [Read error: Connection reset by peer]
jacob22 has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5205 [mattip: build release, release-pypy3.6-v7.x]
<mattip> yup and yup
<YannickJadoul> rc2 is not listed yet on https://downloads.python.org/pypy/, btw
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5528 [mattip: build release, release-pypy3.6-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/650 [mattip: build release, release-pypy3.6-v7.x]
<YannickJadoul> Still get a segfault on `assert m.good_utf16_string() == u"b‽🎂𝐀z"` with 7.3.2 :(
YannickJadoul has quit [Quit: Leaving]
<mattip> can you put the complete test somewhere?
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6012 [mattip: build release, release-pypy2.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7203 [mattip: build release, release-pypy2.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5206 [mattip: build release, release-pypy2.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5529 [mattip: build release, release-pypy2.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1385 [mattip: build release, release-pypy2.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/651 [mattip: build release, release-pypy2.7-v7.x]
lritter has joined #pypy
<bbot2> Success: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7203 [mattip: build release, release-pypy2.7-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6012 [mattip: build release, release-pypy2.7-v7.x]
jcea has joined #pypy
lritter has quit [Ping timeout: 260 seconds]
lritter has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5206 [mattip: build release, release-pypy2.7-v7.x]
YannickJadoul has joined #pypy
<YannickJadoul> mattip: Sure; can I just give you a few links to the relevant parts of pybind11?
<YannickJadoul> And the part where `PyUnicode_DecodeUTF16` etc would be called (part of returning that `std::u16string` to Python): https://github.com/pybind/pybind11/blob/5e6ec496522b313e34af3de91f6c0565f68e3552/include/pybind11/cast.h#L1271-L1282
<YannickJadoul> So I was checking whether I could remove the PyPy-specific workaround and saw that the comment was outdated
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5529 [mattip: build release, release-pypy2.7-v7.x]
jacob22 has quit [Read error: Connection reset by peer]
jacob22 has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/651 [mattip: build release, release-pypy2.7-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1385 [mattip: build release, release-pypy2.7-v7.x]