nixide/rust
Robert Hensing 3bef494271 fix: Add mutex to nix_util::settings to prevent concurrent access segfault
Fixes #106

The Nix settings system uses global mutable state without internal
synchronization. When multiple threads call settings::set concurrently
(as happens in parallel test execution), this causes a segfault in the
C++ std::set implementation.

Changes:
- Add mutex to serialize access through the Rust API
- Add documentation explaining thread safety limitations
- Add Once guard in nix-flake tests to minimize concurrent access

The mutex provides protection between Rust callers, though it cannot
completely prevent C++ Nix code from modifying settings concurrently.

(cherry picked from commit 203917657b60c4e1dcbaf442bec64c37c634abc4)
2025-10-04 02:31:16 +02:00
..
nix-c-raw maint: Remove Cargo.toml patch constraints 2025-10-04 02:31:16 +02:00
nix-expr maint: Remove Cargo.toml patch constraints 2025-10-04 02:31:16 +02:00
nix-fetchers maint: Remove Cargo.toml patch constraints 2025-10-04 02:31:16 +02:00
nix-flake fix: Add mutex to nix_util::settings to prevent concurrent access segfault 2025-10-04 02:31:16 +02:00
nix-store maint: Remove Cargo.toml patch constraints 2025-10-04 02:31:16 +02:00
nix-util fix: Add mutex to nix_util::settings to prevent concurrent access segfault 2025-10-04 02:31:16 +02:00
bindgen-gcc.sh maint: Fix apparently ignored '' in BINDGEN_EXTRA_CLANG_ARGS 2025-10-04 02:31:16 +02:00
Cargo.lock maint: Update Cargo.lock 2025-10-04 02:31:16 +02:00
Cargo.toml feat: nix-fetchers crate 2025-10-04 02:31:16 +02:00
nci.nix chore: Apply nixfmt 2025-10-04 02:31:16 +02:00