| 917 | |
| 918 | #[cfg(target_os = "macos")] |
| 919 | fn configure_runtime_loader_env(runtime_dir: &Path) -> Result<(), String> { |
| 920 | let existing = std::env::var_os("DYLD_FALLBACK_LIBRARY_PATH"); |
| 921 | let mut paths = vec![runtime_dir.to_path_buf()]; |
| 922 | if let Some(existing) = existing { |
| 923 | paths.extend(std::env::split_paths(&existing)); |
| 924 | } |
| 925 | let joined = |
| 926 | std::env::join_paths(paths).map_err(|e| format!("join DYLD_FALLBACK_LIBRARY_PATH: {e}"))?; |
| 927 | unsafe { |
| 928 | std::env::set_var("DYLD_FALLBACK_LIBRARY_PATH", joined); |
| 929 | } |
| 930 | Ok(()) |
| 931 | } |
| 932 | |
| 933 | #[cfg(target_os = "linux")] |
| 934 | fn configure_runtime_loader_env(runtime_dir: &Path) -> Result<(), String> { |