cfbolz changed the topic of #pypy to: #pypy PyPy, the flexible snake https://pypy.org | IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end and https://libera.irclog.whitequark.org/pypy | the pypy angle is to shrug and copy the implementation of CPython as closely as possible, and staying out of design decisions
jcea has quit [Ping timeout: 246 seconds]
lehmrob has joined #pypy
lehmrob has quit [Ping timeout: 246 seconds]
jeffmc has joined #pypy
jeffmc has quit [Ping timeout: 260 seconds]
jeffmc has joined #pypy
joshszep_ has joined #pypy
jeffmc has quit [Ping timeout: 260 seconds]
joshszep has quit [Ping timeout: 252 seconds]
joshszep_ has quit [Read error: Connection reset by peer]
joshszep has joined #pypy
lehmrob has joined #pypy
joshszep_ has joined #pypy
joshszep has quit [Ping timeout: 268 seconds]
joshszep_ has quit [Read error: Connection reset by peer]
joshszep has joined #pypy
otisolsen70 has joined #pypy
<arigato> vext01: this warning means: "I'm not finding the directory lib-python/3/ or lib_pypy/ when I look in the place where the executable is or any parent directory"
sol_ has joined #pypy
sol__ has quit [Ping timeout: 255 seconds]
<vext01> arigato: i see
MiguelX413 has quit [Ping timeout: 246 seconds]
Atque_ has joined #pypy
<vext01> arigato: those dirs are in ../../
<vext01> should be ok, right?
MiguelX413 has joined #pypy
<vext01> the pypy executable is a symlink from the usession dir, in case that matters
Atque has quit [Ping timeout: 255 seconds]
<vext01> yes, it's to do with the symlink
<vext01> is the warning incorrect then?
<cfbolz> vext01: hm, where is the *actual* file?
<cfbolz> in goal/
<cfbolz> or in usession*/testing_1 ?
commandoline has joined #pypy
commandoline has quit [Client Quit]
<vext01> hi cfbolz
commandoline has joined #pypy
<vext01> i copied it into pypy/goal
<vext01> and it works
<vext01> but if you symlink it into tha tsame place, it does not
<vext01> (i got the idea to make a symlink from the warning itself)
<cfbolz> the warning says to do the opposite though: the binary must always be in goal/. but it's fine to put a symlink to it somewhere else
<vext01> ohhh
<vext01> ok, now build cffi imports
<vext01> i've put prints in to see where it thinks the lib_pypy dir is
<vext01> it adds the top-level src dir as a PYTHONPATH
<vext01> is that right?
<vext01> ah, i think i see it
<vext01> nope...
<vext01> any ideas?
<cfbolz> vext01: hm, can you try to see whether afterwards "import hashlib" still warns?
<vext01> cfbolz: yes, the same error
<cfbolz> vext01: that probably means one of the required libs isn't installed?
<vext01> ok, i'll check that next
<vext01> (should be right though, we always had ssl support in the package)
<cfbolz> I really don't know how that works unfortunately
<cfbolz> vext01: iirc blake2b is special though
<vext01> this could be a libressl problem
<vext01> later in the trace:
<vext01> ValueError: unsupported hash type blake2b
<vext01> is blake2b considered weak?
<vext01> it's fairly new and looks strong at a glance.. hrm
<cfbolz> vext01: no, but it's not part of ssl I think
<cfbolz> vext01: look at lib_pypy/_blake2
<vext01> yeah, but openbsd has a fork of openssl
<cfbolz> vext01: it looks to me like lib_pypy/_blake2 just has *all* the c code for blake2
<cfbolz> so you'll have to debug a bit why that doesn't work
<cfbolz> does "import _blake2" work, for example?
<vext01> i've been speaking to one of the libressl devs
<vext01> it doesnt support that algorithm
<vext01> he's gonna patch it out for me, since he's more experienced
lehmrob has quit [Remote host closed the connection]
lehmrob has joined #pypy
jcea has joined #pypy
<LarstiQ> what support does libressl need to bring if lib_pypy/_blake2 has all of the code?
<cfbolz> vext01: stop, this has really nothing to do with the ssl lib
<cfbolz> vext01: pypy ships all the C code it needs for blake2
<cfbolz> so you need to find out why that doesn't build
derpydoo has quit [Quit: derpydoo]
derpydoo has joined #pypy
Dejan has joined #pypy
lritter has joined #pypy
<vext01> oh right
otisolsen70 has quit [Quit: Leaving]
lehmrob has quit [Ping timeout: 248 seconds]
lehmrob has joined #pypy
lehmrob has quit [Ping timeout: 255 seconds]
derpydoo has quit [Quit: derpydoo]
Atque_ is now known as Atque
derpydoo has joined #pypy
Guest12 has joined #pypy
<Guest12> I have a gunicorn/flask app that runs under pypy and creates a lot of objects that end up being effectively read only.  I am trying to make use of the gunicorn prefork model and copy on write memory to only keep one copy of the read only objects.  To do this I create all the objects in the master process pre fork and run a gc.collect().  This
<Guest12> works initially and memory is shared as best I can tell but as soon as GC runs in the forked process all the memory looks like it gets copied. My understanding was once an object is copied out of the nursery it should not be touched by GC anymore since  pypy is not updating references in each object.  Is my understanding off here or is there
<Guest12> something else going on that I missed?
<Guest12> fwiw this seems to work in cpython using gc.freeze() but this is not implemented in pypy
derpydoo has quit [Quit: derpydoo]
derpydoo has joined #pypy
<Dejan> Guest12, which version?
<Guest12> Python 3.8.16 PyPy 7.3.11
<arigato> Dejan: yes, there are a few bits in the header of all objects, and a full GC pass requires marking and unmarking these bits
<Guest12> even for old generations?
<arigato> there is a theory about how to solve it, but we never got around to implement it
<arigato> yes
<Dejan> arigato, i assume the message was aimed at Guest12
<Dejan> :)
<arigato> a full GC pass requires marking all live objects, and then freeing the rest
<arigato> Dejan: oops :-) of course
<Dejan> full GC pass is quite expensive
<Guest12> is the "theory about how to solve it" written down somewhere?
<Guest12> would be curious to see that
<arigato> Dejan: yes, but it occurs rarely and is actually run incrementally so it doesn't create too long pauses, so it's usually fine (and better than refcounting for performance). This problem with forks is a drawback
<arigato> Guest12: I can't tell you exactly, cfbolz might have a reference. The idea is to keep the mark bits outside the object headers, in a few temporary pages of memory, and have a way to map object addresses to the correct bit
<Guest12> does a minor collection touch everything in the nursery?
<cfbolz> Yes
<arigato> a minor collection touches all objects in the nursery that are still alive. it ignores completely the memory used by objects that are dead
<arigato> (but the nursery is tiny (a few MBs) so it's not relevant for this fork issue)
<Guest12> got it
<Guest12> Thanks for confirming
<arigato> also, I'm not sure that gc.freeze() on CPython fixes everything, either: as soon as you walk through the objects, then reference counters will be constantly updated in CPython, thus un-sharing potentially everything
<arigato> it works as long as you don't look at most objects
<Guest12> from my initial testing it seemed to keep memory stable, I could very well have had a bad test though
greedom has joined #pypy
<arigato> without gc.freeze() then CPython will unshare everything at the next GC last-level collection (which is rarer than in PyPy I guess); with gc.freeze() then that problem is avoided, but not the refcount one
<arigato> but it depends more on how your program accesses the read-only objects
<Guest12> interesting, I will have to go back and verify my test.  It might just be the change was not as noticeable compared to pypy since it only touched some objects instead of all of them
<arigato> maybe.
<Guest12> The calls I make in the test would have likely included a GC run which would impact PYPY but not CPython
<arigato> yes, if you test for only a short time, then likely it includes a GC run but not the long-term behaviour
<Guest12> makes sense
joshszep_ has joined #pypy
joshszep has quit [Ping timeout: 246 seconds]
lehmrob has joined #pypy
joshszep_ has quit [Read error: Connection reset by peer]
lehmrob has quit [Quit: Konversation terminated!]
joshszep has joined #pypy
ambv has joined #pypy
greedom has quit [Read error: Connection reset by peer]
lritter has quit [Quit: Leaving]
derpydoo has quit [Quit: derpydoo]
joshszep has quit [Ping timeout: 246 seconds]
joshszep_ has joined #pypy
salparadise has joined #pypy
joshszep_ has quit [Read error: Connection reset by peer]
joshszep has joined #pypy
catern has joined #pypy