!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

126 Members
24 Servers

Load older messages


SenderMessageTime
12 Dec 2024
@gggkiller:matrix.orgGGGalthough I wouldn't put effort into it initially since the amount of packages that use NativeAOT in nixpkgs is small from my knowledge00:17:14
@emma:rory.gayEmma [it/its]DirectPInvoke? cant say ive heard of that before00:18:54
@6pak:matrix.org6pak
In reply to @gggkiller:matrix.org
that runs before the NativeAOT one
that's what I mean yes but then how would you do anything custom with patchcil from nix
00:20:03
@6pak:matrix.org6paklike add a required native dependency to a cil assembly00:20:17
@6pak:matrix.org6paklike you would with patchelf --add-needed00:20:45
@6pak:matrix.org6pak
In reply to @emma:rory.gay
DirectPInvoke? cant say ive heard of that before
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/interop#direct-pinvoke-calls
00:21:24
@emma:rory.gayEmma [it/its]this looks like codegen for dllimport?00:23:34
@6pak:matrix.org6pakit makes dllimport use standard dynamic/static linking instead dlopen-ing at runtime00:25:39
@6pak:matrix.org6pakso unless you do that, patchelf wont see the dependencies in naot binaries00:26:02
@emma:rory.gayEmma [it/its]i see00:28:22
@gggkiller:matrix.orgGGG same way you do with autoPatchelfHook, add it to runtimeDeps 02:16:11
@gggkiller:matrix.orgGGG then it'll add it to every single assembly (or ELF in case of autoPatchelfHook) 02:16:29
@gggkiller:matrix.orgGGGif you've chosen NativeAOT then you're in for the headache imo02:16:51
@gggkiller:matrix.orgGGGRedacted or Malformed Event05:04:30
@gggkiller:matrix.orgGGG got some progress done on patchcil 6pak: 05:04:31
@gggkiller:matrix.orgGGG * got some progress done on patchcil 6pak 05:04:35
@gggkiller:matrix.orgGGG

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
@gggkiller:matrix.orgGGGI'll work on it further tomorrow but that's enough for today05:18:39
@whovian9369:matrix.orgWhovian9369 joined the room.19:23:03
@gggkiller:matrix.orgGGG 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
@gggkiller:matrix.orgGGG 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
@gggkiller:matrix.orgGGG (for the non-autoPatchcilHook interface) 19:45:29
@6pak:matrix.org6pak
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:matrix.org6pak
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:matrix.org6pakimage.png
Download image.png
19:52:10
@gggkiller:matrix.orgGGG don't you mean preFixup or fixupPhase? because autoPatchelfHook runs in postFixup 19:52:55
@6pak:matrix.org6pakI think both work but you should do it in postFixup for some ugly reason, don't remember exactly19:53:37
@6pak:matrix.org6pak
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:matrix.org6pakand I think keeping the interface as close as possible to patchelf is the way to go19:56:57
@gggkiller:matrix.orgGGG I feel like it'd be better to just modify the DllImport themselves since we already have them on hand 19:57:00

Show newer messages


Back to Room ListRoom Version: 9