!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

125 Members
24 Servers

Load older messages


SenderMessageTime
5 Dec 2024
@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
@corngood:corngood.comCorngood

Yeah, that part of the dotnet ecosystem is a mess. Actual build recipes would be the dream.

My favourite recent example was finding Avalonia.BuildServices, which is on nuget.org, but they don't even release the source for it. :|

https://github.com/AvaloniaUI/Avalonia/discussions/16878

22:50:18
@pyrox:pyrox.devdish [Fox/It/She]that's annoying >.>22:51:28
@pyrox:pyrox.devdish [Fox/It/She]also I'm just thinking about the versions situation in dotnet, it's a lot more varied than the python package ecosystem(from my POV as someone who uses python more) where there are a lot of versions of different packages in use at different times, so it may be harder to package each one individually22:52:26
@gggkiller:matrix.orgGGGyeah, that's also another issue22:52:50
@gggkiller:matrix.orgGGGI guess we're more similar to the node ecosystem in that aspect22:53:00
@pyrox:pyrox.devdish [Fox/It/She]i'd be interested in maybe being able to use nix-init or a similar tool to generate initial expressions, but I don't want a single big inscrutible lockfile because that's just unmaintainable22:53:04
@pyrox:pyrox.devdish [Fox/It/She]* i'd be interested in maybe being able to use nix-init or a similar tool to generate initial expressions for from-source packages, but I don't want a single big inscrutible lockfile because that's just unmaintainable22:53:14
@corngood:corngood.comCorngood

I don't know how relevant this is, but the thing that comes to mind is how we patch the dll imports in the source-built version of avalonia:

          substituteInPlace src/Avalonia.X11/ICELib.cs \
            --replace-fail '"libICE.so.6"' '"${lib.getLib libICE}/lib/libICE.so.6"'
          substituteInPlace src/Avalonia.X11/SMLib.cs \
            --replace-fail '"libSM.so.6"' '"${lib.getLib libSM}/lib/libSM.so.6"'
          substituteInPlace src/Avalonia.X11/XLib.cs \
            --replace-fail '"libX11.so.6"' '"${lib.getLib libX11}/lib/libX11.so.6"' \
            --replace-fail '"libXrandr.so.2"' '"${lib.getLib libXrandr}/lib/libXrandr.so.2"' \
            --replace-fail '"libXext.so.6"' '"${lib.getLib libXext}/lib/libXext.so.6"' \
            --replace-fail '"libXi.so.6"' '"${lib.getLib libXi}/lib/libXi.so.6"' \
            --replace-fail '"libXcursor.so.1"' '"${lib.getLib libXcursor}/lib/libXcursor.so.1"'
22:53:24
@pyrox:pyrox.devdish [Fox/It/She](see the node-packages.nix file, and the whole reason why I'm working on reducing that)22:53:33
@emma:rory.gayEmma [it/its]Oh wtf, i wasnt even aware of avalonia having telemetry, ew22:53:36

Show newer messages


Back to Room ListRoom Version: 9