1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! VST3 discovery probe process.
//!
//! A deliberately tiny, single-shot binary used by the crate's crash-resistant discovery
//! path ([`vst3_host::discovery::discover_plugins_safe`]). It takes a single `.vst3` path
//! as its only argument, runs the library's normal in-process introspection
//! ([`vst3_host::get_detailed_plugin_info`]) on it, prints the result as one line of JSON
//! to stdout on success, and exits non-zero on any failure.
//!
//! The whole point is process isolation for the *introspection* step: some installed
//! plugins call `abort()` or trigger a pure-virtual call while being instantiated, which
//! terminates the process. By doing that work here, in a child process, a crash kills
//! *this* process — the parent scanner sees a non-zero exit / signal death and skips the
//! plugin instead of dying itself. A Rust `catch_unwind` in the parent cannot achieve this
//! (an `abort()` does not unwind), which is why a separate process is required.
//!
//! This binary is intentionally independent of the run-time isolation IPC
//! (`vst3-host-helper`): it speaks no protocol, holds no state, and exits immediately.
use PathBuf;
use ExitCode;