ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Fund Crystal's development: | GH: | Docs: | Gitter:
jrayhawk_ is now known as jrayhawk
Vexatos has quit [Quit: Client Quit]
Vexatos has joined #crystal-lang
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Client Quit]
ua_ has quit [Excess Flood]
ua_ has joined #crystal-lang
<FromGitter> <skinnyjames> Running into an interesting issue trying to work with libgit2 bindings - libgit2 passes the same payload of type`Void*` ( to each remote callback when cloning - so to intercept each callback from crystal, I have to pass an object containing all the callbacks (essentially a `{} of String => AliasForCallbackFunctions`) for each type. Boxing the
<FromGitter> ... object and passing it through causes an `invalid memory access` error, whereas not passing it does not. I've been able to pass single boxed blocks for callback values so far, wondering what I might be doing wrong here.
xiamx has joined #crystal-lang
<FromGitter> <> @skinnyjames: I'm fully sure that I could help you. also willing to do so. but can't look into it today. also maybe missing some details
<FromGitter> <> why do you need to pass an object containing all callbacks? why not just pass a class instance with normal methods?
<FromGitter> <skinnyjames> No worries! I'm noticing that it doesn't actually matter what value I send, so i think something might be wrong with the binding. Happy to provide more information tomorrow
<FromGitter> <skinnyjames> I think I'm wanting the callbacks to be defined by the consumer of the lib.
<FromGitter> <skinnyjames> something like: ⏎ ⏎ ```code paste, see link``` []
<FromGitter> <> @skinnyjames: what's the implementation of `on_credentials_acquire` ?
<FromGitter> <> I'd think that it should be `@on_credentials_acquirw = block`
<FromGitter> <> if so, that can be a getter on some object
<FromGitter> <> and then you just box that object and pass that as Void*
<FromGitter> <skinnyjames> for sure, I tried that too
<FromGitter> <> then can we perhaps look at the code from when you tried this?
<FromGitter> <skinnyjames> yeah one sec
<FromGitter> <skinnyjames> I'm currently noticing that it blows up if I pass `"hello")` as the payload
<FromGitter> <skinnyjames> so it is probably unrelated
<FromGitter> <> weird 🤔 ⏎ how do you unbox? maybe there's just some basic mistake ¯\\\_(ツ)_/¯
<FromGitter> <skinnyjames> it blows up without unboxing
<FromGitter> <skinnyjames> I think the bindings might be messed up? (I'm definitely still learning
<FromGitter> <> the thing is, if you box something, you need to store that persistently as an instance variable or whatever. so that could be what's missing
<FromGitter> <> bindings could be messed up too, who knows
<FromGitter> <skinnyjames> hmmm
<FromGitter> <> if you could publish the code in a way that one can just run it and see the crash, that'd be quite a productive way to try to solve this. though i probably won't get to it today
<FromGitter> <skinnyjames> yup! sorry it's pretty divergent at the moment, I'll clean it up and push a branch
<FromGitter> <skinnyjames> Was trying to debug, so I commented out the specs
<FromGitter> <skinnyjames> curious though what this means: `int (*)(git_remote_completion_t, void *)` in the context of a callback function. ⏎ I feel like I'm misinterpreting it
taupiqueur has joined #crystal-lang
taupiqueur has quit [Ping timeout: 240 seconds]
taupiqueur has joined #crystal-lang
taupiqueur has quit [Ping timeout: 260 seconds]
Guest369 has joined #crystal-lang
Guest369 has quit [Client Quit]
notzmv has quit [Ping timeout: 260 seconds]
notzmv has joined #crystal-lang