!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

120 Members
23 Servers

Load older messages


SenderMessageTime
10 Jan 2025
@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
@6pak:matrix.org6pak could you have avalonia derivation output all those nuget packages in different outputs and then have dummy derivations like Avalonia.X11 that just link to one of the avalonia outputs? 17:02:14
@6pak:matrix.org6pak * could you have avalonia derivation output all those nuget packages in different outputs and then have dummy derivations like Avalonia.X11 that just links to one of the avalonia outputs? 17:02:29
@6pak:matrix.org6pak(I'm not really sure how nix derivation outputs thing works tbf)17:02:47
@corngood:corngood.comCorngoodYeah, I started building something like that, but instead of separate outputs I made separate derivations and pulled in parts of the monolithic one. You do need to define the list of packages at eval time, which is annoying.17:03:48
@6pak:matrix.org6pak

I made separate derivations and pulled in parts of the monolithic one

pull as in link or copy?

17:04:23
@corngood:corngood.comCorngoodcopy17:04:31
@corngood:corngood.comCorngood Where I got stuck is that I wanted the packages to depend on each other properly. Currently you can reference avalonia and get everything, but I didn't want dependent projects to have to list a bunch of transient dependencies in buildInputs 17:04:53
@6pak:matrix.org6pakbecause link would mean you still have everything in closure, copy means you have the same thing twice in store/cache17:04:58
@corngood:corngood.comCorngoodright, I thought it would be better to favour build closure size for dependent projects17:05:49
@6pak:matrix.org6pak

You do need to define the list of packages at eval time, which is annoying.

can't you do it at fetch-deps stage?

17:05:55
@corngood:corngood.comCorngood
$ cat result/share/nuget/source/avalonia/11.0.11/avalonia.nuspec
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>Avalonia</id>
    <version>11.0.11</version>
    <authors>Avalonia Team</authors>
    <license type="expression">MIT</license>
    <licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
    <icon>Icon.png</icon>
    <projectUrl>https://avaloniaui.net/</projectUrl>
    <description>Avalonia is a cross-platform UI framework for .NET providing a flexible styling system and supporting a wide range of Operating Systems such as Windows, Linux, macOS and with experimental support for Android, iOS and WebAssembly.</description>
    <releaseNotes>https://github.com/AvaloniaUI/Avalonia/releases</releaseNotes>
    <copyright>Copyright 2013-2025 © The AvaloniaUI Project</copyright>
    <tags>avalonia avaloniaui mvvm rx reactive extensions android ios mac forms wpf net netstandard net461 uwp xamarin</tags>
    <repository type="git" url="https://github.com/AvaloniaUI/Avalonia/" />
    <dependencies>
      <group targetFramework=".NETFramework4.6.1">
        <dependency id="Avalonia.Remote.Protocol" version="11.0.11" exclude="Build,Analyzers" />
        <dependency id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" exclude="Build,Analyzers" />
        <dependency id="System.ComponentModel.Annotations" version="4.5.0" exclude="Build,Analyzers" />
        <dependency id="System.Memory" version="4.5.3" exclude="Build,Analyzers" />
        <dependency id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" exclude="Build,Analyzers" />
        <dependency id="System.Threading.Tasks.Extensions" version="4.5.4" exclude="Build,Analyzers" />
        <dependency id="System.ValueTuple" version="4.5.0" exclude="Build,Analyzers" />
        <dependency id="MicroCom.Runtime" version="0.11.0" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETCoreApp2.0">
        <dependency id="Avalonia.Remote.Protocol" version="11.0.11" exclude="Build,Analyzers" />
        <dependency id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" exclude="Build,Analyzers" />
        <dependency id="System.ComponentModel.Annotations" version="4.5.0" exclude="Build,Analyzers" />
        <dependency id="System.Memory" version="4.5.3" exclude="Build,Analyzers" />
        <dependency id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" exclude="Build,Analyzers" />
        <dependency id="System.Threading.Tasks.Extensions" version="4.5.4" exclude="Build,Analyzers" />
        <dependency id="System.ValueTuple" version="4.5.0" exclude="Build,Analyzers" />
        <dependency id="MicroCom.Runtime" version="0.11.0" exclude="Build,Analyzers" />
      </group>
      <group targetFramework="net6.0">
        <dependency id="Avalonia.Remote.Protocol" version="11.0.11" exclude="Build,Analyzers" />
        <dependency id="System.ComponentModel.Annotations" version="4.5.0" exclude="Build,Analyzers" />
        <dependency id="MicroCom.Runtime" version="0.11.0" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETStandard2.0">
        <dependency id="Avalonia.Remote.Protocol" version="11.0.11" exclude="Build,Analyzers" />
        <dependency id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" exclude="Build,Analyzers" />
        <dependency id="System.ComponentModel.Annotations" version="4.5.0" exclude="Build,Analyzers" />
        <dependency id="System.Memory" version="4.5.3" exclude="Build,Analyzers" />
        <dependency id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" exclude="Build,Analyzers" />
        <dependency id="System.Threading.Tasks.Extensions" version="4.5.4" exclude="Build,Analyzers" />
        <dependency id="System.ValueTuple" version="4.5.0" exclude="Build,Analyzers" />
        <dependency id="MicroCom.Runtime" version="0.11.0" exclude="Build,Analyzers" />
      </group>
    </dependencies>
  </metadata>
</package>%
17:06:09
@6pak:matrix.org6paklike the info you need is literally in nuget restore metadata17:06:09
@corngood:corngood.comCorngood then you're using packages from nuget.org or something. maybe if you had fetch-deps use the master avalonia package/? 17:06:48
@corngood:corngood.comCorngood * then you're using packages from nuget.org or something. maybe if you had fetch-deps use the master avalonia package? 17:06:50
@6pak:matrix.org6pakbut different outputs would solve it with no negatives right? (assuming they work how I think they do)17:06:50
@6pak:matrix.org6pakoh you mean a list in consuming projects?17:07:27
@corngood:corngood.comCorngoodit wouldn't be different from having separate derivations17:07:29
@6pak:matrix.org6pakyou would build avalonia twice17:07:44
@6pak:matrix.org6pak* you would build avalonia once17:07:54
@corngood:corngood.comCorngoodoh I see. I guess it would save storing the monolithic output, but that wouldn't be used directly by anything17:08:45
@6pak:matrix.org6pakunless with the copy approach you would make the monolith uncacheable, which also works I guess?17:08:52

Show newer messages


Back to Room ListRoom Version: 9