!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

126 Members
24 Servers

Load older messages


SenderMessageTime
14 Dec 2024
@gggkiller:matrix.orgGGG
In reply to @6pak:matrix.org
wouldn't it make more sense to run (auto)patchcil as part of nuget overrides though?
Well, thinking about it, I don't think the tools in a nuget package use the native libraries in the runtime dir, they're probably packaged as a normal command line tool
01:46:27
@gggkiller:matrix.orgGGGOr there would be something in the `.deps.json` file pointing at it, so we shouldn't need any other special logic other than handling that file.01:47:03
@gggkiller:matrix.orgGGG
In reply to @6pak:matrix.org
it would be nice if people annotated those with SupportedOSPlatformAttribute, but they probably don't
They'd probably only annotate the methods that call those pinvoke shims instead of the shims themselves, so worst case it'd need some blackbox control flow analysis which would most likely fail due to reflection, so I don't think it's possible
01:48:11
@gggkiller:matrix.orgGGGBest that can be done is exclude some extensions based on the target RID most likely01:48:26
@gggkiller:matrix.orgGGGLike, if it's `linux-x64` we know it won't be needing any `.dll`s nor `.dylib`s01:49:05
@6pak:matrix.org6pakyou don't need to include the extension in dllimport library name though01:49:28
@gggkiller:matrix.orgGGGTrue, but a few do, so we could save some headache by excluding those beforehand 01:49:55
@gggkiller:matrix.orgGGGI saw a dllimport with kernel32.dll in avalonia, so if we auto excluded those it'd already save the need to manually specify the exclude globs based on the target platform on the nix side01:50:55
@gggkiller:matrix.orgGGGIt was all fine and dandy when I was only targeting the Avalonia.X11 assembly, but once I targeted the whole directory avalonia-ilspy outputs then it became a huge mess01:53:22
@6pak:matrix.org6pak actually, can .deps.json take absolute paths for managed dlls? 01:56:43
@gggkiller:matrix.orgGGGI'm not sure, I never even looked into what's in it properly 01:57:04
@gggkiller:matrix.orgGGGThis is my first time actually caring about them01:57:18
@6pak:matrix.org6pakwouldn't it mean we can easily share .net deps?01:57:45
@6pak:matrix.org6pakinstead of duplicating the dlls in every .net app in nix store01:57:54
@gggkiller:matrix.orgGGGMaybe, that's an interesting idea01:58:02
@gggkiller:matrix.orgGGGThough instead of that we could just symlink them there if we can't 01:58:15
@gggkiller:matrix.orgGGGNot too hard either01:58:21
@6pak:matrix.org6pakoh, riht01:58:23
@6pak:matrix.org6pak * oh, right01:58:25
@6pak:matrix.org6pakbecause running autopatchelf for avalonia dlls for every single .net app is kinda stupid01:58:46
@gggkiller:matrix.orgGGGDefinitely 01:58:53
@6pak:matrix.org6pakwhen you can just do it once in the nuget overrides01:58:54
@6pak:matrix.org6pakand by nuget overrides I mean https://github.com/NixOS/nixpkgs/blob/e0464e47880a69896f0fb1810f00e0de469f770a/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix#L5601:59:26
@gggkiller:matrix.orgGGGThough if we can use the avalonia being built in nixpkgs, then we wouldn't need to patchcil it01:59:27
@6pak:matrix.org6pakRedacted or Malformed Event01:59:30
@6pak:matrix.org6pak * and by nuget overrides I mean https://github.com/NixOS/nixpkgs/blob/e0464e47880a69896f0fb1810f00e0de469f770a/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix01:59:38
@6pak:matrix.org6pak * and by nuget overrides I mean https://github.com/NixOS/nixpkgs/blob/e0464e47880a69896f0fb1810f00e0de469f770a/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix, which I assume you know exists01:59:50
@gggkiller:matrix.orgGGG
In reply to @6pak:matrix.org
which I assume you know exists
Yeah, I do, I wanted to make it possible for people to provide their own overrides actually
01:59:59
@gggkiller:matrix.orgGGGThe way it is right now is kinda too carved in stone02:00:16
@gggkiller:matrix.orgGGGBut yeah, we could put it in the overrides for widely used packages, but adding some default excludes based on RID wouldn't harm anyone I think02:04:40

Show newer messages


Back to Room ListRoom Version: 9