!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

114 Members
23 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
18 May 2025
@whovian9369:matrix.orgWhovian9369That seems interesting.22:57:59
@6pak:matrix.org6pak because source build officially supports only 1xx 22:58:36
@6pak:matrix.org6pakso newer feature bands are MS binaries only22:58:51
@6pak:matrix.org6pak* so later feature bands are MS binaries only22:58:58
@whovian9369:matrix.orgWhovian9369
  patchPhase = ''
    # Remove global.json to prevent build issues stemming from its existence.
    # We're pinning to an SDK version by using Nix anyway, so it's not super
    # important to worry about Upstream's set version.
    rm global.json
'';

So this seems to have worked fine. Thank you again for the thoughts!

23:10:35
@whovian9369:matrix.orgWhovian9369That's very interesting. Thank you for the thoughts!23:10:47
@whovian9369:matrix.orgWhovian9369 *
  patchPhase = ''
    # Remove global.json to prevent build issues stemming from its existence.
    # We're pinning to an SDK version by using Nix anyway, so it's not super
    # important to worry about Upstream's set version.
    rm global.json
  '';

So this seems to have worked fine. Thank you again for the thoughts!

23:11:00
@6pak:matrix.org6pak you probably want postPatch, but yeah, lgtm 23:23:03
@whovian9369:matrix.orgWhovian9369 Oh, do you have a specific thought on why I should be using postPatch instead of patchPhase for this? 23:23:37
@whovian9369:matrix.orgWhovian9369 I'm also doing more in patchPhase than just what I put above, so if you think moving that rm to postPatch instead is good then I'll probably just move the whole block. 23:24:50
@whovian9369:matrix.orgWhovian9369 * I'm also doing more in patchPhase than just what I put above, so if you think moving that rm to postPatch instead is good then I'll probably just rename the whole block. 23:24:58
@6pak:matrix.org6pak overriding patchPhase will break patches iirc 23:24:58
@whovian9369:matrix.orgWhovian9369 Eh fair, I'll probably split it into two commits (updating and then swapping to postPatch) - Thanks for the thoughts! 23:26:04
27 May 2025
@deeok:matrix.org@deeok:matrix.org joined the room.19:17:22
28 May 2025
@crgre:matrix.orgcrgre joined the room.15:18:28
@pyrox:pyrox.devdish [Fox/It/She] left the room.15:21:57
29 May 2025
@whovian9369:matrix.orgWhovian9369

Hey, I'm here again to cause issues. :P
I'm trying to work with Nuke.Common to properly do part of a build, and fetch-deps is throwing MSBUILD : error MSB1009: Project file does not exist.

$ nix build -L .#default.passthru.fetch-deps -o fetch-deps
$ ./fetch-deps deps.json
fetching dependencies for test-2024.08.29
Running phase: unpackPhase
unpacking source archive /nix/store/xfrqd606lr502c3z0dm5y84ljzr1x5nr-source
source root is source
Running phase: patchPhase
Running phase: configureNuget
The template "NuGet Config" was created successfully.

Processing post-creation actions...



Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
  Determining projects to restore...
  Restored /tmp/fetch-deps-test-2024.08.29.9gDEqK/source/build/_build.csproj (in 4.55 sec).
MSBUILD : error MSB1009: Project file does not exist.
Switch: dirs.proj
02:14:32
@whovian9369:matrix.orgWhovian9369Does anyone happen to have any ideas?02:14:42
@whovian9369:matrix.orgWhovian9369 Oh maybe that's my fault for not fully fixing the for project in... section - Lemme see if I can fix it. 02:16:44
@whovian9369:matrix.orgWhovian9369Yep, silly me - That was it.02:17:23
@whovian9369:matrix.orgWhovian9369 Now I'm running into NETSDK1004 so that's definitely progress! 02:38:00
@corngood:corngood.comCorngood

You might want to look at avalonia in nixpkgs. It's the only package using nuke that comes to mind. One of the things it does is:

      configurePhase = ''
        runHook preConfigure
        for project in nukebuild/_build.csproj dirs.proj; do
          for rid in $runtimeIds; do
            dotnet restore --runtime "$rid" "$project"
          done
        done
        runHook postConfigure
      '';
11:59:28
@whovian9369:matrix.orgWhovian9369 Thanks for the suggestion! I already am looking at Avalonia and had originally copied runtimeIds and configurePhase without modification, which caused the initial MSB1009 issue that I was getting. Removing the project for loop fixed that, as I only have the one project file. Unfortunately for me, there's no listed fix for NETSDK1004 in the Avalonia package.nix 13:11:47
@whovian9369:matrix.orgWhovian9369 * Thanks for the suggestion! I already am looking at Avalonia and had originally copied runtimeIds and configurePhase without modification, which caused the initial MSB1009 issue that I was getting. Removing the project for loop fixed that, as I only have the one project file. Unfortunately for me, there's no listed fix for NETSDK1004 in the Avalonia package.nix. 13:11:59
@whovian9369:matrix.orgWhovian9369(Or in all of Nixpkgs from what I can tell. I'm not terribly surprised at that, though I was a little hopeful.)13:18:44
@corngood:corngood.comCorngoodI think NETSDK1004 would usually be caused by restore/build not using the same args, or possibly a mismatch between restoring a project and a solution?13:34:01
@whovian9369:matrix.orgWhovian9369It seems to be happening with the Nuke setup, so I'm a bit confused then - I'll get a log snippet in a moment as I forgot to last night.14:23:12
@whovian9369:matrix.orgWhovian9369
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/xfrqd606lr502c3z0dm5y84ljzr1x5nr-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: configureNuget
@nix { "action": "setPhase", "phase": "configureNuget" }
The template "NuGet Config" was created successfully.

Processing post-creation actions...


Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
  Determining projects to restore...
  Restored /build/source/build/_build.csproj (in 2.08 sec).
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Executing dotnetBuildHook
/nix/store/j23hyfpfhlibl3jrighz7pcblayjlcs7-dotnet-sdk-8.0.409/share/dotnet/sdk/8.0.409/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1004: Assets file '/build/source/src/hactoolnet/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/build/source/src/hactoolnet/hactoolnet.csproj]

Build FAILED.

/nix/store/j23hyfpfhlibl3jrighz7pcblayjlcs7-dotnet-sdk-8.0.409/share/dotnet/sdk/8.0.409/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1004: Assets file '/build/source/src/hactoolnet/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/build/source/src/hactoolnet/hactoolnet.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.63

Here's the failure log.

14:25:06

Show newer messages


Back to Room ListRoom Version: 9