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
joannah has joined #pypy
kbtr has quit [Quit: leaving]
kbtr has joined #pypy
joannah has quit [Remote host closed the connection]
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
zmt01 has joined #pypy
zmt00 has quit [Ping timeout: 256 seconds]
asmeurer has joined #pypy
zmt01 has quit [Ping timeout: 240 seconds]
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
xcm is now known as Guest47769
Guest47769 has quit [Read error: Connection reset by peer]
xcm has joined #pypy
zmt00 has joined #pypy
zmt01 has joined #pypy
zmt01 has quit [Remote host closed the connection]
xcm has quit [Remote host closed the connection]
zmt00 has quit [Ping timeout: 240 seconds]
xcm has joined #pypy
zmt00 has joined #pypy
adamholmberg has quit [Remote host closed the connection]
jcea has quit [Quit: jcea]
adamholmberg has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
camelCaser has quit [Ping timeout: 255 seconds]
camelCaser has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
asmeurer has quit [Quit: asmeurer]
adamholmberg has quit [Remote host closed the connection]
zmt01 has joined #pypy
adamholmberg has joined #pypy
zmt00 has quit [Ping timeout: 265 seconds]
zmt01 has quit [Ping timeout: 240 seconds]
zmt00 has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
otisolsen70 has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
jvesely has quit [Ping timeout: 256 seconds]
jvesely has joined #pypy
_whitelogger has joined #pypy
tsaka_ has quit [Ping timeout: 272 seconds]
dddddd has quit [Ping timeout: 265 seconds]
adamholmberg has quit [Remote host closed the connection]
luizirber has quit [Ping timeout: 265 seconds]
adamholmberg has joined #pypy
luizirber has joined #pypy
xcm has quit [Ping timeout: 240 seconds]
xcm has joined #pypy
<cfbolz> What's wrong with the nightly test runs?
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
<Dejan> E CalledProcessError: Command '['virtualenv', '-p', '/build_dir/pypy-c-jit-linux-x86-64/venv/pypy-venv/bin/pypy', '/tmp/ffi-189/setuptools_package_2-cpy']' returned non-zero exit status 1
<Dejan> looks like something got misconfigured in the environment
<Dejan> no looks like something else is the problem
<Dejan> different builders show different errors
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
tsaka_ has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
lritter has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
infernix has quit [Ping timeout: 246 seconds]
infernix has joined #pypy
ekaologik has joined #pypy
Smigwell has joined #pypy
camelCaser has quit [Ping timeout: 256 seconds]
camelCaser has joined #pypy
ekaologik has quit [Quit: https://quassel-irc.org - Komfortabler Chat. Überall.]
jvesely has quit [Quit: jvesely]
dddddd has joined #pypy
isuruf has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
isuruf has quit [Ping timeout: 240 seconds]
jcea has joined #pypy
jvesely has joined #pypy
<antocuni> arigato: I found a bug in pypy.module.hpy_universal.llapi, and I'm not sure why we wrote things that way
<antocuni> in particular, we have ONE global ctx, which is defined in C by llapi.eci (in separate_module_sources)
<antocuni> and the State accesses it by calling llapi._HPy_GetGlobalCtx()
<antocuni> this is a problem in tests because if we happen to have multiple spaces around (e.g., one with and one without cpyext), the ctx will be shared among them. The easy workaround is to remove "if self.ctx: return" from State.setup(), to force reinitialization of it
<antocuni> but the more proper fix is to lltype.malloc() a ctx in State.setup()
<antocuni> so my question is: why did we choose this very indirect way to defining a global ctx?
<antocuni> ronan: ^^^ this is a question for you too
jvesely has quit [Quit: jvesely]
<antocuni> uhm, looking at the history, it might be a leftover of 5d81fcd424a5, where we had an _HPy_FillFunction to write into hpy_global_ctx
<antocuni> ok, let me try to fix this, and let me try to use an hg topic :)
<antocuni> ok, now I have the hpy branch, and I made a commit on top of it using the topic "remove-global-ctx"
<antocuni> how do I "merge" the topic into the main hpy branch from the command line?
<antocuni> also, am I wrong or gitlab sees it as if it were a completely different branch (topic/hpy/remove-global-ctx)? https://foss.heptapod.net/pypy/pypy/commit/9c04e418f02322d5a6cf8f24443ba2db38b5d725
<marmoute> antocuni: the topic "fade away"
<marmoute> when the changeset become public.
<marmoute> you can use `hg phase --public --rev .` or `hg push --publish --rev .`
<antocuni> marmoute: what happens if I have multiple heads in the branch? I.e., I keep committing on the head without the topic AND on the head with the topic
<marmoute> then you want to merge or rebase the topic before doing that
<marmoute> If you go on the branch head, and merge the topic (and commit). the merge will be automatically published on push and the topic will fade away
<antocuni> yes, but what happens if I don't? Will the server refuse the push?
<antocuni> marmoute: btw, "hg push --publish --rev ." worked, thank you!
<marmoute> antocuni: the server have a strong rejection of multiple heads on the names
<marmoute> So yes it will rejet the push
<antocuni> good :)
_whitelogger has joined #pypy
jvesely has joined #pypy
cffiusr has joined #pypy
cffiusr has quit [Changing host]
cffiusr has joined #pypy
<cffiusr> hi, how do I set an @ffi.def_extern function as a function pointer in cffi ?
<cffiusr> I get "TypeError: intiializer for ctype 'function pointer...' must be a cdata pointer, not function
<cffiusr> ahh, lib.func_name..
<Dejan> what do you guys use to find memory leaks? I am trying to use pympler but all it does is giving me a summary saying that list takes 1.x G of RAM
<cffiusr> how do I convert a python object to void* (in a python callback) ?
<Dejan> cffiusr, I can't help with that :( I never used cffi
dddddd has quit [Ping timeout: 260 seconds]
dddddd has joined #pypy
<cffiusr> yeah, now I have another problem
<cffiusr> I have a function that expects an void** and returns me that python object
<cffiusr> should I do ptr = ffi.new("void **") pass the ptr to the function as is, and then ffi.from_handle(ptr[[0]) ?
<cfbolz> cffiusr: yes, that sounds like a plan
<cffiusr> the program crashes, saying it might have been GC
<cffiusr> I put the object in a dictionary in the python callback, but it still doesn't help
<cfbolz> cffiusr: do you keep the handle alive?
<cffiusr> ohh, the handle, not the object it's from ?
<cfbolz> yes, the handle
<cffiusr> how should I go about keeping it alive (in this case it's a python string)
<cfbolz> cffiusr: can you paste a bit of the code that you are writing for that function call?
<cffiusr> yep, sec
<cffiusr> got it to work, will paste
<cffiusr> https://bpaste.net/SDZA is this the best way ?
<cffiusr> (it's only the start of the implmentation)
<cfbolz> the link is broken
<cfbolz> get a 404
<cfbolz> cffiusr: hm, that looks fine to me :-(
<cfbolz> don't know why it crashes
<cffiusr> no, I said I fixed it, i.e. it works now
<cffiusr> just wodnering if putting it in a set, is the proper way
<cfbolz> ah, sorry
jcea has quit [Ping timeout: 256 seconds]
<cfbolz> cffiusr: set is fine, yes
<cffiusr> I wonder how slow this will be from the pure c-api version of hiredis parser, will check
jcea has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/5768 [Carl Friedrich Bolz-Tereick: force build, default]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6860 [Carl Friedrich Bolz-Tereick: force build, default]
<bbot2> Started: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8064 [Carl Friedrich Bolz-Tereick: force build, default]
<bbot2> Started: http://buildbot.pypy.org/builders/own-linux-x86-32/builds/7022 [Carl Friedrich Bolz-Tereick: force build, default]
bitbit has joined #pypy
bitbit has quit [Max SendQ exceeded]
bitbit has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-32/builds/7022 [Carl Friedrich Bolz-Tereick: force build, default]
ekaologik has joined #pypy
MatrixBridge has joined #pypy
MatrixBridge has left #pypy ["User left"]
<cffiusr> cfbolz: is it easy to call the python c api from cffi ?
<cfbolz> no, that's not really supported
<cfbolz> the point of cffi is to not have to interact with the C API
mattip has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8064 [Carl Friedrich Bolz-Tereick: force build, default]
<cffiusr> k, i''ll do [None] * length
<cffiusr> cfbolz: can I take a char* and make cffi return it as a unicode directly?
<cffiusr> i.e. without an tmp copy
bitbit has quit [Quit: Leaving]
<cfbolz> cffiusr: what do you mean by tmp copy?
<cffiusr> char * -> bytes object -> str object
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6860 [Carl Friedrich Bolz-Tereick: force build, default]
<cffiusr> cfbolz: PyUnicode_FromStringAndSize
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/5768 [Carl Friedrich Bolz-Tereick: force build, default]
<cfbolz> cffiusr: ah. Good question
<cfbolz> You can turn a char* into a buffer without a copy, is there a way to decode a buffer?
ekaologik has quit [Ping timeout: 255 seconds]
<cfbolz> arigato: any idea?
<cffiusr> PyUnicode_Decode
Smigwell has left #pypy [#pypy]
<cffiusr> I want to call that actually somehow from char*
<cfbolz> cffiusr: no, you need to think on the python level
<cffiusr> yes, the python level will waste a copy I want to save
<cfbolz> cffiusr: you can't use the C API though
<cffiusr> yeah, it seems I can't save that call using cffi :/
<tos9> cffiusr: maybe you know this, but if you have a wchar* cffi already gives you a unicode object from that
<cffiusr> yeha, but I don't
<tos9> (/me should maybe then shut up about things he doesnn't know a ton about) but if you go char * -> wchar* in C land maybe that helps?
<cffiusr> nah, PyUnicode_Decode let's you choose the encoding
<cffiusr> rofl, my cffi version is 10 times slower than the hiredis c-api one :)
<cffiusr> well it was a nice experiment
<cfbolz> tos9: no, it doesn't, because it leads to another copy wchar* -> py unicode
<tos9> lah
<tos9> *ah
<tos9> cfbolz: (maybe I'll say one last thing about things I don't know about) but looks like you're writing a redis client of some sort? Which doesn't redis the protocol want bytes anyhow? why/where do you want unicode?
<tos9> er, cffiusr ^
<cfbolz> tos9: when you are reading data out, you want to turn the results into unicode, no?
<tos9> I wouldn't think so
<tos9> But maybe?
* tos9 looks at what redis-py gives on Py3
<tos9> looks like it does give strs, but yeah I dunno, not sure that's what I'd expect as a user but what do I know
<tos9> (for exactly this reason, that doing that would incur extra work that may not be necessary)
<tos9> and/or does redis say the values have to be valid UTF-8?
<cfbolz> no idea, I know nothing at all about redis
<tos9> oh! no, sorry, I lied
<tos9> for redis-py it says...
<tos9> "If the client's decode_responses is True, then the 'channel', 'pattern' and 'data' values will be automatically decoded to unicode strings using the client's charset"
<tos9> So it does fetch bytes, and then if the client says decode it decodes client-side
<tos9> And by default it gives you bytes
wleslie has quit [Quit: ~~~ Crash in JIT!]
ekaologik has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
andi- has quit [Ping timeout: 268 seconds]
wooster has quit [Remote host closed the connection]
msjyoo has quit [Remote host closed the connection]
string has quit [Remote host closed the connection]
pulkit25 has quit [Remote host closed the connection]
pulkit25 has joined #pypy
string has joined #pypy
wooster has joined #pypy
fangerer_ has quit [Remote host closed the connection]
avakdh has quit [Remote host closed the connection]
starlord has quit [Remote host closed the connection]
stillinbeta has quit [Write error: Connection reset by peer]
idnar has quit [Remote host closed the connection]
krono has quit [Remote host closed the connection]
msjyoo has joined #pypy
idnar has joined #pypy
avakdh has joined #pypy
stillinbeta has joined #pypy
starlord has joined #pypy
fangerer_ has joined #pypy
krono has joined #pypy
Alex_Gaynor has quit [Remote host closed the connection]
fijal has quit [Remote host closed the connection]
lauren has quit [Remote host closed the connection]
rguillebert has quit [Remote host closed the connection]
kcr has quit [Remote host closed the connection]
ctismer has quit [Remote host closed the connection]
kcr has joined #pypy
Alex_Gaynor has joined #pypy
fijal has joined #pypy
lauren has joined #pypy
ctismer has joined #pypy
reaperhulk has quit [Remote host closed the connection]
samth has quit [Remote host closed the connection]
jeroud has quit [Remote host closed the connection]
phlebas has quit [Remote host closed the connection]
rguillebert has joined #pypy
jeroud has joined #pypy
samth has joined #pypy
reaperhulk has joined #pypy
phlebas has joined #pypy
wallet42 has quit [Remote host closed the connection]
altendky has quit [Remote host closed the connection]
wallet42 has joined #pypy
altendky has joined #pypy
cffiusr has quit [Remote host closed the connection]
lritter has quit [Ping timeout: 256 seconds]
andi- has joined #pypy
otisolsen70 has quit [Ping timeout: 265 seconds]