From f05ad469801fd1d0be11d04f979ad13b25aecd69 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 6 Sep 2025 12:13:49 +0200 Subject: [PATCH] config_paths: remove vestiges of installable builds Commit 3dc49d9d93f (Allow installable builds to be installed into a specific path (#10923), 2024-12-22) added some ifdefs to use installed config paths for installable builds that have already been installed. The "installable" feature has been superseded by "embed-data" which no longer uses config paths to retrieve files, so remove those code paths. Further cleanup to follow. --- src/env/config_paths.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/env/config_paths.rs b/src/env/config_paths.rs index b36a20347..10ad690cd 100644 --- a/src/env/config_paths.rs +++ b/src/env/config_paths.rs @@ -23,8 +23,10 @@ }; let argv0 = argv0.canonicalize().unwrap_or(argv0); let mut paths = ConfigPaths::default(); + #[allow(unused_mut)] let mut done = false; let exec_path = get_executable_path(&argv0); + #[cfg(not(feature = "embed-data"))] if let Ok(exec_path) = exec_path.canonicalize() { FLOG!( config, @@ -54,22 +56,12 @@ // The next check is that we are in a relocatable directory tree if exec_path.ends_with("bin/fish") { let base_path = exec_path.parent().unwrap().parent().unwrap(); - #[cfg(feature = "embed-data")] - let data_dir = base_path.join("share/fish/install"); - #[cfg(not(feature = "embed-data"))] - let data_dir = base_path.join("share/fish"); - let locale = - (!cfg!(feature = "embed-data")).then(|| base_path.join("share/locale")); paths = ConfigPaths { - // One obvious path is ~/.local (with fish in ~/.local/bin/). - // If we picked ~/.local/share/fish as our data path, - // we would install there and erase history. - // So let's isolate us a bit more. - data: Some(data_dir), + data: Some(base_path.join("share/fish")), sysconf: base_path.join("etc/fish"), doc: base_path.join("share/doc/fish"), bin: Some(base_path.join("bin")), - locale, + locale: Some(base_path.join("share/locale")), } }