From 1ff44ebd63e18276d6b7e1b295de4052eb4c729b Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 11 Aug 2023 21:51:50 +0200 Subject: [PATCH] Update search path check warning --- CHANGELOG.md | 5 +++++ tools/yabridgectl/src/actions.rs | 2 +- tools/yabridgectl/src/util.rs | 35 +++++++++++++++----------------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cf72926..82a19549 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### yabridgectl + +- Some outdated warning messages have been updated to make yabridge's current + state. + ### Packaging notes - This release includes a workaround to make bitsery compile with GCC 13 due to diff --git a/tools/yabridgectl/src/actions.rs b/tools/yabridgectl/src/actions.rs index 25857753..edcf1abd 100644 --- a/tools/yabridgectl/src/actions.rs +++ b/tools/yabridgectl/src/actions.rs @@ -833,7 +833,7 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> { // The path setup is to make sure that the `libyabridge-chainloader-{clap,vst2,vst3}.so` copies can // find `yabridge-host.exe` and by extension the plugin libraries. That last part should already // be the case if we get to this point though. - verify_path_setup(config)?; + verify_path_setup()?; // This check is only performed once per combination of Wine and yabridge versions verify_wine_setup(config)?; diff --git a/tools/yabridgectl/src/util.rs b/tools/yabridgectl/src/util.rs index 1ea87cec..09659029 100644 --- a/tools/yabridgectl/src/util.rs +++ b/tools/yabridgectl/src/util.rs @@ -227,22 +227,20 @@ pub fn normalize_path(path: &Path) -> PathBuf { /// This is a bit messy, and with yabridge 2.1 automatically searching in `~/.local/share/yabridge` /// it's probably not really needed anymore, but it could still be useful in some edge case /// scenarios. -pub fn verify_path_setup(config: &Config) -> Result { +pub fn verify_path_setup() -> Result { // First we'll check `~/.local/share/yabridge`, since that's a special location where yabridge // will always search - let xdg_data_yabridge_exists = config::yabridge_directories() - .map(|dirs| { - dirs.get_data_home() - .join(YABRIDGE_HOST_EXE_NAME) - .is_executable() - }) + let xdg_data_yabridge = config::yabridge_directories().map(|dirs| dirs.get_data_home()); + let xdg_data_yabridge_exists = xdg_data_yabridge + .map(|data_home| data_home.join(YABRIDGE_HOST_EXE_NAME).is_executable()) .unwrap_or(false); if xdg_data_yabridge_exists { return Ok(true); } // Then we'll check the login shell, since DAWs launched from the GUI will have the same - // environment + // environment. This check is mostly vestigial since people really shouldn't be installing + // yabridge to random locations anymore. match env::var("SHELL") { Ok(shell_path) => { // `$SHELL` will often contain a full path, but it doesn't have to @@ -307,18 +305,17 @@ pub fn verify_path_setup(config: &Config) -> Result { eprintln!( "\n{}", wrap(&format!( - "Warning: 'yabridge-host.exe' is not present in your login shell's \ - search path. Yabridge won't be able to run using the copy-based \ - installation method until this is fixed.\n\ - Add '{}' to {}'s login shell {} environment variable. See the \ - troubleshooting section of the readme for more details. Rerun this \ - command to verify that the variable has been set correctly, and then \ - reboot your system to complete the setup.\n\ + "Warning: '{}' is not present in either '{}' your login shell's \ + search path. You may not have extracted yabridge's files to the correct location. \ + See the readme's usage section for more details. Rerun this command to verify \ + that the variable has been set correctly.\n\ \n\ - https://github.com/robbert-vdh/yabridge#troubleshooting-common-issues", - config.files()?.vst2_chainloader.parent().unwrap().display(), - shell.bright_white(), - "PATH".bright_white() + https://github.com/robbert-vdh/yabridge#usage", + "yabridge-host.exe".bright_white(), + // We could grab the actual `$XDG_DATA_HOME` location here but most + // people will not have set that environment variable and this looks a + // bit clearer + "~/.local/share/yabridge".bright_white(), )) );