/srv/irclogs.ubuntu.com/2023/05/26/#mir-server.txt

RAOFHm.06:55
RAOFYou 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
RAOFThat would prevent this bug, and also some UB.06:56
RAOFHm.07:25
RAOFAnd it would only require relying on a little implementation-defined behaviour.07:25
RAOFI'm actually warming to the idea.07:25
alan_g[m]I'm curious what UB problem you're talking about, but I guess I'll find out when you PR a solution07:49
RAOFWe throw exceptions across extern "C" boundaries.07:51
* RAOF is not actually going to PR a solution to that, because it turns out to involve implementing an Itanium ABI name mangler.07:52
alan_g[m]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 motivated08:09
alan_g[m]*not been08:11
RAOFA function-only name mangler would not be a particularly terrible task, but 🤷‍♀️.08:13
alan_g[m]A name mangler is really something for std::08:14
RAOFI mean, yes.08:14
RAOFAlthough it's implementation defined, so the standard wouldn't really have a lot to say about it.08:14
alan_g[m]That's the point: the standard can say "do what the implementation does"08:15
RAOFtype_info::name() gets you everything but what we want, too :)08:15
RAOFYeah, it'd totally be a useful addition to std::08:15
RAOFAnyway! Today:08:22
RAOF* (very nearly) Plumbed "only load RenderingPlatforms that can drive at least one display" probing through08:22
RAOF* 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
RAOF* Decided that it's tractable, but not for now 😉 08:22
RAOFOh, no.08:22
RAOFIt's actually even more tractable, isn't it?08:22
RAOFtype_info::name() gives us everything but what we want, but string concatenation should be able to take us the rest of the way?08:23
RAOFDamn.08:25
RAOFNow I'll think about it more 🤦‍♀️08:25
alan_g[m]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 safe08:41
alan_g[m]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:00
RAOFRight, but we don't need a general-purpose mangler; we just need to be able to mangle free-functions not in a namespace.09:09
alan_g[m]We actually only need a few known functions - a lookup table will suffice09:11
RAOFThat's true.09:12
RAOFWe could also automate that in the build process, right? Build an object exposing that symbol, read the mangled name out of objdump.09:13
RAOFOr, because we only have a list of like 5 symbols, not bother.09:14
alan_g[m]Or, because throwing exceptions through extern "C" works for the implementations we use, not bother09:16
alan_g[m]Today:16:48
alan_g[m]* Got a "working" spike of drag-n-drop16:48
alan_g[m]Note: Monday is a public holiday here, and I'm taking Tuesday as vacation16:48
sophie-wOops, I've been forgetting to do my updates.16:54
sophie-wYesterday and the day before:16:54
sophie-w- 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/3516:54

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!