!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

128 Members
23 Servers

Load older messages


SenderMessageTime
14 Dec 2024
@6pak:matrix.org6pak corehost parses the json every launch so it would probably be fine? 01:34:55
@6pak:matrix.org6pak I meant that the runtime doesn't look at the runtimes/{rid}/native path, it's the nuget client that checks it in the packages and converts it into metadata that the .net sdk then puts into the final .deps.json 01:37:31
@6pak:matrix.org6pakbut build time nuget packages requiring native libs themselves is a valid point01:38:40
@6pak:matrix.org6pakwouldn't it make more sense to run (auto)patchcil as part of nuget overrides though?01:38:57
@6pak:matrix.org6pak yeahh thats fair 01:41:31
@6pak:matrix.org6pak it would be nice if people annotated those with SupportedOSPlatformAttribute, but they probably don't 01:41:54
@gggkiller:matrix.orgGGG
In reply to @6pak:matrix.org
corehost parses the json every launch so it would probably be fine?
I mean, it probably wouldn't be much overhead, I'm probably just overthinking it, but since it's already done, I wouldn't just throw it away myself
01:43:21
@gggkiller:matrix.orgGGG
In reply to @6pak:matrix.org
I meant that the runtime doesn't look at the runtimes/{rid}/native path, it's the nuget client that checks it in the packages and converts it into metadata that the .net sdk then puts into the final .deps.json
Oh, I see, that's indeed a big issue, I'll have to remove those lines from the logic since it's nuget only
01:44:19
@6pak:matrix.org6pakit just so happens that it's the same path in the output usually01:44:49
@6pak:matrix.org6pakbut in theory the .deps.json could specify any path01:44:58
@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

Show newer messages


Back to Room ListRoom Version: 9