From 47c79e7d535084bcfcbdd256d1befefde190ddde Mon Sep 17 00:00:00 2001 From: _cry64 Date: Fri, 3 Apr 2026 21:19:53 +1000 Subject: [PATCH] fix Store::realise returning empty --- nixide/src/store/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixide/src/store/mod.rs b/nixide/src/store/mod.rs index f40a395..a2dc000 100644 --- a/nixide/src/store/mod.rs +++ b/nixide/src/store/mod.rs @@ -108,7 +108,7 @@ impl Store { /// /// Returns an error if the path cannot be realized. /// - pub fn realise( + pub fn realise( &self, path: &StorePath, user_callback: fn(&str, &StorePath), @@ -130,7 +130,7 @@ impl Store { let callback = unsafe { (*userdata).inner }; callback(output_name.as_ref(), &store_path); - (output_name, store_path); + (unsafe {(*userdata).retval }).append((output_name, store_path)); }, |callback, state: *mut __UserData, @@ -139,6 +139,8 @@ impl Store { // WARNING: Using `write` instead of assignment via `=` // WARNING: to not call `drop` on the old, uninitialized value. (&raw mut (*state).inner).write(user_callback); + // register return value + (&raw mut (*state).retval).write(Vec::new()); sys::nix_store_realise( ctx.as_ptr(),