| 28 Jul 2025 |
raitobezarius | install_name_tool is not even a thing at this step I suppose? | 20:53:46 |
raitobezarius | or meson should do it for me? | 20:53:51 |
raitobezarius | but if removing flat_namespace means moving everything to lazy initialization in the C++ codebase | 20:54:16 |
raitobezarius | i'm not going to do that cleanup | 20:54:19 |
raitobezarius | i'd rather take this or disable the entire plugin feature for macOS | 20:54:26 |
emily | I believe the static initializers should run before any other code in the loaded library | 20:56:44 |
emily | though after a quick Google, it may be that you are doing the linking a bit wrong | 20:57:06 |
emily | e.g. https://github.com/ziglang/zig/issues/13319 https://issues.chromium.org/issues/40276456 | 20:57:21 |
emily | (I haven't tried using static initializers in a dlopen()ed library myself so I have no particular expertise here) | 20:57:31 |
emily | (my guess is that if -flat_namespace fixes it it's a cursed side effect) | 20:57:51 |
raitobezarius | Static initializers in Rust are not supported and do not work
correctly on Apple platforms, failing compilation and even crashing
lld on iOS.
Replace the Rust-side static initializer with the use of linkme to
collect the registration functions and use a C++ static initializer
to do the registration of the Rust tests.
| 20:59:14 |
raitobezarius | promising | 20:59:15 |
raitobezarius |
Dyld sees the first padding nulllptr and stops processing initializers further.
| 21:00:00 |
raitobezarius | exciting | 21:00:01 |
raitobezarius | the end of the chromium thread being "this still doesn't work" | 21:01:19 |
raitobezarius | I think I will need help on this because I don't have the time budget to go down on a linker journey with Apple macOS | 21:01:38 |
raitobezarius | We can track the usage of flat_namespace as wrong and as an issue, document what we know and process this async | 21:02:02 |
raitobezarius | https://gerrit.lix.systems/c/lix/+/3698/26 awesome | 21:08:04 |
raitobezarius | the CI passed but my tests did not | 21:08:08 |
jade_ | that looks right, no? | 21:08:09 |
raitobezarius | In reply to @jade_:matrix.org that looks right, no? the underscore yes | 21:08:18 |
raitobezarius | the defined yes | 21:08:22 |
jade_ | oh yeah it does that | 21:08:25 |
raitobezarius | dlopening it with two level namespaces does not run the static initializers | 21:08:40 |
raitobezarius | i cannot see logs, i cannot register store | 21:08:45 |
raitobezarius | the plugin is literally useless | 21:08:49 |
jade_ | you shouldn't need/want static initializers is the thing | 21:09:01 |
jade_ | we are trying to kill those and nix_plugin_entry is guaranteed to be called | 21:09:11 |
jade_ | so anything that you'd like to statically initialize can be initialized with that | 21:10:17 |
raitobezarius | sure but they're not fully killed yet | 21:11:06 |