mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
uutests: preserve PATH in UCommand to fix NixOS test failures
This ensures that the PATH environment variable is preserved even when cleared, allowing tests to find system utilities on NixOS where they are not in standard locations like /bin. Fixes #10756
This commit is contained in:
committed by
Daniel Hofstetter
parent
5cd51b3f45
commit
8eb77a08b6
@@ -1823,6 +1823,12 @@ impl UCommand {
|
||||
}
|
||||
|
||||
command.env_clear();
|
||||
|
||||
// Preserve PATH
|
||||
if let Some(path) = env::var_os("PATH") {
|
||||
command.env("PATH", path);
|
||||
}
|
||||
|
||||
if cfg!(windows) {
|
||||
// spell-checker:ignore (dll) rsaenh
|
||||
// %SYSTEMROOT% is required on Windows to initialize crypto provider
|
||||
|
||||
Reference in New Issue
Block a user