!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

639 Members
Rust147 Servers

Load older messages


SenderMessageTime
11 Nov 2025
@robert:scs.ems.hostRobert Rose changed their display name from Robert Rose - 🏝️ bis 10.11.25 to Robert Rose.09:22:30
@oak:universumi.fioak 🏳️‍🌈♥️ changed their profile picture.19:20:27
@n8henrie:matrix.orgn8henrie

Hi all -- relative novice, hoping someone can help me run a rust binary built outside of nix in a nixosTest (as part of a bisect to fix a problem upstream). I've been using runCommand to copy it into the test image with autoPatchelfHook providing the dependencies and dontStrip = true, but still getting symbol lookup error: /nix/store/...espanso/bin/espanso: undefined symbol: _ZN12wxWindowBase14RegisterHotKeyEiii at runtime (even though wxGTK32 is in the buildInputs).

Including all the buildInputs for an xorg-based linux system from https://github.com/espanso/espanso/blob/dev/nix/espanso.nix

Anyone know why copying a binary that runs fine outside nix into a NixOS VM would give me this wx-related missing symbol error when all the required libraries seem to be linked (at least I don't see anything obviously missing based on ldd)?

20:41:54
@ghpzin:envs.netghpzin Do you need to do something special during runtime to trigger it ? 21:29:43
@n8henrie:matrix.orgn8henrie To trigger the error? No, even a --version triggers it. 21:37:40
@ghpzin:envs.netghpzin Can't reproduce, seems to work on both my machine and nixosTest.
Unless you use headless test for some reason.
21:41:10
@n8henrie:matrix.orgn8henrieNo, not headless. You are building espanso from source on a non-nixos system with standard Rust tooling, copying the binary while patching with autoPatchelfHook, and then running it in nix, and it's working?21:42:48
@ghpzin:envs.netghpzin No, downloading .deb from releases page, doing all that and it runs.
Let me clean up things and push.
21:52:28
@n8henrie:matrix.orgn8henrieOh interesting. My ultimate goal is a git bisect on the source to fix an upstream bug that was introduced sometime in the last year and a half (ugh), so I'll need to be able to build from source, but that's a reasonable way to test. I'll give that a shot.21:54:02
@ghpzin:envs.netghpzin
nix build github:ghpzin/nixpkgs/12e2905327c7efac6df82d587f0ef29f68a0cc43#nixosTests.espanso
xdg-open ./result/started.png
21:55:41
@ghpzin:envs.netghpzin
nix build github:ghpzin/nixpkgs/12e2905327c7efac6df82d587f0ef29f68a0cc43#nixosTests.espanso
xdg-open ./result/started.png
I do not think binary in their release .deb should be that different from build result from other distro.
21:57:20
@ghpzin:envs.netghpzinActually if binary built on other distro is the one with problems, maybe it is just a mismatch of wxGTK32 versions.22:09:52
@n8henrie:matrix.orgn8henrieHopefully not, I renovated the build system prior to the 2.3 release using a pretty standard ubuntu build process. Building now.22:10:00
@n8henrie:matrix.orgn8henrieThat could totally be it.22:10:12
@n8henrie:matrix.orgn8henrie

I bet you're right. Yup the deb version is working fine.

But now I'm not sure how to get a matching wxGTK32 version on Arch, but I can look into that.

It certainly would be much easier to just bisect by setting src = /path/to/espanso-src, but then cargoHash fails. I set it to look at Cargo.lock instead, but then there's a (or maybe more than one) git dependency that trips things up.

Are you aware of any way that I can override src in the package definition without the cargoHash stuff being wrong on every iteration of a bisect?

22:14:27
@n8henrie:matrix.orgn8henrieLooks like wxgtk 3.2.8.1 on nix, 3.2.8.1-2 on arch.22:15:52
@n8henrie:matrix.orgn8henrieOh, maybe I can just build on a nix shell on arch and get the matching wxgtk...22:16:28
@ghpzin:envs.netghpzin Iirc there is a way to not fill output git hashes importing Cargo.lock with allowBuiltinFetchGit = true; 22:19:29
@ghpzin:envs.netghpzin Iirc a way to not fill output git hashes while importing Cargo.lock is setting allowBuiltinFetchGit = true; 22:19:55
@n8henrie:matrix.orgn8henrieBuilding in a nix shell with the matching version of wxGTK worked! Thanks a ton! I'll experiment with the built-in fetchgit as well, thank you for the suggestion.22:24:34
@n8henrie:matrix.orgn8henrie Just to close the loop, allowBuiltinFetchGit works a treat and is probably an even better approach. Thank you! 22:33:31
@n8henrie:matrix.orgn8henrie This way I can make sure the package builds or exit 125 for the bisect. If the package builds, run the nixosTest and get a result. Fingers crossed. 22:34:37
12 Nov 2025
@inayet:matrix.orgInayet changed their display name from inayet to Inayet.12:37:29
@crop_tech:matrix.orgcrop i am trying to use this crate in a project that i work on on a nixos machine: https://github.com/HadrienG2/hwlocality
it depends on a c library that i add to the shell.nix in the buildInputs = with pkgs; [hwloc] and then set the libpath with libPath = with pkgs; lib.makeLibraryPath buildInputs; ... the library is loaded dynamically as the error appears only when i try to use the crate in rust.
the error is target/release/multi_thread: error while loading shared libraries: libhwloc.so.15: cannot open shared object file: No such file or directory
any suggestions how to fix this?
22:59:37
@crop_tech:matrix.orgcrop i now added the following line to the shell.nix
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}";
but i thought this is not recommended.
23:25:43
@crop_tech:matrix.orgcrop its not "recommended" because now i am missing other libraries (pipewire-...-jack-lib) ... and i don't know how it got put into the LDLIBRARYPATH variable automatically 23:33:14
@crop_tech:matrix.orgcropok i found the solution for the jack problem but it actually doesn't help for hwloc to be found .... which is strange because one time i run the build (but i don't know what i changed it worked)23:46:20
@crop_tech:matrix.orgcrop ok it seems to work if i use the "vendored" hwloc build by cargo ... not ideal (and only without the LDLIBRARYPATH thing which seems to be what i shouldn't do anyway) 23:50:39
15 Nov 2025
@louis2747:matrix.orgLouis2747 joined the room.11:31:57
@k900:0upti.meK900I'm dumb, how do I patch a fetchCargoVendor14:03:33

Show newer messages


Back to Room ListRoom Version: 6