Update search path check warning

This commit is contained in:
Robbert van der Helm
2023-08-11 21:51:50 +02:00
parent cd0d735772
commit 1ff44ebd63
3 changed files with 22 additions and 20 deletions
+5
View File
@@ -8,6 +8,11 @@ Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [Unreleased]
### yabridgectl
- Some outdated warning messages have been updated to make yabridge's current
state.
### Packaging notes ### Packaging notes
- This release includes a workaround to make bitsery compile with GCC 13 due to - This release includes a workaround to make bitsery compile with GCC 13 due to
+1 -1
View File
@@ -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 // 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 // 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. // 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 // This check is only performed once per combination of Wine and yabridge versions
verify_wine_setup(config)?; verify_wine_setup(config)?;
+16 -19
View File
@@ -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` /// 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 /// it's probably not really needed anymore, but it could still be useful in some edge case
/// scenarios. /// scenarios.
pub fn verify_path_setup(config: &Config) -> Result<bool> { pub fn verify_path_setup() -> Result<bool> {
// First we'll check `~/.local/share/yabridge`, since that's a special location where yabridge // First we'll check `~/.local/share/yabridge`, since that's a special location where yabridge
// will always search // will always search
let xdg_data_yabridge_exists = config::yabridge_directories() let xdg_data_yabridge = config::yabridge_directories().map(|dirs| dirs.get_data_home());
.map(|dirs| { let xdg_data_yabridge_exists = xdg_data_yabridge
dirs.get_data_home() .map(|data_home| data_home.join(YABRIDGE_HOST_EXE_NAME).is_executable())
.join(YABRIDGE_HOST_EXE_NAME)
.is_executable()
})
.unwrap_or(false); .unwrap_or(false);
if xdg_data_yabridge_exists { if xdg_data_yabridge_exists {
return Ok(true); return Ok(true);
} }
// Then we'll check the login shell, since DAWs launched from the GUI will have the same // 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") { match env::var("SHELL") {
Ok(shell_path) => { Ok(shell_path) => {
// `$SHELL` will often contain a full path, but it doesn't have to // `$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<bool> {
eprintln!( eprintln!(
"\n{}", "\n{}",
wrap(&format!( wrap(&format!(
"Warning: 'yabridge-host.exe' is not present in your login shell's \ "Warning: '{}' is not present in either '{}' your login shell's \
search path. Yabridge won't be able to run using the copy-based \ search path. You may not have extracted yabridge's files to the correct location. \
installation method until this is fixed.\n\ See the readme's usage section for more details. Rerun this command to verify \
Add '{}' to {}'s login shell {} environment variable. See the \ that the variable has been set correctly.\n\
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\
\n\ \n\
https://github.com/robbert-vdh/yabridge#troubleshooting-common-issues", https://github.com/robbert-vdh/yabridge#usage",
config.files()?.vst2_chainloader.parent().unwrap().display(), "yabridge-host.exe".bright_white(),
shell.bright_white(), // We could grab the actual `$XDG_DATA_HOME` location here but most
"PATH".bright_white() // people will not have set that environment variable and this looks a
// bit clearer
"~/.local/share/yabridge".bright_white(),
)) ))
); );