Nix + dotnet | 127 Members | |
| 24 Servers |
| Sender | Message | Time |
|---|---|---|
| 12 Dec 2024 | ||
got some progress done on patchcil 6pak: | 05:04:31 | |
* got some progress done on patchcil 6pak | 05:04:35 | |
| a more compact output:
| 05:06:52 | |
| I'll work on it further tomorrow but that's enough for today | 05:18:39 | |
| 19:23:03 | ||
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 | |
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 | |
(for the non-autoPatchcilHook interface) | 19:45:29 | |
In reply to @gggkiller:matrix.orgbut with autoPatchelfHook you can do --add-needed in postFixup | 19:51:40 | |
In reply to @gggkiller:matrix.orgI had the same when playing around before | 19:52:06 | |
Download image.png | 19:52:10 | |
don't you mean preFixup or fixupPhase? because autoPatchelfHook runs in postFixup | 19:52:55 | |
| I think both work but you should do it in postFixup for some ugly reason, don't remember exactly | 19:53:37 | |
In reply to @gggkiller:matrix.orgwe could emulate RPATH with a custom DllImportResolver | 19:56:21 | |
| and I think keeping the interface as close as possible to patchelf is the way to go | 19:56:57 | |
I feel like it'd be better to just modify the DllImport themselves since we already have them on hand | 19:57:00 | |
| I was thinking of doing both | 19:57:16 | |
| ELFs and CIL assemblies aren't the same though, trying to emulate it could shoot ourselves in the foot | 19:59:49 | |
also, I can't figure out if the DllImportResolver also handles NativeLibrary.Load | 20:03:11 | |
| if it doesn't then there's no point in using it | 20:03:18 | |
| it does | 20:03:24 | |
* 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 | |
| actually maybe only for the libraryName overload that also takes in the assembly | 20:04:57 | |
| seems like neither do:
| 20:06:00 | |
so I honestly don't think there's a point in using SetDllImportResolver as they're all static known strings we can modify directly | 20:06:36 | |
| not to mention if, for some reason, some app decides to use their own DllImportResolver then that'd make our tool not work | 20:08:44 | |
In reply to @gggkiller:matrix.orgoh, I was thinking of AssemblyLoadContext.ResolvingUnmanagedDll then | 20:11:57 | |
| which I think is also called for dllimports | 20:12:08 | |
ok, got it working by overriding the DllImports, I think I'll make a minimal version with it and then if you want to convert it to the ResolvingUnmanagedDll event, I'll leave it up to you since you know more about this library than me 6pak | 23:40:32 | |
| if you're okay with it | 23:40:34 | |