| 14 Dec 2024 |
6pak | corehost parses the json every launch so it would probably be fine? | 01:34:55 |
6pak | 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 | but build time nuget packages requiring native libs themselves is a valid point | 01:38:40 |
6pak | wouldn't it make more sense to run (auto)patchcil as part of nuget overrides though? | 01:38:57 |
6pak | yeahh thats fair | 01:41:31 |
6pak | it would be nice if people annotated those with SupportedOSPlatformAttribute, but they probably don't | 01:41:54 |
GGG | 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 |
GGG | 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 | it just so happens that it's the same path in the output usually | 01:44:49 |
6pak | but in theory the .deps.json could specify any path | 01:44:58 |
GGG | 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 |
GGG | Or 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 |
GGG | 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 |
GGG | Best that can be done is exclude some extensions based on the target RID most likely | 01:48:26 |
GGG | Like, if it's `linux-x64` we know it won't be needing any `.dll`s nor `.dylib`s | 01:49:05 |
6pak | you don't need to include the extension in dllimport library name though | 01:49:28 |
GGG | True, but a few do, so we could save some headache by excluding those beforehand | 01:49:55 |
GGG | I 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 side | 01:50:55 |
GGG | It 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 mess | 01:53:22 |
6pak | actually, can .deps.json take absolute paths for managed dlls? | 01:56:43 |
GGG | I'm not sure, I never even looked into what's in it properly | 01:57:04 |
GGG | This is my first time actually caring about them | 01:57:18 |
6pak | wouldn't it mean we can easily share .net deps? | 01:57:45 |
6pak | instead of duplicating the dlls in every .net app in nix store | 01:57:54 |
GGG | Maybe, that's an interesting idea | 01:58:02 |
GGG | Though instead of that we could just symlink them there if we can't | 01:58:15 |
GGG | Not too hard either | 01:58:21 |
6pak | oh, riht | 01:58:23 |
6pak | * oh, right | 01:58:25 |
6pak | because running autopatchelf for avalonia dlls for every single .net app is kinda stupid | 01:58:46 |