Nix + dotnet | 120 Members | |
| 23 Servers |
| Sender | Message | Time |
|---|---|---|
| 9 Aug 2025 | ||
| It doesn't run because it needs selfContainedBuild but just getting to this point is great. Corngood thanks again for the help | 01:59:20 | |
In reply to @oatmealraisin:matrix.org stdenv is off by default, buildDotnetModule is on by default... I think some other languages did the same because they don't have the legacy of stdenv. The documentation I was talking about was the concurrent solution building problem, but that's an upstream dotnet thing. | 02:04:20 | |
| For some reason I can't find any reference now, but I seem to remember the problem was with solution files specifically causing the same project to be build twice concurrently when there's a diamond dependency. I think it had something to do with the target framework or runtime being used as well. There are a bunch of packages that work around it. For example
| 02:19:29 | |
| 13 Aug 2025 | ||
| Hi, me again. Sorry
Anyone have any suggestions on what to do next? | 17:18:25 | |
| i thought nativeaot and multi-file were mutually exclusive? | 17:19:34 | |
| Can't say I kno | 17:19:56 | |
| * Can't say I know | 17:19:58 | |
| nativeaot has to be self-contained, yeah | 17:20:22 | |
| ready2run is a form of aot, but that's not nativeaot | 17:20:55 | |
My friend seems to think that AoT (I'm assuming nativeaot) can be enabled while selfContained = false; is set (seemingly to not need the runtime at all?), but the above error seems to claim otherwise. | 17:29:43 | |
Admittedly I'm not quite sure what I'm asking, since the build works fine with dotnetInstallFlags = [ "-p:PublishAot=false" ]; selfContainedBuild = false; but not with ... [ "-p:PublishAot=true" ]; selfContainedBuild = false; which is what my friend seems to want me to try. | 17:32:47 | |
| If they're mutually exclusive on the Dotnet side then that's completely fine, I will just have to make sure he's aware of that fact. 😅 | 17:33:36 | |
| Or this is a huge misunderstanding on my part with the dev, ugh 😓 Oh well, I'll figure it out eventually. Thanks for the thoughts Emma and 6pak! | 17:41:12 | |
| Okay, sorry, I think I've figured out the situation again and I was slightly wrong.
| 17:55:28 | |
| * Okay, sorry, I think I've figured out the situation again and I was slightly wrong.
| 17:56:00 | |
Download image.png | 17:56:11 | |
buildDotnetModule is adding the PublishTrimmed=false | 17:56:20 | |
I assume publishaot simply overrides --no-self-contained when using dotnet cli normally | 17:56:40 | |
| That's my assumption too, yeah. | 18:02:55 | |
| Is 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 | |
In the mean time, I'm testing "-p:PublishTrimmed=true" as a dotnetInstallFlags option to see what happens. | 18:09:57 | |
| ... The answer is seemingly nothing due to the hook seemingly overriding it. | 18:10:24 | |
why would you want to disable selfContainedBuild on nix side? | 18:11:08 | |
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 | |
* 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 | |
| I mean not setting it to true | 18:22:16 | |
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 | |
| yeah | 18:23:13 | |
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 | |
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 | |