!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

118 Members
23 Servers

Load older messages


SenderMessageTime
13 Aug 2025
@whovian9369:matrix.orgWhovian9369

Okay, sorry, I think I've figured out the situation again and I was slightly wrong.

  • He wants me to try building with AoT (again seemingly NativeAoT) enabled and self-contained disabled, which seems reasonable
  • Trying to do so throws an error, seemingly due to Emma's point about them being mutually exclusive.
  • Friend seems to insist that I can do AoT and --no-self-contained (via selfContainedBuild = false;) even though it appears to me that I cannot due to PublishTrimmed
17:55:28
@whovian9369:matrix.orgWhovian9369 *

Okay, sorry, I think I've figured out the situation again and I was slightly wrong.

  • He wants me to try building with AoT (again seemingly NativeAoT) enabled and self-contained disabled, which seems reasonable
  • Trying to do so throws an error, seemingly due to Emma's point about them being mutually exclusive.
  • Friend seems to insist that I can do AoT and --no-self-contained (via selfContainedBuild = false;) even though it appears to me that I cannot due to PublishTrimmed being implied, throwing the earlier error.
17:56:00
@6pak:matrix.org6pakimage.png
Download image.png
17:56:11
@6pak:matrix.org6pak buildDotnetModule is adding the PublishTrimmed=false 17:56:20
@6pak:matrix.org6pak I assume publishaot simply overrides --no-self-contained when using dotnet cli normally 17:56:40
@whovian9369:matrix.orgWhovian9369That's my assumption too, yeah.18:02:55
@whovian9369:matrix.orgWhovian9369Is there a good way to print the used flags used during a build? I feel like that might help expose what's being done "incorrectly"...18:07:28
@whovian9369:matrix.orgWhovian9369 In the mean time, I'm testing "-p:PublishTrimmed=true" as a dotnetInstallFlags option to see what happens. 18:09:57
@whovian9369:matrix.orgWhovian9369... The answer is seemingly nothing due to the hook seemingly overriding it.18:10:24
@6pak:matrix.org6pak why would you want to disable selfContainedBuild on nix side? 18:11:08
@whovian9369:matrix.orgWhovian9369 You mean explicitly settings selfContainedBuild = false;? Honestly I think it's personal preference so I know exactly what's set where I can set stuff.
I believe Nix does set it automatically anyway, so 🤷
18:21:06
@whovian9369:matrix.orgWhovian9369 * You mean explicitly setting selfContainedBuild = false;? Honestly I think it's personal preference so I know exactly what's set where I can set stuff.
I believe Nix does set it automatically anyway, so 🤷
18:21:56
@6pak:matrix.org6pakI mean not setting it to true18:22:16
@whovian9369:matrix.orgWhovian9369 Sorry, I'm afraid I'm missing the question then. You're asking why I'm setting selfContainedBuild = false; in the first place? 18:22:51
@6pak:matrix.org6pakyeah18:23:13
@whovian9369:matrix.orgWhovian9369 I mean, as I said I think it's just personal opinion. I don't remember why I started doing it other than "Nix seems to automatically set this to false", but it might just be that I've seen it in Nixpkgs one time and preferred how it was laid out versus the output of selfContainedBuild = true; on "normal" (non-AoT) builds that I've done. 18:26:12
@whovian9369:matrix.orgWhovian9369 It seems that Nix defaults to selfContainedBuild = false; anyway, but I like having the feeling of extra control or knowledge that for me comes from having that option immediately exposed (especially for testing like this, where having it as false seems to show errors due to AoT wanting PublishTrimmed set to true, which is disabled by default by a hook as you pointed out). 18:36:21
14 Aug 2025
@oatmealraisin:matrix.orgoatmealraisin I have a project with a long tree of projectReferences, and I've got (most) building. I'm changing them to packNupkg=true, but I'm running into a common error between some of them: error NU5026: The file '/build/flake-build/src/Shared/bin/Release/net8.0/Shared.dll' to be packed was not found on disk. [/build/flake-build/src/Shared/Shared.csproj] 19:01:03
@oatmealraisin:matrix.orgoatmealraisin(Shared.csproj is the currently building project)19:01:15
@oatmealraisin:matrix.orgoatmealraisinAny ideas why this might be happening?19:01:24
@6pak:matrix.org6paklooks like a dummy csproj to house shared files19:02:15
@6pak:matrix.org6pakare you sure it's projectreferenced by anything?19:02:26
@oatmealraisin:matrix.orgoatmealraisinIt's currently the package I'm trying to build, it references one other project (Util.csproj) which builds as a nupkg19:02:58
@oatmealraisin:matrix.orgoatmealraisin Just for clarification, I'm trying to build an aspnet/blazor project in a flake, and so I'm making a default.nix in each project directory 19:03:56
@oatmealraisin:matrix.orgoatmealraisin currently just going through and making sure each builds with nix-build 19:04:17
@oatmealraisin:matrix.orgoatmealraisinShould I use a pastebin for this chat or can I just paste into the chat?19:04:40
@oatmealraisin:matrix.orgoatmealraisin
19:06:48
@oatmealraisin:matrix.orgoatmealraisin* with import <nixpkgs> { }; let Utils = import ../Utils; in buildDotnetModule { pname = "Shared.csproj"; version = "0.1"; src = ../..; projectFile = "src/Shared/Shared.csproj"; referencedProjects = [ Utils ]; nugetDeps = ./deps.json; packNupkg = true; } 19:06:57
@oatmealraisin:matrix.orgoatmealraisin deps.json is generated for every project using nix-build -A passthru.fetch-deps 19:07:21
@oatmealraisin:matrix.orgoatmealraisin Every default.nix looks pretty much exactly like this 19:07:52

Show newer messages


Back to Room ListRoom Version: 9