!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

127 Members
24 Servers

Load older messages


SenderMessageTime
5 Dec 2024
@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
@gggkiller:matrix.orgGGGthis treewide migration to JSON is going to be a pain22:39:49
@corngood:corngood.comCorngood

take a look at: maintainers/scripts/update-dotnet-lockfiles.nix

It abuses update.nix to find packages that have fetch-deps. It's probably not perfect (e.g. I know godot3-mono uses make-deps for some reason).

22:41:22
@gggkiller:matrix.orgGGGyeah, I found that one22:41:35
@gggkiller:matrix.orgGGG considering modifying it to add a rm deps.nix to the start of the script or something 22:41:44
@gggkiller:matrix.orgGGG or just outright modify fetch-deps to do that and then revert it after I finish running it 22:41:58
@pyrox:pyrox.devdish [Fox/It/She]
In reply to@gggkiller:matrix.org
man, I wish there was an easy way to list all packages that use buildDotnetModule in nixpkgs
rg buildDotnetModule
22:43:31
@corngood:corngood.comCorngood

Sort of a tangent, but I've taken to running fetch-deps (and update scripts) in firejail, out of paranoia, since it's not sandboxed. I couldn't think of a way to take advantage of the nix sandbox to do it...

NIX_PATH= firejail --private-tmp --whitelist=$PWD --protocol=netlink nix-shell --pure ./maintainers/scripts/update-dotnet-lockfiles.nix --argstr keep-going true
22:44:23
@pyrox:pyrox.devdish [Fox/It/She]what's the issue that you're worried about by not running it normally? /genq22:45:09
@gggkiller:matrix.orgGGGthat's a good idea22:45:10
@gggkiller:matrix.orgGGG even more so since fetch-deps runs the packages' code, it might have untrusted code running 22:45:32
@gggkiller:matrix.orgGGG it shouldn't but who knows 22:45:38
@emma:rory.gayEmma [it/its]
In reply to @corngood:corngood.com
I 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.
Thatd be nice if all nuget packages actually had linked sources
22:46:47
@corngood:corngood.comCorngood

--protocol=netlink being only required for msbuild.fetch-deps afaict, due to some ridiculous old dotnet thing

even more so since fetch-deps runs the packages' code, it might have untrusted code running

Yeah, if I'm regenerating all lockfiles, or doing mass updates, that's a lot of peoples code being run. Lots of new packages going in without any real audits.

Could end up bad either through malice or accident.

22:47:13
@gggkiller:matrix.orgGGG well, packages from nuget can run arbitrary code on installs, projects can also run arbitrary code on the restore stage and more 22:47:27
@gggkiller:matrix.orgGGGtechnically contributors should've audited it before adding all of that to nixpkgs, but you can never be too safe22:47:43
@lostmsu:matrix.orglostmsuHey guys, I'm trying to see if there's a way to improve experience with C# code that has any kind of native dependencies (hi Avalonia). Would love you to chime in before I jumped to experimentation: https://github.com/NixOS-NET/Nix.NET/issues/122:49:01
@emma:rory.gayEmma [it/its]
In reply to @gggkiller:matrix.org
technically contributors should've audited it before adding all of that to nixpkgs, but you can never be too safe
Concern is upstream adding fishy stuff and maintaineds just merging the auto prs
22:49:03

Show newer messages


Back to Room ListRoom Version: 9