Skip to content

Commit

Permalink
[yabridgectl] Show VST2 library architecture
Browse files Browse the repository at this point in the history
Just like it already did for the VST3 library. This information was not
necessary for the functionality of yabridgectl, but it does look nicer
this way.
  • Loading branch information
robbert-vdh committed Apr 16, 2022
1 parent 5853295 commit d2a21b2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ Versioning](https://semver.org/spec/v2.0.0.html).
once after updating to yabridge 4.0, yabridge can now be updated without
needing to rerun `yabridgectl sync`. This is particularly useful when using a
distro packaged version of yabridge.
- `yabridgectl status` now lists the architecture of
`libyabridge-chainloader-vst2.so` just like it already did for the VST3
library.

### Packaging notes

Expand Down
6 changes: 3 additions & 3 deletions tools/yabridgectl/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ pub fn show_status(config: &Config) -> Result<()> {
let files = config.files();
match &files {
Ok(files) => {
// TOOD: Also include the architecture here to avoid confusion
println!(
"libyabridge-chainloader-vst2.so: '{}'",
files.vst2_chainloader.display()
"libyabridge-chainloader-vst2.so: '{}' ({})",
files.vst2_chainloader.display(),
files.vst2_chainloader_arch,
);
println!(
"libyabridge-chainloader-vst3.so: {}\n",
Expand Down
12 changes: 12 additions & 0 deletions tools/yabridgectl/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ pub struct KnownConfig {
pub struct YabridgeFiles {
/// The path to `libyabridge-chainloader-vst2.so` we should use.
pub vst2_chainloader: PathBuf,
/// The file's architecture is used only for display purposes in `yabridgectl status`.
pub vst2_chainloader_arch: LibArchitecture,
/// The path to `libyabridge-chainloader-vst3.so` we should use, if yabridge has been compiled
/// with VST3 support. We need to know if it's a 32-bit or a 64-bit library so we can properly
/// set up the merged VST3 bundles.
Expand Down Expand Up @@ -270,6 +272,15 @@ impl Config {
}
};

// This is displayed in `yabridgectl status`
let vst2_chainloader_arch =
utils::get_elf_architecture(&vst2_chainloader).with_context(|| {
format!(
"Could not determine ELF architecture for '{}'",
vst2_chainloader.display()
)
})?;

// Based on that we can check if `libyabridge-chainloader-vst3.so` exists, since yabridge
// can be compiled without VST3 support
let vst3_chainloader = match vst2_chainloader.with_file_name(VST3_CHAINLOADER_NAME) {
Expand Down Expand Up @@ -301,6 +312,7 @@ impl Config {

Ok(YabridgeFiles {
vst2_chainloader,
vst2_chainloader_arch,
vst3_chainloader,
yabridge_host_exe,
yabridge_host_exe_so,
Expand Down

0 comments on commit d2a21b2

Please sign in to comment.