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
deesix has quit [Read error: Connection reset by peer]
deesix has joined #pypy
jvesely has quit [Remote host closed the connection]
jvesely has joined #pypy
BPL has quit [Read error: Connection reset by peer]
adamholmberg has joined #pypy
adamholm_ has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
jcea has quit [Quit: jcea]
XorSwap has quit [Ping timeout: 240 seconds]
dddddd has quit [Remote host closed the connection]
mattip has joined #pypy
_whitelogger has joined #pypy
mattip has quit [Ping timeout: 256 seconds]
mattip has joined #pypy
adamholm_ has quit [Remote host closed the connection]
<mattip> nimaje: thanks, the whole idea there is hacky so yours is no worse than what is there
<mattip> added in 6796c2ea5276
dnshane has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
dnshane has joined #pypy
pepesza has quit [Ping timeout: 258 seconds]
Dejan has joined #pypy
Dejan has joined #pypy
Dejan has quit [Changing host]
rubdos has quit [Read error: Connection reset by peer]
rubdos has joined #pypy
mdash has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]
marky1991 has joined #pypy
YannickJadoul has joined #pypy
mattip has quit [Ping timeout: 256 seconds]
mattip has joined #pypy
dddddd has joined #pypy
lritter has joined #pypy
gracinet has joined #pypy
adamholmberg has joined #pypy
FullTiltProspect has joined #pypy
marky1991 has quit [Ping timeout: 264 seconds]
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
jcea has joined #pypy
<rjarry> arigo: I may have misunderstood what you advised about using `with` constructs along with `ffi.gc`
<rjarry> with ffi.gc(lib.lypy_node_fullname(self._node), lib.free) as s:
<rjarry> AttributeError: __enter__
<rjarry> wrong nick :D
<rjarry> maybe no
<rjarry> t
<rjarry> mattip: I did but I did not understand what I should do
* mattip not really up to speed
<mattip> you seem to be continuing a conversation that I only slightly remember seeing go by
<rjarry> yes that was a few days ago
<rjarry> basically, it was about ffi.gc(cdata, destructor) not calling destructor immediately upon the last reference disappearing
<rjarry> and being able to make this more deterministic by using `with xxx`
<rjarry> or try: finally:
<mattip> on pypy, right?
<rjarry> yes maybe only on pypy
<rjarry> but I wanted to make things right for cpython and pypy along the way
<rjarry> ffi.release() does not seem to make what I want
<mattip> so I don't think you need the "with ffi.gc", does "with lib.lypy_node_fullname(self._node), lib.free) as p:" work?
<rjarry> how could it work without ffi.gc ?
<mattip> "with lib.lypy_node_fullname(self._node) as s:" work?
<mattip> when s goes out of scope it is clear it needs to be released
<rjarry> I don't think so, the returned pointer is allocated insinde the C library
<rjarry> inside*
<rjarry> if I understand correctly, ffi.gc(cdata, destructor) adds a destructor to the first argument and returns it
<rjarry> but with cdata: does not work since cdata does not have __enter__ nor __exit__ methods
<rjarry> it appears I have to explicitly do
<rjarry> try:
<rjarry> cdata = lib.allocate_something()
<rjarry> return xxx(cdata)
<rjarry> finally:
<rjarry> lib.free(cdata)
<rjarry> but arigo was telling me about using `with` constructs
alexge50 has quit [Read error: Connection reset by peer]
<mattip> this works as advertised "cdata = ffi.new('int[10]'); with cdata: print(cdata[0])"
alexge50 has joined #pypy
<rjarry> not arigo, arigato...
<rjarry> 2020-03-20.log:[14:39:08] <arigato> with lib.gc(lib.lys_path(), lib.free) as p:
<rjarry> this does not work
XorSwap has joined #pypy
<mattip> ok, will have to wait for him to show up
<rjarry> yep, in the meantime, I'll fall back to try: finally:
gracinet has left #pypy [#pypy]
<mattip> rjarry: jsut to be clear: "with ffi.gc() as s:" fails? It works for me with cffi 1.14
<mattip> and I think it is even calling the free function in a toy example
LarstiQ has quit [Ping timeout: 240 seconds]
luizirber has quit [Ping timeout: 240 seconds]
bogner has quit [Ping timeout: 240 seconds]
<rjarry> hmm, I use 1.11.5
<rjarry> this may explain :)
LarstiQ has joined #pypy
luizirber has joined #pypy
bogner has joined #pypy
<mattip> yes, the documentation states 1.12+
<rjarry> ok
<rjarry> I'll stick with try:finally:
<mattip> +1: it is equivalent after all
<rjarry> yep
XorSwap has quit [Remote host closed the connection]
mattip has quit [Ping timeout: 240 seconds]
XorSwap has joined #pypy
mattip has joined #pypy
BPL has joined #pypy
xcm has quit [Ping timeout: 264 seconds]
epony has quit [Quit: reconfig]
xcm has joined #pypy
marky1991 has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
dddddd has quit [Remote host closed the connection]
XorSwap has quit [Ping timeout: 250 seconds]
XorSwap has joined #pypy
XorSwap has quit [Ping timeout: 256 seconds]
asmeurer has joined #pypy
rubdos has quit [Quit: WeeChat 2.7.1]
jacob22 has quit [Remote host closed the connection]
jacob22 has joined #pypy
dnshane has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
dnshane has joined #pypy
<mattip> OK, I figured out what is going on with the extra test failures in cffi0/test_zintegration, which tries to create a virtualenv
<mattip> we are already in a virtualenv, so the sys.real_prefix points to the old location "build/pypy"
<mattip> sorry, not build/pypy, just build
rubdos has joined #pypy
<mattip> but before we set up the first virtualenv, we call -m ensurepip which creates a bin directory to store pip, easy_install
<mattip> so now when we go to create the virtualenv-from-a-virtualenv, it sees the orinal location from real_prefix, sees it has a bin directory, but cannot find the executable there and borks
epony has joined #pypy
<cfbolz> mattip: ouch :-(
<mattip> easy enough to solve, assuming my analysis is correct
jacob22 has quit [Quit: Konversation terminated!]
bbot2 has quit [Quit: buildmaster reconfigured: bot disconnecting]
jacob22 has joined #pypy
marky1991 has quit [Ping timeout: 240 seconds]
marky1991 has joined #pypy
CrazyPython has joined #pypy
asmeurer has quit [Quit: asmeurer]
FullTiltProspect has quit [Ping timeout: 250 seconds]
CrazyPython has quit [Read error: Connection reset by peer]
Dejan has quit [Quit: Leaving]
deesix_ has joined #pypy
deesix has quit [Ping timeout: 256 seconds]
msjyoo has quit [Quit: Connection closed for inactivity]
dddddd has joined #pypy
deesix_ has quit [Quit: leaving]
bbot2 has joined #pypy
marky1991 has quit [Ping timeout: 265 seconds]
YannickJadoul has quit [Quit: Leaving]
_whitelogger has joined #pypy
marky1991 has joined #pypy
_whitelogger has joined #pypy
_whitelogger has joined #pypy
lritter has quit [Quit: Leaving]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6881 [Carl Friedrich Bolz-Tereick: force build, py3.7]
dmalcolm has quit [Ping timeout: 264 seconds]
marky1991 has quit [Ping timeout: 260 seconds]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6881 [Carl Friedrich Bolz-Tereick: force build, py3.7]