!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

126 Members
24 Servers

Load older messages


SenderMessageTime
14 Aug 2023
@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
16 Aug 2023
@magikarpz:matrix.orgmdarocha from what I searched, wasm-tools, needed by the blazor wasm compilation, is packages as a dotnet workload 06:55:48
@magikarpz:matrix.orgmdarochaand unfortunately, workloads aren't supported in Nix for now - see https://github.com/NixOS/nixpkgs/issues/22610706:56:10
@magikarpz:matrix.orgmdarochaso to make wasm compilation fully work you would need to try to hack together some form of workload support, I know that previously something was attempted for maui06:56:44
19 Aug 2023
@emma:rory.gayEmma [it/its]shouldnt it be a matter of installing the relevant nuget packages?11:46:17
@magikarpz:matrix.orgmdarochafrom what I understand workloads work a little bit differently and aren’t covered by the current nix mechanisms11:47:47
@emma:rory.gayEmma [it/its]im guessing the dotnet packages also cant be extended to ship with the workloads builtin?11:50:54
@magikarpz:matrix.orgmdarocha there were attempts from what i remember, see the issue i linked above 11:51:33
@magikarpz:matrix.orgmdarocha but properly implementing workloads in nix would require understanding how they are installed by the dotnet cli so that we can provide them using the standard nix functions 11:52:14
@emma:rory.gayEmma [it/its] at least going by https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/development/compilers/dotnet/versions/7.0.nix, there seems to be a packages array, couldnt the missing ones be added there? 11:52:19
@magikarpz:matrix.orgmdarochanope, this package array is used to streamline the package updating process11:53:07
@emma:rory.gayEmma [it/its]it looks like theyre all just installed to /usr/share/dotnet/packs11:53:16
@emma:rory.gayEmma [it/its]* it looks like theyre all just installed to /usr/share/dotnet/packs (arch)11:53:21

Show newer messages


Back to Room ListRoom Version: 9