| 12 Dec 2024 |
Emma [it/its] | this looks like codegen for dllimport? | 00:23:34 |
6pak | it makes dllimport use standard dynamic/static linking instead dlopen-ing at runtime | 00:25:39 |
6pak | so unless you do that, patchelf wont see the dependencies in naot binaries | 00:26:02 |
Emma [it/its] | i see | 00:28:22 |
GGG | same way you do with autoPatchelfHook, add it to runtimeDeps | 02:16:11 |
GGG | then it'll add it to every single assembly (or ELF in case of autoPatchelfHook) | 02:16:29 |
GGG | if you've chosen NativeAOT then you're in for the headache imo | 02:16:51 |
GGG | Redacted or Malformed Event | 05:04:30 |
GGG | got some progress done on patchcil 6pak: | 05:04:31 |
GGG | * got some progress done on patchcil 6pak | 05:04:35 |
GGG | a more compact output:
$ dotnet run -- --print-imports result/lib/avalonia-ilspy/Avalonia.X11.dll
libc
libgdk-3.so.0
libGL.so.1
libglib-2.0.so.0
libgobject-2.0.so.0
libgtk-3.so.0
libICE.so.6
libSM.so.6
libX11.so.6
libXcursor.so.1
libXi.so.6
libXrandr.so.2
| 05:06:52 |
GGG | I'll work on it further tomorrow but that's enough for today | 05:18:39 |
| Whovian9369 joined the room. | 19:23:03 |
GGG | 6pak: currently considering what the CLI UX should be for setting the search paths, because it'll modify the DllImports and CIL has no concept of RPATH (although the DllImports can stand in for NT_NEEDED) | 19:44:35 |
GGG | was thinking of doing something like patchcil --set-library-path libX11.so:/nix/store/nicg80r560lxr1vzlrjcj401v98fwb7y-libX11-1.8.10/lib/libX11.so.6 | 19:45:11 |
GGG | (for the non-autoPatchcilHook interface) | 19:45:29 |
6pak | In reply to @gggkiller:matrix.org same way you do with autoPatchelfHook, add it to runtimeDeps but with autoPatchelfHook you can do --add-needed in postFixup | 19:51:40 |
6pak | In reply to @gggkiller:matrix.org
a more compact output:
$ dotnet run -- --print-imports result/lib/avalonia-ilspy/Avalonia.X11.dll
libc
libgdk-3.so.0
libGL.so.1
libglib-2.0.so.0
libgobject-2.0.so.0
libgtk-3.so.0
libICE.so.6
libSM.so.6
libX11.so.6
libXcursor.so.1
libXi.so.6
libXrandr.so.2
I had the same when playing around before | 19:52:06 |
6pak |  Download image.png | 19:52:10 |
GGG | don't you mean preFixup or fixupPhase? because autoPatchelfHook runs in postFixup | 19:52:55 |
6pak | I think both work but you should do it in postFixup for some ugly reason, don't remember exactly | 19:53:37 |
6pak | In reply to @gggkiller:matrix.org 6pak: currently considering what the CLI UX should be for setting the search paths, because it'll modify the DllImports and CIL has no concept of RPATH (although the DllImports can stand in for NT_NEEDED) we could emulate RPATH with a custom DllImportResolver | 19:56:21 |
6pak | and I think keeping the interface as close as possible to patchelf is the way to go | 19:56:57 |
GGG | I feel like it'd be better to just modify the DllImport themselves since we already have them on hand | 19:57:00 |
6pak | I was thinking of doing both | 19:57:16 |
GGG | ELFs and CIL assemblies aren't the same though, trying to emulate it could shoot ourselves in the foot | 19:59:49 |
GGG | also, I can't figure out if the DllImportResolver also handles NativeLibrary.Load | 20:03:11 |
GGG | if it doesn't then there's no point in using it | 20:03:18 |
6pak | it does | 20:03:24 |
GGG | * if it doesn't then there's no point in using it as we already statically know all the libraries that are loaded through DllImport | 20:03:35 |