!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

127 Members
24 Servers

Load older messages


SenderMessageTime
5 Dec 2024
@corngood:corngood.comCorngood

It looks for packages that are installed in $NUGET_PACKAGES after restore. Packages from other build inputs are either not installed at all (they get referenced through $NUGET_FALLBACK_PACKAGES), or it skips them by:

    # packages in the nix store should have an empty metadata file
    used_source="$(jq -r 'if has("source") then .source else "" end' "$version"/.nupkg.metadata)"
    found=false

    if [[ -z "$used_source" || -d "$used_source" ]]; then
      continue
    fi

To be clear this goes for all packages that come from other nix derivations, not just SDK ones (even though those are by far the most common right now).

22:06:44
@gggkiller:matrix.orgGGGHm, interesting22:07:16
@gggkiller:matrix.orgGGGI'm planning to make that thing you mentioned about referencing SDK packages22:07:25
@gggkiller:matrix.orgGGGand I'm gonna add them to the lockfile without a url (or a special URL)22:07:41
@gggkiller:matrix.orgGGGthat way it removes the unused packages from the SDK since it doesn't need them22:07:53
@gggkiller:matrix.orgGGGalthough that's an issue since we don't have a dependency tree for the SDK packages22:08:16
@gggkiller:matrix.orgGGGmight leave this for later after all22:08:21
@corngood:corngood.comCorngood Yeah, I think that's a can of worms. Think about avalonia. It outputs a bunch of nuget packages, but only some of them may be used by a dependent package. Same problem really. 22:09:36
@gggkiller:matrix.orgGGGI mean, we have individual packages in the SDK, but we don't have their inter-dependencies22:10:08
@gggkiller:matrix.orgGGGlike for stuff like metapackages22:10:17
@gggkiller:matrix.orgGGG honestly, long term it might be useful to have something akin to ldd to list what assemblies a given assembly depends upon 22:10:59
@gggkiller:matrix.orgGGGthat way we could build a dependency graph22:11:15
@corngood:corngood.comCorngood The way the SDK references packages is pretty magical. For example, you may need Microsoft.AspNetCore.App.Ref when building non-aspnetcore stuff. 22:12:44
@corngood:corngood.comCorngoodI have a branch somewhere where I was trying to make the SDK packages opt-in.22:13:26
@gggkiller:matrix.orgGGG yeah, that's why I think we might need something like a dependency graph, to identify all that's being used 22:13:59
@corngood:corngood.comCorngood I discussed the sdk packages quite a bit with 6pak as well 22:14:00
@gggkiller:matrix.orgGGGor maybe not even a dependency graph, just a bit set of used packages that we recursively walk upon22:14:18
@gggkiller:matrix.orgGGG * or maybe not even a dependency graph, just a big set of used packages that we recursively walk upon22:14:29
@corngood:corngood.comCorngood I also did some work on using the nuget client API to figure out dependencies so that we could make, for example avalonia write separate outputs for its individual package, hook up dependencies, and map nuget package ids back to derivations. I got stuck on that one because I found the dependency solver extremely painful to use. 22:16:06
@gggkiller:matrix.orgGGG yeah, i also tried to use the nuget client when I was trying to convert nuget-to-nix to C# and it was really painful to use 22:16:49
@corngood:corngood.comCorngood

https://github.com/NixOS/nixpkgs/compare/master...corngood:nixpkgs:dotnet-avalonia.wip

Here's one branch full of hacks. pkgs/top-level/nuget-packages.json and pkgs/top-level/nuget-packages.nix might be interesting.

I was trying to do something along the lines of python/haskell, where we pull in nuget packages centrally. We'd then be able to replace them individually with source-built derivations.

22:21:54
@pyrox:pyrox.devdish [Fox/It/She]I'm not a fan of introducing more generated stuff into nixpkgs, pythonPackages is all manual, nodePackages is getting dropped, lockfiles are being externalized as much as possible, etc. Is there a way to do this without introducing more generated code?22:25:23
@gggkiller:matrix.orgGGGNo, it is not possible22:26:14
@gggkiller:matrix.orgGGG.NET's builtin lockfiles aren't widely used so we need to have in-tree generated ones22:26:39
@corngood:corngood.comCorngoodI don't think we should be using binary packages from nuget.org at all, which means nixpkgs would have to know how to build everything from source.22:27:40
@gggkiller:matrix.orgGGGI think that's going too far given the size of our team22:27:56
@corngood:corngood.comCorngoodYeah, we'll it's not in danger of happening any time soon :)22:28:20
@corngood:corngood.comCorngoodBut I think that's what makes nixpkgs great. It's just recipes to build lots and lots of software.22:29:27
@corngood:corngood.comCorngoodPractical example: I wanted to patch a bug in csharp-language-server-protocol as used by omnisharp-roslyn. I had to add a new package for csharp-lanaguage-server-protocol, like this: https://github.com/corngood/nixpkgs/commit/4500ed36a9476510ab10af8c5744a48b40061d11 I usually don't run into problems like that with other languages, because they aren't pulling in things from binary blobs all over the place.22:39:44
@gggkiller:matrix.orgGGG man, I wish there was an easy way to list all packages that use buildDotnetModule in nixpkgs 22:39:43

There are no newer messages yet.


Back to Room ListRoom Version: 9