!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

125 Members
24 Servers

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


SenderMessageTime
25 Jun 2023
@countoren:matrix.orgcountoren joined the room.02:41:26
1 Jul 2023
@huantian:huantian.devhuantian is there an updateScript I can use for buildDotnetModule that'll update nugetDeps? or do I have to write my own script for that 20:59:05
@huantian:huantian.devhuantianperhaps this is something that should be added to nix-update?20:59:55
@magikarpz:matrix.orgmdarochaunfortunately, currently you have to write a separate update script for each package23:09:01
@magikarpz:matrix.orgmdarocha making a common one is on my todo list though 23:09:55
6 Jul 2023
@huantian:huantian.devhuantian It seems like it would be relatively easy to add to something like nix-update, all you'd have to do is run the passthru script after updating 00:51:46
10 Jul 2023
@achnazoor:matrix.orgachnazoor joined the room.09:07:56
19 Jul 2023
@nycode:mozilla.orgMarie left the room.22:18:57
24 Jul 2023
@nry_:matrix.orgnry_ joined the room.17:40:14
25 Jul 2023
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.01:57:04
27 Jul 2023
@ribosomerocker:matrix.orgribosomerocker joined the room.03:03:06
30 Jul 2023
@cwstra:matrix.orgCorin (CWStra) joined the room.20:09:42
@cwstra:matrix.orgCorin (CWStra)

I've been having trouble getting dotnet programs to run when they rely on DllImport attributes. Here's a simple github repo that demonstrates the problem:
https://github.com/cwstra/nixos-dll-example/tree/example

On my nixos machine, running nix-shell run "dotnet run" in there spits out:

"Error loading unmanaged library from path: <snip>/nixos-dll-example/bin/Debug/net7.0/runtimes/linux-x64/native/libassimp.so".

From the path, I take it that it's not trying to import a globally-installed library (though I did add it to the nix-shell just in case). Does anyone have insight as to if/how I could set up an environment where I could work on projects with these dependencies?

21:47:46
3 Aug 2023
@raphi:tapesoftware.netraphi
In reply to @cwstra:matrix.org

I've been having trouble getting dotnet programs to run when they rely on DllImport attributes. Here's a simple github repo that demonstrates the problem:
https://github.com/cwstra/nixos-dll-example/tree/example

On my nixos machine, running nix-shell run "dotnet run" in there spits out:

"Error loading unmanaged library from path: <snip>/nixos-dll-example/bin/Debug/net7.0/runtimes/linux-x64/native/libassimp.so".

From the path, I take it that it's not trying to import a globally-installed library (though I did add it to the nix-shell just in case). Does anyone have insight as to if/how I could set up an environment where I could work on projects with these dependencies?

$ ldd bin/Debug/net7.0/runtimes/linux-x64/native/libassimp.so
        linux-vdso.so.1 (0x00007ffe88bd4000)
        libz.so.1 => not found
        librt.so.1 => /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/librt.so.1 (0x00007fd439b52000)
        libstdc++.so.6 => not found
        libm.so.6 => /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libm.so.6 (0x00007fd439a72000)
        libgcc_s.so.1 => /nix/store/jd99cyc0251p0i5y69w8mqjcai8mcq7h-xgcc-12.2.0-libgcc/lib/libgcc_s.so.1 (0x00007fd438bdf000)
        libc.so.6 => /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6 (0x00007fd4389f9000)
        /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib64/ld-linux-x86-64.so.2 (0x00007fd439b59000)

The assimp native library depends on libz and libstdc++. Add this to the shellHook:

export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.libc pkgs.zlib ]}:$LD_LIBRARY_PATH
08:59:53
5 Aug 2023
@cwstra:matrix.orgCorin (CWStra)I thought I was missing a trick. Thanks for the help!21:11:02
13 Aug 2023
@10leej:matrix.orgnevoyu joined the room.01:25:16
@yarekt:matrix.orgYarek T joined the room.16:54:23
@yarekt:matrix.orgYarek THiya. I'm at a job where we use a lot of dotnet, happy to help with issues16:59:06
@yarekt:matrix.orgYarek T
In reply to @raphi:tapesoftware.net
$ ldd bin/Debug/net7.0/runtimes/linux-x64/native/libassimp.so
        linux-vdso.so.1 (0x00007ffe88bd4000)
        libz.so.1 => not found
        librt.so.1 => /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/librt.so.1 (0x00007fd439b52000)
        libstdc++.so.6 => not found
        libm.so.6 => /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libm.so.6 (0x00007fd439a72000)
        libgcc_s.so.1 => /nix/store/jd99cyc0251p0i5y69w8mqjcai8mcq7h-xgcc-12.2.0-libgcc/lib/libgcc_s.so.1 (0x00007fd438bdf000)
        libc.so.6 => /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6 (0x00007fd4389f9000)
        /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib64/ld-linux-x86-64.so.2 (0x00007fd439b59000)

The assimp native library depends on libz and libstdc++. Add this to the shellHook:

export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.libc pkgs.zlib ]}:$LD_LIBRARY_PATH
Sweet, this actually fixes my issue with missing sqlite lib. something custom that we have to ship. Nice co-incidence, I was dreading having to deal with this on monday. Thanks!
20:19:25
@yarekt:matrix.orgYarek T Just out of curiosity, is it possible to convert this addition to be system wide? using environment.sessionVariables sort of doesn't look right 20:21:56
@yarekt:matrix.orgYarek T * Just out of curiosity, is it possible to convert this addition to be system wide? using environment.sessionVariables sort of doesn't look right. I have to compile and run a bunch of different dotnet projects, this lib is needed a lot. Wouldn't mind having it available system wide 20:25:32
@yarekt:matrix.orgYarek T * Just out of curiosity, is it possible to convert this addition to be system wide? using environment.sessionVariables sort of doesn't look right. I have to compile and run a bunch of different dotnet projects, this lib is needed a lot. Wouldn't mind having it available system wide, or I'll basically be stuck in a nix-shell all the time 20:25:50
14 Aug 2023
@emma:rory.gayEmma [it/its] joined the room.03:24:41
@emma:rory.gayEmma [it/its] Microsoft.NETCore.App.Runtime.Mono.browser-wasm seems to be missing from dotnet-sdk_7's packages, this is required to build a blazor wasm app, any solutions? 03:32:53
@emma:rory.gayEmma [it/its]

build fails as such:

MatrixRoomUtils.Web-v1> unpacking sources
MatrixRoomUtils.Web-v1> unpacking source archive /nix/store/ghrc75bpl7lkzjfyg7y5mw04i5bw7kvm-h6sn3kw7ld0rilnv6gf49qs01zsnhg34-source
MatrixRoomUtils.Web-v1> source root is h6sn3kw7ld0rilnv6gf49qs01zsnhg34-source
MatrixRoomUtils.Web-v1> patching sources
MatrixRoomUtils.Web-v1> updateAutotoolsGnuConfigScriptsPhase
MatrixRoomUtils.Web-v1> configuring
MatrixRoomUtils.Web-v1> Executing dotnetConfigureHook
MatrixRoomUtils.Web-v1> Cannot find a manifest file.
MatrixRoomUtils.Web-v1> For a list of locations searched, specify the "-d" option before the tool name.
MatrixRoomUtils.Web-v1> No tools were restored.
MatrixRoomUtils.Web-v1>   Determining projects to restore...
MatrixRoomUtils.Web-v1> /build/h6sn3kw7ld0rilnv6gf49qs01zsnhg34-source/MatrixRoomUtils.Web/MatrixRoomUtils.Web.csproj : error NU1101: Unable to find package Microsoft.NETCore.App.Runtime.Mono.browser-wasm. No packages exist with this id in source(s): nugetSource
MatrixRoomUtils.Web-v1>   Failed to restore /build/h6sn3kw7ld0rilnv6gf49qs01zsnhg34-source/MatrixRoomUtils.Web/MatrixRoomUtils.Web.csproj (in 1.12 sec).
MatrixRoomUtils.Web-v1>   Restored /build/h6sn3kw7ld0rilnv6gf49qs01zsnhg34-source/LibMatrix/LibMatrix/LibMatrix.csproj (in 538 ms).
error: builder for '/nix/store/mmjdifnfgrc3f4ragf8pql2fxsc73m1a-MatrixRoomUtils.Web-v1-1.drv' failed with exit code 1;
03:33:58
@emma:rory.gayEmma [it/its] *

build fails as such:

...
MatrixRoomUtils.Web-v1>   Determining projects to restore...
MatrixRoomUtils.Web-v1> /build/h6sn3kw7ld0rilnv6gf49qs01zsnhg34-source/MatrixRoomUtils.Web/MatrixRoomUtils.Web.csproj : error NU1101: Unable to find package Microsoft.NETCore.App.Runtime.Mono.browser-wasm. No packages exist with this id in source(s): nugetSource
MatrixRoomUtils.Web-v1>   Failed to restore /build/h6sn3kw7ld0rilnv6gf49qs01zsnhg34-source/MatrixRoomUtils.Web/MatrixRoomUtils.Web.csproj (in 1.12 sec).
MatrixRoomUtils.Web-v1>   Restored /build/h6sn3kw7ld0rilnv6gf49qs01zsnhg34-source/LibMatrix/LibMatrix/LibMatrix.csproj (in 538 ms).
error: builder for '/nix/store/mmjdifnfgrc3f4ragf8pql2fxsc73m1a-MatrixRoomUtils.Web-v1-1.drv' failed with exit code 1;
03:34:30

Show newer messages


Back to Room ListRoom Version: 9