mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
[yabridgectl] Make scanning errors non-fatal
This should never occur, but somehow people have text files with .dll or .vst3 extensions in their plugin directories. This resolves #185.
This commit is contained in:
+6
-1
@@ -19,8 +19,13 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
presets due to some mutually recursive function calls that weren't being
|
||||
handled as such.
|
||||
|
||||
### yabridge
|
||||
### yabridgectl
|
||||
|
||||
- Parsing errors for plugin binaries are now non-fatal. This could happen when
|
||||
you have a text file with a `.dll` or `.vst3` extension in your plugin search
|
||||
locations. This normally would never happen, but it can happen if you manually
|
||||
extract a .zip file containing Windows plugins to those directories that was
|
||||
created on macOS. Don't ask me how or why.
|
||||
- Don't panic when someone `yabridgectl add`'ed part of the contents of a
|
||||
Windows VST3 bundle. For the record, you really, really, _really_ shouldn't be
|
||||
doing this.
|
||||
|
||||
@@ -547,7 +547,17 @@ impl SearchIndex {
|
||||
Ok(Err(path))
|
||||
}
|
||||
})
|
||||
.collect::<Result<_>>()?;
|
||||
// Make parsing failures non-fatal. People somehow extract these `__MACOSX` and other
|
||||
// junk files from zip files containing Windows VST2/VST3 plugins created on macOS to
|
||||
// their plugin directories (how does such a thing even happen in the first place?)
|
||||
.filter_map(|result: Result<Result<Vst2Plugin, PathBuf>>| match result {
|
||||
Ok(result) => Some(result),
|
||||
Err(err) => {
|
||||
eprintln!("WARNING: Skipping file during scan: {err:#}\n");
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
// We need to do the same thing with VST3 plugins. The added difficulty here is that we have
|
||||
// to figure out of the `.vst3` file is a legacy standalone VST3 module, or part of a VST
|
||||
@@ -629,7 +639,17 @@ impl SearchIndex {
|
||||
Ok(Err(module_path))
|
||||
}
|
||||
})
|
||||
.collect::<Result<_>>()?;
|
||||
// Make parsing failures non-fatal. People somehow extract these `__MACOSX` and other
|
||||
// junk files from zip files containing Windows VST2/VST3 plugins created on macOS to
|
||||
// their plugin directories (how does such a thing even happen in the first place?)
|
||||
.filter_map(|result: Result<Result<Vst3Module, PathBuf>>| match result {
|
||||
Ok(result) => Some(result),
|
||||
Err(err) => {
|
||||
eprintln!("WARNING: Skipping file during scan: {err:#}\n");
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
let mut plugins: Vec<Plugin> = Vec::new();
|
||||
let mut skipped_files: Vec<PathBuf> = Vec::new();
|
||||
|
||||
@@ -36,7 +36,7 @@ pub struct Pe32Info {
|
||||
pub fn parse_pe32_binary<P: AsRef<Path>>(binary: P) -> Result<Pe32Info> {
|
||||
parse_pe32_goblin(&binary).or_else(|err| {
|
||||
parse_pe32_winedump(binary)
|
||||
.with_context(|| format!("Parsing with goblin also failed: {err}"))
|
||||
.with_context(|| format!("Failed to parse with both winedump and goblin: {err}"))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user