arigato 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 | mac OS and Fedora are not Windows
rindolf has quit [Ping timeout: 246 seconds]
antocuni has quit [Ping timeout: 258 seconds]
altendky has joined #pypy
asmeurer_ has quit [Quit: asmeurer_]
moei has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
jcea has quit [Quit: jcea]
garetjax has joined #pypy
garetjax has left #pypy [#pypy]
dddddd has quit [Remote host closed the connection]
PileOfDirt has quit [Remote host closed the connection]
Tsundere_cloud has joined #pypy
Speeder39 has joined #pypy
Speeder39 has quit [Client Quit]
antocuni has joined #pypy
forgottenone has joined #pypy
<mattip> fijal: vmprof-1.13 is broken on linux without libunwind (like our buildbots)
<mattip> apparently libbacktrace, requires libunwind
altendky has quit [Quit: Connection closed for inactivity]
Tsundere_cloud has quit [Quit: Connection closed for inactivity]
kanaka has joined #pypy
kanaka has quit [Changing host]
kanaka has joined #pypy
<mattip> buildbots should not be trying to build vmprof-python
<kenaan> mattip default bc4cf55dc154 /requirements.txt: require binary vmprof since building from source requires libunwind on linux
<kenaan> mattip py3.6 018e437e5061 /: merge default into branch
forgottenone has quit [Ping timeout: 245 seconds]
nunatak has joined #pypy
nunatak has quit [Quit: Leaving]
<mjacob> arigato: so if a branch has one open head and a closed one, you want to add a new changeset on top of the open one that pretends to have the closed one as a parent?
<mjacob> arigato: i can't think of another way to do this
<mjacob> arigato: note that clean_old_branches.py gets rid of *topological* heads, but not heads
dddddd has joined #pypy
rindolf has joined #pypy
<fijal> that probably should not be the case
inhahe has quit []
Ai9zO5AP has joined #pypy
xcm has quit [Read error: Connection reset by peer]
xcm has joined #pypy
inhahe has joined #pypy
<cfbolz> fijal: pypy 2 or 3?
<fijal> cfbolz: 2
<cfbolz> ouch
<cfbolz> can reproduce
<cfbolz> looking into it
<cfbolz> weeeeeird
marky1991 has joined #pypy
<kenaan> cfbolz default e19e79b1385f /pypy/objspace/std/: fix bug: when a newdict(instance=True) was switching its strategy, it lost its content
<cfbolz> fijal: fixed
<antocuni> wow, it's impressive that nobody noticed this earlier
<antocuni> I suppose it means that users became more well-behaved and don't put hundreds of attributes on instances?
<Alex_Gaynor> or people just don't have tests so they don't know their program is broken
<cfbolz> no no
<cfbolz> this is specifically about __pypy__.newdict(instance=True)
<cfbolz> if you actually make an instance and use its dict, you are fine
<antocuni> ah, why is it different?
<cfbolz> complicated reasons
<cfbolz> by default, instances don't even have a dict, of course
<cfbolz> and if you request it, you get a MapDict, which is just a reference to the object. the object gets a reference to the dict too, so that identity is preserved
<cfbolz> in the __pypy__.newdict(instance=True) we internally make an instance and use that as the backing storage for the dict we return
<cfbolz> but we forgot to add the reference from the object to the dict
<cfbolz> and then more or less random stuff happens
<antocuni> yeah, I can imagine
<antocuni> the usual fun stuff
<cfbolz> anyway, it's not like __pypy__.newdict(instance=True) is used that often
<cfbolz> and it seems people are really not adding hundreds of attributes to functions (which are also using such a dict)
* antocuni --> lunch
antocuni has quit [Ping timeout: 258 seconds]
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 [Remote host closed the connection]
marky1991 has joined #pypy
jcea has joined #pypy
marky1991_2 has joined #pypy
marky1991 has quit [Ping timeout: 258 seconds]
marky1991_2 has quit [Remote host closed the connection]
marky1991_2 has joined #pypy
antocuni has joined #pypy
nunatak has joined #pypy
nunatak has quit [Quit: Leaving]
<antocuni> what happened to vmprof? I have read on github that 0.4.13 is available only as a .tar.gz, but why?
altendky has joined #pypy
marky1991_2 has quit [Ping timeout: 268 seconds]
dayton has joined #pypy
<krono> I ran a rpython vm wiht PYPYLOG=....:jit-backend-counts:.. but in the resulting log, the backend count region is empty. what could be the reason? any translation flags?
<dayton> Hi all
<dayton> Is there a special way to declare variadic functions in cffi?
<dayton> When I write the declaration like I would in a c header file. The wrapper builds fine but at import time in python, it throws an error about missing symbols for the variadic function
lritter has joined #pypy
mattip has quit [Ping timeout: 248 seconds]
mattip has joined #pypy
Taggnostr has quit [Remote host closed the connection]
Taggnostr has joined #pypy
marky1991 has joined #pypy
Rhy0lite has joined #pypy
ajlawrence has joined #pypy
forgottenone has joined #pypy
<cfbolz> krono: how up to date is your rpython?
ajlawrence has quit [Ping timeout: 256 seconds]
tsaka__ has quit [Ping timeout: 258 seconds]
<rindolf> antocuni: we are in the same boat. i ended up using https://docs.python.org/3/library/profile.html
<krono> cfbolz: that particular one is from novemver 2016
<krono> ('too old' would good enough an answer for me…)
<ronan> rindolf: you should be able to just fallback to 0.4.12
<rindolf> ronan: what?
<ronan> rindolf: the problem is that 0.4.13 is source-only, but there are binary wheels for 0.4.12
<rindolf> ronan: antocuni was the asker
<rindolf> ronan: i was able to run vmprof but it gave bad results
<cfbolz> krono: yes, this is a bug that was fixed in the meantime
tsaka__ has joined #pypy
<krono> cfbolz: thanks, that helps
<ronan> rindolf: beware that profile is rather misleading on pypy
<rindolf> ronan: ok
<rindolf> ronan: vmprog gave unusable output here
<ronan> what sort of code were you profiling?
<rindolf> ronan: let me pastesite it
<rindolf> ronan: it is a wip sol for https://projecteuler.net/problem=596
<ronan> rindolf: what sort of result did you expect though? All the computation seems to happen in a single function
<rindolf> ronan: it didnt tell me what it was
<rindolf> ronan: only 100% in internal funcs
<ronan> hmm, I'll look into it
<antocuni> yes, my question is *why* 0.4.13 is source only. I think we should have an automated build/release system which always does the right thing
Lightsword has quit [Read error: Connection reset by peer]
antocuni has quit [Ping timeout: 272 seconds]
<ronan> rindolf: I think the issue is that you crashed vmprof by raising BaseException and corrupted the log
<rindolf> ronan: ah
mvantellingen has quit [Ping timeout: 252 seconds]
<rindolf> ronan: thanks! it works better now
<rindolf> ronan: if i dont raise an exc i mean
Lightsword has joined #pypy
<ronan> rindolf: I think the way vmprof behaves when the user code raises is a bit weird
tsaka__ has quit [Ping timeout: 268 seconds]
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
<rindolf> ronan: ah, ok
mvantellingen has joined #pypy
mvantellingen has quit [Ping timeout: 252 seconds]
<cfbolz> ronan: sounds like we should fix that?
tsaka__ has joined #pypy
<ronan> cfbolz: yes, but I'm not sure how
<cfbolz> ronan: we should write the profile even if Base Exception is raised, imo
<cfbolz> Or did you mean profile?
<ronan> cfbolz: well, there's 3 things that should probably happen after an exception is raised: cleaning up resources (includes actually writing the profile), showing some output, and displaying the original traceback
<ronan> but I'm not sure about the order
<ronan> also, we currently swallow KeyboardInterrupt and SystemExit, and I don't know if that's right
mvantellingen has joined #pypy
xcm has quit [Read error: Connection reset by peer]
<dayton> Hey, where can I get help with cffi?
xcm has joined #pypy
<ronan> dayton: this is the place
<cfbolz> dayton: here is ok, usually. But I didn't have anything constructive to answer about the varargs question, sorry :-(
<mattip> dayton: can you share a concise reproducer, and what OS/python?
<dayton> This is the code I'm using to create the wrapper and at the bottom is the particular function that it's throwing the no symbols defined error for
<dayton> Error occurs at import time
<dayton> If I remove the functions with varargs from the cdef then the wrapper works fine
marvin_ has quit [Remote host closed the connection]
marvin_ has joined #pypy
<ronan> dayton: what's the error?
<dayton> This is the error
<dayton> Not sure if it matters but when I check the symbols on the generated shared library
<dayton> The names are like this __cffi_d_BB_AddFallThroughBuilder
<dayton> But like this for functions with varargs __cffi_const_BB_AddSuccessorBuildersWithArgArray_v
marvin_ has quit [Remote host closed the connection]
marvin_ has joined #pypy
<mattip> seems like maybe some kind of name mangling with a c++ compiler
<dayton> Yeah, I read the docs and it suggests that the way I did it is correct. Guess I'll have to keep digging
<dayton> Thanks
<cfbolz> dayton: which library is that?
<dayton> It's JitBuilder from the Eclipse omr project
<mattip> the example https://pastebin.com/bHfpt0QE is very incomplete. Are you using extern "C"? Are you using any compiler flags?
<cfbolz> dayton: right, so it *is* C++
<dayton> mattip oh my bad, I just posted a snippet since the cdef section is quite long
<dayton> cfbolz: yeah, just a C wrapped C++ library
<mattip> can you wrap the cdef in a extern "C" block : cdef = 'extern "C" {' + f.read() + '}'
<mattip> or so
<mattip> or does jitbuilder_cdef.h already do that?
<mattip> I forget the rules, I think if JitBuilder.h does not include function declarations from jitbuilder_cdef.h with extern "C" then you need to decorate each function there too
<dayton> The declarations in JitBuilder.h are already extern "C"
<dayton> JitBuilder.h also includes some some other headers
<dayton> The Jitbuilder.cdef.h is just all of these declarations in a single file to pass to ffi.cdef
<mattip> hmmm. If they all are extern "C", why is the name being mangled?
<ronan> mattip: cffi does the mangling
<dayton> When I tried adding extern "C" to jitbuilder.cdef.h I get a cdeferror cannot parse extern C
<dayton> Yeah I think it's from the cffi side. The names aren't being mangled in the static library I'm linking against
<dayton> Thatbis my setup.py
<dayton> I'm on macos Mojave, python 3.7.3, clang: Apple llvm version 10.0.1
<mattip> Can you reduce the problem to that single function, and provide a complete reproducer?
<mattip> or one single function
alexeyan1 has joined #pypy
<dayton> mattip: do you mean just the build file with the cffi setup?
alexeyan1 has left #pypy [#pypy]
<mattip> a complete example with all the bits and pieces needed to reproduce, perferably with as much cruft as possible cut away
Alexeyan has joined #pypy
<Alexeyan> Hi, how can i make pypy3 work on ubuntu 1904, which only ships openssl1.1? It seems https://travis-ci.community/t/pypy-3-5-v6-0-0-inconsistent-openssl-bindings/1614 is still unchanged.
<mattip> since you said only the varargs functions cause problems, they are the only ones that need appear in the example
<dayton> That's the cffi build file with only the varargs function
<dayton> That's a simple script to reproduce the error
<dayton> The error and setup.py are the same as before
<dayton> I used: python3 setup.py build_ext --inplace to build the library
<dayton> And error occurs on line 1, during import
<mattip> better, but I still can't use that, I don't have JitBuilder.h nor libjitbuilder.a for my platform, ubuntu
<mattip> Alexeyan: can you use a nightlt build from http://buildbot.pypy.org/nightly/py3.6/ ?
<dayton> That's gonna be a bit trickier. That would require setting up omr and building for your platform πŸ˜“
<dayton> I can build it in a VM but how would I get the files to you?
<mattip> Alexeyan: we recently refactored pypy2 to use the same _ssl build based on cffi and the cryptography package
marvin_ has quit [Remote host closed the connection]
<mattip> dayton: yeah, that won't work, I have to go do something else anyway
<dayton> Okay, no prob. I'll keep at it
<dayton> Thanks
marvin has joined #pypy
<Alexeyan> mattip: How does the pypy2 refactor help? Or was that a typo?
<mattip> dayton: so maybe try the opposite: play with a simple C source file that defines BB_AddSuccessorBuildersWithArgArray_v
<mattip> until you get it to fail
<dayton> Yeah I'm gonna try that
<mattip> Alexeyan: both can now be rebuilt on the fly to whatever OpenSSL library you happen to have
<mattip> both _ssl modules
marvin has quit [Remote host closed the connection]
marvin has joined #pypy
Rhy0lite has quit [Quit: Leaving]
marky1991 has quit [Read error: Connection reset by peer]
dayton has quit [Quit: Connection closed for inactivity]
rindolf has quit [Ping timeout: 248 seconds]
moei has quit [Quit: Leaving...]
forgottenone has quit [Quit: Konversation terminated!]