!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

121 Members
24 Servers

Load older messages


SenderMessageTime
14 Aug 2023
@magikarpz:matrix.orgmdarochabut i guess all the blazor stuff isn’t there, so it has to be added07:50:19
@yarekt:matrix.orgYarek THmm, with dotnet you usually specify all the dependencies in its <foo>.csproj file, and they get pulled down in a restore step. Does Nix replace that somehow?16:39:14
@yarekt:matrix.orgYarek TI suppose it wants to if it needs reproducible builds16:39:25
@yarekt:matrix.orgYarek T Oh, are you using dotnetCorePackages.sdk_7_0 or pkgs.dotnet-sdk_7 ? because the former doesn't package aspnetcore even though it says it should 16:41:49
@yarekt:matrix.orgYarek TOh wait, isn't mono like completely gone from dotnet these days? Hmm. Is this thing open source? Do you have something I can replicate on my machine?16:46:26
@magikarpz:matrix.orgmdarochadotnet-sdk_7 is an alias to dotnetcorePackages.sdk_7_0, so I don't know how you can encounter differences between the two16:51:04
@magikarpz:matrix.orgmdarochathey both point to a packaged sdk, which should contain the aspnetcore framework files16:51:23
@magikarpz:matrix.orgmdarocha
In reply to @yarekt:matrix.org
Hmm, with dotnet you usually specify all the dependencies in its <foo>.csproj file, and they get pulled down in a restore step. Does Nix replace that somehow?
in case of Nix, it runs dotnet restore and then builds a deps.nix based on the restored nugets. This doesnt always work, cause sometimes (ie. in case of alternative sdk packages) not all nugets are pulled at restore
16:52:24
@magikarpz:matrix.orgmdarochabut most framework and SDK stuff is included by default when using buildDotnetModule, so it isn't usually a problem16:52:53
@magikarpz:matrix.orgmdarochathe error like with blazor is mostly probably due to missing stuff in the dependencies included by default, which aren't also properly picked up into deps.nix16:53:40
@magikarpz:matrix.orgmdarochaunless there's some other problems, it would also help with debugging to share a repo with a reproduction of the problems16:54:19
@magikarpz:matrix.orgmdarocha * unless there's some other problems, it would also help with debugging to share a repo with a reproduction of the errors16:54:24
@emma:rory.gayEmma [it/its]
In reply to @yarekt:matrix.org
Oh wait, isn't mono like completely gone from dotnet these days? Hmm. Is this thing open source? Do you have something I can replicate on my machine?
my thing? yes
17:47:15
@emma:rory.gayEmma [it/its] git clone --recursive https://git.rory.gay/matrix/MatrixRoomUtils.git 17:48:08
@emma:rory.gayEmma [it/its] build with nix build '.?submodules=1#web' -L 17:48:26
@emma:rory.gayEmma [it/its]though if you want i can set up a quick and dirty repro repo (just the template project with a flake)17:50:02
@emma:rory.gayEmma [it/its]keep in mind that repo has the missing framework package manually added17:52:28
@emma:rory.gayEmma [it/its]
In reply to @magikarpz:matrix.org
follow the docs to get a buildDotnetModule derivation working, and then run the fetch-deps script from the derivation attributes, as shown in the docs
ah i remember now why i cant use fetch-deps
17:57:23
@emma:rory.gayEmma [it/its] error: getting status of '/home/root@Rory/EmptyBlazorWasmApp/default.nix': No such file or directory
that doesnt appear to work with flakes
17:57:37
@emma:rory.gayEmma [it/its] building .#default.passthru.fetch-deps made a shellscript as result, i guess thats normal? 19:31:50
@emma:rory.gayEmma [it/its] oh, using that did include browser-wasm 19:33:13
@emma:rory.gayEmma [it/its]

still fails to build though:

emptyblazorwasmapp-v1> /nix/store/igwf7hm6cjdcl0mac0n2rpmq47ssil6k-dotnet-sdk-7.0.306/sdk/7.0.306/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(135,5): error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'browser-wasm'. [/build/ml30php8kkq4lqgh2yc0g9fma5c2jnpm-source/EmptyBlazorWasmApp/EmptyBlazorWasmApp.csproj]
19:35:29
@emma:rory.gayEmma [it/its]Download EmptyBlazorWasmApp.tar.xz19:36:35
@emma:rory.gayEmma [it/its]

steps taken:

  • create empty blazor wasm project
  • add simple flake with 1 output
  • generate a deps.nix by invoking a slightly modified version of nuget-to-nix with a wrapper script (mkdeps) that dotnet restore's to a folder for nuget-to-nix to operate on
  • use nix build .\#default.passthru.fetch-deps to generate script at result
  • run ./result
  • copy output file over deps.nix
  • run nix build .#
19:38:45
15 Aug 2023
@raphi:tapesoftware.netraphi
In reply to @emma:rory.gay

steps taken:

  • create empty blazor wasm project
  • add simple flake with 1 output
  • generate a deps.nix by invoking a slightly modified version of nuget-to-nix with a wrapper script (mkdeps) that dotnet restore's to a folder for nuget-to-nix to operate on
  • use nix build .\#default.passthru.fetch-deps to generate script at result
  • run ./result
  • copy output file over deps.nix
  • run nix build .#
as a workaround you can set useAppHost = false and selfContainedBuild = true in the buildDotnetModule call
blazor wasm support is not ideal atm
08:27:06
@yarekt:matrix.orgYarek T
In reply to @emma:rory.gay

steps taken:

  • create empty blazor wasm project
  • add simple flake with 1 output
  • generate a deps.nix by invoking a slightly modified version of nuget-to-nix with a wrapper script (mkdeps) that dotnet restore's to a folder for nuget-to-nix to operate on
  • use nix build .\#default.passthru.fetch-deps to generate script at result
  • run ./result
  • copy output file over deps.nix
  • run nix build .#
Deps generated are the same for me
16:40:15
@yarekt:matrix.orgYarek TAh but yes, I get the error. How strange. I will poke around more.16:45:53
@10leej:matrix.orgnevoyu left the room.19:34:14
@emma:rory.gayEmma [it/its]
In reply to @emma:rory.gay

steps taken:

  • create empty blazor wasm project
  • add simple flake with 1 output
  • generate a deps.nix by invoking a slightly modified version of nuget-to-nix with a wrapper script (mkdeps) that dotnet restore's to a folder for nuget-to-nix to operate on
  • use nix build .\#default.passthru.fetch-deps to generate script at result
  • run ./result
  • copy output file over deps.nix
  • run nix build .#
the fetch-deps script added one that was missing before with the nuget-to-nix script (Microsoft.NETCore.App.Runtime.Mono.browser-wasm)
19:56:31
@emma:rory.gayEmma [it/its]or at least, it did in our project, didnt check in the repro19:57:49

Show newer messages


Back to Room ListRoom Version: 9