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
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
lastmikoi has joined #pypy
nimaje has quit [Read error: Connection reset by peer]
nimaje has joined #pypy
Rhy0lite has quit [Quit: This computer has gone to sleep]
dddddd has quit [Ping timeout: 264 seconds]
otisolsen70 has quit [Ping timeout: 246 seconds]
oberstet has joined #pypy
jcea has quit [Quit: jcea]
xcm has quit [Read error: Connection reset by peer]
xcm has joined #pypy
thrnciar has joined #pypy
Techcable has quit [Quit: ZNC - http://znc.in]
Techcable has joined #pypy
Techcable has quit [Quit: ZNC - http://znc.in]
Techcable has joined #pypy
njs has joined #pypy
<njs> so here's a weird question: suppose I want to intentionally leak an object, to guarantee that it and its referent graph will never be collected or (most importantly) have their finalizers run. is there any better option for that than spawning a daemon=True thread that sleeps forever with a reference to that object on its stack?
oberstet has quit [Remote host closed the connection]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
otisolsen70 has joined #pypy
xcm has quit [Ping timeout: 256 seconds]
xcm has joined #pypy
<fijal> njs: stick it sonewhere in sys?
<atomizer> segfault intentionally on exit
xcm has quit [Ping timeout: 246 seconds]
xcm has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
otisolsen70_ has joined #pypy
otisolsen70 has quit [Ping timeout: 240 seconds]
oberstet has joined #pypy
dddddd has joined #pypy
lritter has joined #pypy
<arigo> njs: not sure there is a way that works reliably on both pypy and cpython. You could hack at the refcount on cpython, and on pypy simply storing it in the sys module should be enough
Rhy0lite has joined #pypy
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
vstinner has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7020 [arigo: testing, wb_before_move]
<antocuni> arigo: what about reload(sys), though? Wouldn't it forget the reference?
<arigo> yes
<arigo> if we're looking for a totally fool-proof solution, though, python is the wrong language
<arigo> (a.k.a. if you're concerned about reload(sys) specifically, store it in another module than sys)
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
marky1991 has quit [Ping timeout: 246 seconds]
jcea has joined #pypy
Dejan has quit [Ping timeout: 246 seconds]
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
marky1991 has joined #pypy
<bbot2> Success: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7020 [arigo: testing, wb_before_move]
BPL has joined #pypy
fangerer___ has joined #pypy
kirma has quit [Ping timeout: 260 seconds]
mgedmin_ has joined #pypy
krono has quit [Ping timeout: 256 seconds]
samth has quit [Ping timeout: 256 seconds]
Ninpo^ has joined #pypy
fangerer__ has quit [Read error: Connection reset by peer]
mgedmin has quit [Quit: ZNC - https://wiki.znc.in/ZNC]
mgedmin_ is now known as mgedmin
Ninpo has quit [Ping timeout: 265 seconds]
zmt01 has quit [Ping timeout: 256 seconds]
zmt00 has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7021 [arigo: testing, wb_before_move]
samth has joined #pypy
krono has joined #pypy
ulope has quit [Ping timeout: 264 seconds]
ulope has joined #pypy
<arigo> cool, the wb_before_move branch removes the 10x slow-down in some cases when we shift items around in a gc array (like list.pop(0) or list.insert(0, x))
<antocuni> cool
<antocuni> what was the problem?
<arigo> reading and writing all gc pointers manually, which is slow if the array is an old gc object with cards
<arigo> unsure the fix is positive in all cases, though
<arigo> it basically removes the cards in these pop(n) or insert() cases, so it may have a performance hit if you do a lot of list.insert(len(list)-2, x) or something like that
<arigo> maybe we should still do an item-by-item copy if there's, say, less than 5% of the array involved?
<antocuni> I'm not sure to understand enough of the problem to give a reasonable answer :)
<mattip> trying to understand the terminology, this part of rpython seems relevant
<arigo> fair enough, I'm anyway already having the problem that it's hard to test
<arigo> I *think* the branch is correct, and it doesn't do a lot
<arigo> all tests still pass
<arigo> but it's the kind of change that may end up in one reported obscure segfault next year
<antocuni> cool, so you will be in charge of debugging obscure segfaults until 16/06/2021
xcm has quit [Ping timeout: 260 seconds]
marky1991 has quit [Read error: Connection reset by peer]
marky1991_2 has joined #pypy
xcm has joined #pypy
<mattip> ahh, ok, so I have one now in NumPy
<mattip> of course it doesn't replicate on my machine
<mattip> might be some interaction with c++ compiled with c99
<bbot2> Success: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7021 [arigo: testing, wb_before_move]
YannickJadoul has joined #pypy
adeln has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7022 [arigo: testing, wb_before_move]
Ninpo^ is now known as Ninpo
kirma has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
thrnciar has quit [Remote host closed the connection]
<bbot2> Success: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7022 [arigo: testing, wb_before_move]
thrnciar has joined #pypy
jacob22 has quit [Quit: Konversation terminated!]
jacob22 has joined #pypy
xcm has quit [Ping timeout: 246 seconds]
xcm has joined #pypy
YannickJadoul has quit [Quit: Leaving]
xcm has quit [Ping timeout: 256 seconds]
xcm has joined #pypy
vstinner has left #pypy [#pypy]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
ofir has joined #pypy
adeln has quit [Remote host closed the connection]
adeln has joined #pypy
adeln has quit [Ping timeout: 258 seconds]
<ofir> Hi, I have 2 libraries libfoo.so and libbar.so. For both I use cffi to build the Python wrappers with cdefs and set_source("_lib", "#include "foo.h""))
<ofir> After calling ffibuilder, for the _foo.so ELF I do see libfoo.so in the dependencies list: readelf -d ./_foo.so
<ofir> but for _bar.so there is no libbar.so (in ldd / readelf -d) and so I can't "import _bar" (because of missing symbols).
<ofir> So the question is, any idea when the consumed library gets added to the ELF (i.e. NEEDED)?
xcm has quit [Remote host closed the connection]
adeln has joined #pypy
xcm has joined #pypy
Taggnostr has quit [Ping timeout: 256 seconds]
otisolsen70_ has quit [Quit: Leaving]
otisolsen70 has joined #pypy
adeln has quit [Ping timeout: 256 seconds]
<arigo> ofir: maybe you forgot to list "bar" in the libraries=["bar"] argument to set_source()?
<ofir> I'm passing it as extra_objects=[LIB_PATH]
<ofir> that's the only way I could get around the linker directories
<arigo> that's distutils/setuptools subtleties, I'm not sure what it does
<ofir> it simply adds it to the linker command line
<arigo> traditionally you'd pass it in libraries and use library_path or something
<ofir> so it's like: gcc _foo.o /path/to/libfoo.so -shared -o _foo.so
<ofir> as opposed to: gcc _foo.o -lfoo -shared -o _foo.so
<arigo> yes, I guess so, but I'm not sure what this does inside gcc
<arigo> sorry, it's library_dirs, not library_path
<ofir> that's interesting, if I replace the .so with what CMake built vs what I built manually, all of a sudden it is added to the DT_NEEDED in the ELF
Taggnostr has joined #pypy
<ofir> I work via VSCode and I use F7 (Build with CMake) to generate the SO's I consume
<ofir> arigo: what is the equivalent in the kwargs for set_source for linker directories?
<arigo> library_dirs
<ofir> I would like the following: -l<lib> -L<dir>
<ofir> ok let's try that
<ofir> nope same thing (although a nicer syntax)
<ofir> gcc/ the linker doesn't like what CMake produces
<arigo> make sure to call ffibuilder.compile(verbose=True)
<arigo> should help in debugging what's wrong
<ofir> thanks, yeah good stuff
<ofir> ok now I got it
thrnciar has quit [Ping timeout: 265 seconds]
<ofir> it's the darn name mangling
<ofir> or so it looks like, checking..
<ofir> yeap
<ofir> there should be a post on: "what your mama didn't tell you about extern "C""
<ofir> the linker will happily link and produce a CFFI wrapper _foo.so for you but will not add the dependencies it needs if you do not expose an "extern C" interface
<ofir> that's a bit counter-intuitive, I would've expected it to not find the mangled name and fail way earlier..
<ofir> arigo: did you ever try to pass a C function pointer to a CFFI function?
<ofir> I have my module.py that instantiates some memory allocator C++ class (MemAllocator) in _foo.so, and _bar.so needs to use that MemAllocator instance, so the Python becomes a pipe.
epony has quit [Ping timeout: 258 seconds]
adeln has joined #pypy
BPL has quit [Quit: Leaving]
adeln has quit [Ping timeout: 260 seconds]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<arigo> ofir: you can pass C function pointers around, but I don't know if there are specific issues with C++
<njs> arigo: does the daemon thread trick for leaking an object not work reliably in all python versions? obviously it's gross, but it seems like semantically it gives the right guarantees...
<ofir> arigo: cffi is amazing
epony has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
otisolsen70 has quit [Quit: Leaving]
mattip has quit [Ping timeout: 256 seconds]
mattip has joined #pypy
toad_polo has quit [*.net *.split]
raekye has quit [Ping timeout: 256 seconds]
raekye has joined #pypy
mattip has quit [Ping timeout: 256 seconds]
lritter has quit [Ping timeout: 256 seconds]
salotz[m] has quit [*.net *.split]
dstufft has quit [*.net *.split]
mattip has joined #pypy
Taggnostr has quit [Ping timeout: 256 seconds]
Taggnostr has joined #pypy
dstufft has joined #pypy
salotz[m] has joined #pypy
toad_polo has joined #pypy
xcm has quit [Remote host closed the connection]
marky1991_2 has quit [Ping timeout: 260 seconds]
xcm has joined #pypy
trfl has quit [Quit: ZNC - http://znc.in]
toad_polo has quit [*.net *.split]
trfl has joined #pypy
salotz[m] has quit [*.net *.split]
dstufft has quit [*.net *.split]
jcea has quit [*.net *.split]
lastmikoi has quit [*.net *.split]
_aegis_ has quit [*.net *.split]
Taggnostr has quit [*.net *.split]
whitewolf has quit [*.net *.split]
the_rat has quit [*.net *.split]
marmoute_ has quit [*.net *.split]
Lightsword has quit [*.net *.split]
shodan45 has quit [*.net *.split]
bbot2 has quit [*.net *.split]
tumbleweed has quit [*.net *.split]
Hodgestar has quit [*.net *.split]
the_drow[m] has quit [*.net *.split]
tazle has quit [*.net *.split]
kbtr_ has quit [*.net *.split]
Ashleee has quit [*.net *.split]
gutworth has quit [*.net *.split]
larstiq_ has quit [*.net *.split]
mvantellingen has quit [*.net *.split]
lauren has quit [*.net *.split]
idnar has quit [*.net *.split]
ctismer has quit [*.net *.split]
inhahe has quit [*.net *.split]
stillinbeta has quit [*.net *.split]
string has quit [*.net *.split]
EWDurbin has quit [*.net *.split]
WGH has quit [*.net *.split]
jneen_ has quit [*.net *.split]
pjenvey has quit [*.net *.split]
catern has quit [*.net *.split]
pulkit25 has quit [*.net *.split]
dnshane has quit [*.net *.split]
Graypup_ has quit [*.net *.split]
astronavt has quit [*.net *.split]
ammar2 has quit [*.net *.split]
rjarry has quit [*.net *.split]
alcarithemad has quit [*.net *.split]
trfl has quit [*.net *.split]
Techcable has quit [*.net *.split]
tos9 has quit [*.net *.split]
dansan has quit [*.net *.split]
xcm has quit [*.net *.split]
[Arfrever] has quit [*.net *.split]
Ninpo has quit [*.net *.split]
Rhy0lite has quit [*.net *.split]
alexge50 has quit [*.net *.split]
agates[m] has quit [*.net *.split]
mwhudson has quit [*.net *.split]
holdsworth_ has quit [*.net *.split]
pmp-p has quit [*.net *.split]
kanaka has quit [*.net *.split]
energizer has quit [*.net *.split]
Kronuz has quit [*.net *.split]
glyph has quit [*.net *.split]
jvesely has quit [*.net *.split]
DRMacIver has quit [*.net *.split]
wooster has quit [*.net *.split]
avakdh_ has quit [*.net *.split]
marvin_ has quit [*.net *.split]
ulope has quit [*.net *.split]
mgedmin has quit [*.net *.split]
runciter has quit [*.net *.split]
dmalcolm has quit [*.net *.split]
lazka has quit [*.net *.split]
camelCaser has quit [*.net *.split]
bogner has quit [*.net *.split]
dustinm has quit [*.net *.split]
_habnabit has quit [*.net *.split]
jerith has quit [*.net *.split]
njs has quit [*.net *.split]
commandoline has quit [*.net *.split]
samth has quit [*.net *.split]
fangerer___ has quit [*.net *.split]
ronan has quit [*.net *.split]
andi- has quit [*.net *.split]
rubdos has quit [*.net *.split]
fijal has quit [*.net *.split]
Alex_Gaynor has quit [*.net *.split]
Civil has quit [*.net *.split]
sknebel has quit [*.net *.split]
Olorin has quit [*.net *.split]
JStoker has quit [*.net *.split]
arigo has quit [*.net *.split]
antocuni has quit [*.net *.split]
tbodt has quit [*.net *.split]
epony has quit [*.net *.split]
raekye has quit [*.net *.split]
epsilonKNOT has quit [*.net *.split]
iko has quit [*.net *.split]
graingert has quit [*.net *.split]
michelp has quit [*.net *.split]
cfbolz has quit [*.net *.split]
kipras`away has quit [*.net *.split]
gsnedders has quit [*.net *.split]
jiffe has quit [*.net *.split]
eregon_ has quit [*.net *.split]
atomizer has quit [*.net *.split]
riddle has quit [*.net *.split]
mattip has quit [*.net *.split]
ofir has quit [*.net *.split]
dddddd has quit [*.net *.split]
oberstet has quit [*.net *.split]
kenaan has quit [*.net *.split]
ebarrett has quit [*.net *.split]
nopf has quit [*.net *.split]
danilonc has quit [*.net *.split]
luizirber has quit [*.net *.split]
altendky has quit [Ping timeout: 260 seconds]
_aegis_ has joined #pypy
ronan has joined #pypy
andi- has joined #pypy
dansan has joined #pypy
tos9 has joined #pypy
Techcable has joined #pypy
[Arfrever] has joined #pypy
trfl has joined #pypy
whitewolf has joined #pypy
Taggnostr has joined #pypy
lauren has joined #pypy
xcm has joined #pypy
commandoline has joined #pypy
_habnabit has joined #pypy
jerith has joined #pypy
bogner has joined #pypy
dustinm has joined #pypy
camelCaser has joined #pypy
lazka has joined #pypy
dmalcolm has joined #pypy
runciter has joined #pypy
njs has joined #pypy
mgedmin has joined #pypy
tazle has joined #pypy
dnshane has joined #pypy
ulope has joined #pypy
idnar has joined #pypy
pulkit25 has joined #pypy
mvantellingen has joined #pypy
Civil has joined #pypy
JStoker has joined #pypy
Olorin has joined #pypy
Alex_Gaynor has joined #pypy
sknebel has joined #pypy
fijal has joined #pypy
rubdos has joined #pypy
samth has joined #pypy
Kronuz has joined #pypy
energizer has joined #pypy
holdsworth_ has joined #pypy
WGH has joined #pypy
string has joined #pypy
EWDurbin has joined #pypy
stillinbeta has joined #pypy
danilonc has joined #pypy
ebarrett has joined #pypy
kenaan has joined #pypy
oberstet has joined #pypy
nopf has joined #pypy
dddddd has joined #pypy
mattip has joined #pypy
larstiq_ has joined #pypy
Ashleee has joined #pypy
gutworth has joined #pypy
kbtr_ has joined #pypy
marmoute_ has joined #pypy
the_rat has joined #pypy
shodan45 has joined #pypy
rjarry has joined #pypy
Lightsword has joined #pypy
ammar2 has joined #pypy
alcarithemad has joined #pypy
jcea has joined #pypy
lastmikoi has joined #pypy
Graypup_ has joined #pypy
astronavt has joined #pypy
ctismer has joined #pypy
Ninpo has joined #pypy
alexge50 has joined #pypy
arigo has joined #pypy
tbodt has joined #pypy
fangerer___ has joined #pypy
inhahe has joined #pypy
antocuni has joined #pypy
luizirber has joined #pypy
bbot2 has joined #pypy
Hodgestar has joined #pypy
tumbleweed has joined #pypy
kanaka has joined #pypy
pmp-p has joined #pypy
mwhudson has joined #pypy
pjenvey has joined #pypy
jneen_ has joined #pypy
catern has joined #pypy
_whitelogger has joined #pypy
gsnedders has joined #pypy
the_drow[m] has joined #pypy
graingert has joined #pypy
agates[m] has joined #pypy
salotz[m] has joined #pypy
toad_polo has joined #pypy
adeln has joined #pypy
adeln has quit [Ping timeout: 256 seconds]
xcm has quit [Ping timeout: 240 seconds]