[06:55] Hm. [06:56] You know, we *could* drop the `extern "C"` on our platform interfaces, and rely on `mir::SharedLibrary::load_function<>` to get the right symbol. [06:56] That would prevent this bug, and also some UB. [07:25] Hm. [07:25] And it would only require relying on a little implementation-defined behaviour. [07:25] I'm actually warming to the idea. [07:49] I'm curious what UB problem you're talking about, but I guess I'll find out when you PR a solution [07:51] We throw exceptions across extern "C" boundaries. [07:52] * RAOF is not actually going to PR a solution to that, because it turns out to involve implementing an Itanium ABI name mangler. [08:09] That one. Yeah. The approach I would take is to embed a hard-coded lookup table for the mangled names. But I've been sufficiently motivated [08:11] *not been [08:13] A function-only name mangler would not be a particularly terrible task, but 🤷‍♀️. [08:14] A name mangler is really something for std:: [08:14] I mean, yes. [08:14] Although it's implementation defined, so the standard wouldn't really have a lot to say about it. [08:15] That's the point: the standard can say "do what the implementation does" [08:15] type_info::name() gets you everything but what we want, too :) [08:15] Yeah, it'd totally be a useful addition to std:: [08:22] Anyway! Today: [08:22] * (very nearly) Plumbed "only load RenderingPlatforms that can drive at least one display" probing through [08:22] * Did a little investigation into how to make our symbol loading nicer, particularly catching errors at compile time (prompted by the probing change causing segfaults due to a signature change). [08:22] * Decided that it's tractable, but not for now 😉 [08:22] Oh, no. [08:22] It's actually even more tractable, isn't it? [08:23] type_info::name() gives us everything but what we want, but string concatenation should be able to take us the rest of the way? [08:25] Damn. [08:25] Now I'll think about it more 🤦‍♀️ [08:41] Relying on unspecified behaviour isn't a whole lot better than relying on undefined behaviour. Just because we know g++/clang++ return the mangled name doesn't make it safe [09:00] Damn! You got me thinking about it again. Mangling correctly is hard without the compilation context (it needs to know about macros, typedefs and using declarations - and, for some cases, the current function name). It is probably possible from the clang AST, but that's, at best, an extra compilation pass. [09:09] Right, but we don't need a general-purpose mangler; we just need to be able to mangle free-functions not in a namespace. [09:11] We actually only need a few known functions - a lookup table will suffice [09:12] That's true. [09:13] We could also automate that in the build process, right? Build an object exposing that symbol, read the mangled name out of objdump. [09:14] Or, because we only have a list of like 5 symbols, not bother. [09:16] Or, because throwing exceptions through extern "C" works for the implementations we use, not bother [16:48] Today: [16:48] * Got a "working" spike of drag-n-drop [16:48] Note: Monday is a public holiday here, and I'm taking Tuesday as vacation [16:54] Oops, I've been forgetting to do my updates. [16:54] Yesterday and the day before: [16:54] - worked on the issue of gedit not coming up in mir-ci, and eventually decided the most straightforward way to fix this was to use pluma editor instead: https://github.com/MirServer/mir-ci/pull/35