!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

128 Members
24 Servers

Load older messages


SenderMessageTime
10 Jan 2025
@6pak:matrix.org6pakjust not outputting an apphost for buildDotnetModule apps in nixpkgs14:43:16
@6pak:matrix.org6pakwhich is just UseAppHost=false14:43:54
@6pak:matrix.org6pak and instead make our own "apphost" with makeBinaryWrapper that just dotnet execs the dll 14:44:14
@corngood:corngood.comCorngoodThe (non-self-contained) apphost is pretty lightweight, so what do we gain from that?14:45:46
@6pak:matrix.org6paktbf not much, but it's just unnecessary14:46:28
@6pak:matrix.org6pak the question about roslyn-ls is why it needs useDotnetFromEnv 14:46:53
@6pak:matrix.org6pak * the question about roslyn-ls was why it needs useDotnetFromEnv 14:47:03
@corngood:corngood.comCorngoodIt probably uses DOTNET_ROOT to find the available SDK(s).14:48:11
@corngood:corngood.comCorngood

and ideally the dependencies would be used from nix store aswell, not bundled

This is on my radar. I've experimented with msbuild options for symlinking outputs, so that they would link back to the package they came from. I had a lot of trouble with it though.

14:48:34
@corngood:corngood.comCorngood *

and ideally the dependencies would be used from nix store aswell, not bundled

This is on my radar. I've experimented with msbuild options for symlinking outputs, so that they would link back to the package they came from. I had a lot of trouble with it though.

edit: alternatively we could try to replace them after build, but that's not ideal.

14:49:15
@gggkiller:matrix.orgGGGTechnically, using the source built SDK we could patch nuget to link instead of copy, but I don't like having to maintain a patch set, feels like too much work15:01:35
@corngood:corngood.comCorngood It already has UseSymbolicLinksIfPossible etc. I just found that various things break when it's used. 15:04:10
@gggkiller:matrix.orgGGGHuh15:13:16
@gggkiller:matrix.orgGGGWeird, why would those break15:13:24
@gggkiller:matrix.orgGGGDoes it not copy the native libs?15:13:32
@corngood:corngood.comCorngoodI can't remember exactly. One problem with it is that nuget packages typically have a bunch of versions of things, and you're only linking to one of them, but pulling the whole package into the closure.15:14:26
@gggkiller:matrix.orgGGGOh yeah, the ones that have native libraries package the binaries for all runtimes15:18:15
@corngood:corngood.comCorngoodSome do. Some have dependent packages like skiasharp.native.linux, but there's also all the TFM variants of assemblies.16:04:17
@gggkiller:matrix.orgGGGI don't think there's much we can do without actually reproducing nuget's logic for restoring packages to know what will actually be used16:09:35
@gggkiller:matrix.orgGGGAnd even if we did, one package could use the net8.0 assembly and the other could use net7.016:10:14
@corngood:corngood.comCorngoodYeah, and both could be used in a dependent package. Nuget packages are not really designed to be runtime dependencies. It still might be worth doing though, even if it's just to reduce the size of the leaf packages.16:53:22
@6pak:matrix.org6pak

you're only linking to one of them, but pulling the whole package into the closure.

could we use multiple derivation outputs for this?

16:53:59
@6pak:matrix.org6pakalso whats the cost of adding more derivation/store objects in nixpkgs16:55:10
@6pak:matrix.org6pakI mean eval time and storage wise16:55:14
@6pak:matrix.org6pakit feels like splitting things up is discouraged16:55:48
@corngood:corngood.comCorngood

could we use multiple derivation outputs for this?

potentially, but you'd need to know at eval time how to split it up, so it would have to be done fetch-deps or something

16:56:37
@corngood:corngood.comCorngood I also want to end up with a good experience for source-built packages, and there's another layer of complexity there. Take 'avalonia' for example. That's one repository with one build process, but it results in a whole bunch of nuget packages. These all have dependencies between each other, and only some will be used by a dependent project. So for one nixpkgs package (avalonia) you currently have one output that contains all the nuget packages, and each one of those potentially contains multiple sets of assemblies for different target frameworks. 16:59:11
@corngood:corngood.comCorngood * I also want to end up with a good experience for source-built packages, and there's another layer of complexity there. Take 'avalonia' for example. That's one repository with one build process, but it results in a whole bunch of nuget packages. These all have dependencies between each other, and only some will be used by a dependent project. So for one nixpkgs package (avalonia) you currently have one output that contains all the nuget packages, and each one of those potentially contains multiple sets of assemblies for different target frameworks (this might not be the case for avalonia if it's all built for a single TFM). 16:59:48
@corngood:corngood.comCorngood

Actually here's an example of part of the output of that package:

result/share/nuget/packages/avalonia.win32
result/share/nuget/packages/avalonia.win32/11.0.11
result/share/nuget/packages/avalonia.win32/11.0.11/_rels
result/share/nuget/packages/avalonia.win32/11.0.11/_rels/.rels
result/share/nuget/packages/avalonia.win32/11.0.11/lib
result/share/nuget/packages/avalonia.win32/11.0.11/lib/net6.0
result/share/nuget/packages/avalonia.win32/11.0.11/lib/net6.0/Avalonia.Win32.dll
result/share/nuget/packages/avalonia.win32/11.0.11/lib/net6.0/Avalonia.Win32.xml
result/share/nuget/packages/avalonia.win32/11.0.11/lib/netstandard2.0
result/share/nuget/packages/avalonia.win32/11.0.11/lib/netstandard2.0/Avalonia.Win32.dll
result/share/nuget/packages/avalonia.win32/11.0.11/lib/netstandard2.0/Avalonia.Win32.xml
result/share/nuget/packages/avalonia.win32/11.0.11/Icon.png
result/share/nuget/packages/avalonia.win32/11.0.11/package
result/share/nuget/packages/avalonia.win32/11.0.11/package/services
result/share/nuget/packages/avalonia.win32/11.0.11/package/services/metadata
result/share/nuget/packages/avalonia.win32/11.0.11/package/services/metadata/core-properties
result/share/nuget/packages/avalonia.win32/11.0.11/package/services/metadata/core-properties/3ce73e06f9b745b9ba18ebd32b8b7f22.psmdcp
result/share/nuget/packages/avalonia.win32/11.0.11/[Content_Types].xml
result/share/nuget/packages/avalonia.win32/11.0.11/avalonia.win32.nuspec
result/share/nuget/packages/avalonia.win32/11.0.11/.nupkg.metadata
result/share/nuget/packages/avalonia.x11
result/share/nuget/packages/avalonia.x11/11.0.11
result/share/nuget/packages/avalonia.x11/11.0.11/_rels
result/share/nuget/packages/avalonia.x11/11.0.11/_rels/.rels
result/share/nuget/packages/avalonia.x11/11.0.11/lib
result/share/nuget/packages/avalonia.x11/11.0.11/lib/net6.0
result/share/nuget/packages/avalonia.x11/11.0.11/lib/net6.0/Avalonia.X11.dll
result/share/nuget/packages/avalonia.x11/11.0.11/lib/net6.0/Avalonia.X11.xml
result/share/nuget/packages/avalonia.x11/11.0.11/lib/netstandard2.0
result/share/nuget/packages/avalonia.x11/11.0.11/lib/netstandard2.0/Avalonia.X11.dll
result/share/nuget/packages/avalonia.x11/11.0.11/lib/netstandard2.0/Avalonia.X11.xml
result/share/nuget/packages/avalonia.x11/11.0.11/Icon.png
result/share/nuget/packages/avalonia.x11/11.0.11/package
result/share/nuget/packages/avalonia.x11/11.0.11/package/services
result/share/nuget/packages/avalonia.x11/11.0.11/package/services/metadata
result/share/nuget/packages/avalonia.x11/11.0.11/package/services/metadata/core-properties
result/share/nuget/packages/avalonia.x11/11.0.11/package/services/metadata/core-properties/25dfe1363a50409a81b44789515624d8.psmdcp
result/share/nuget/packages/avalonia.x11/11.0.11/[Content_Types].xml
result/share/nuget/packages/avalonia.x11/11.0.11/avalonia.x11.nuspec
result/share/nuget/packages/avalonia.x11/11.0.11/.nupkg.metadata
17:00:33
@corngood:corngood.comCorngoodso you have four assemblies there, and a dependent project might only need one of them17:01:46

Show newer messages


Back to Room ListRoom Version: 9