JUCE icon indicating copy to clipboard operation
JUCE copied to clipboard

[Bug]: Cannot even list plugins, if one VST3 has a missing architecture, on Apple Silicon

Open timoscs opened this issue 2 years ago • 0 comments

Detailed steps on how to reproduce the bug

Attempting to list plugins, if there's a VST3 which cannot be loaded (in this case, due to incompatible architecture, with the error message:

'/Library/Audio/Plug-Ins/VST3/s(M)exoscope.vst3/Contents/MacOS/s(M)exoscope' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
The bundle doesn’t contain a version for the current architecture.

), the program stops with an assert JUCE Assertion failure in juce_VST3PluginFormat.cpp:1050, which is https://github.com/juce-framework/JUCE/blob/d24c2729268e322f3ba1b5070eb96ab232d7f6ba/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp#L1050

Continuing from the assert in the debugger works though (I haven't tried actually loading the plugin, but that's not relevant).

My code is:

//Look for plugins
DBG("Looking for plugins!");
mPlugFormats.addDefaultFormats();
for (const auto & format : mPlugFormats.getFormats()) {
    DBG("Found format " << format->getName());
    
    PluginDirectoryScanner scanner(mKnownPlugins, *format, format->getDefaultLocationsToSearch(), false, File());
    String name;
    while (scanner.scanNextFile(true, name)) {
        DBG("Found plugin " << name);
    }
    
}

where the member variables are:

...
juce::AudioPluginFormatManager     mPlugFormats;
juce::KnownPluginList              mKnownPlugins{};
...

What is the expected behaviour?

I would expect to be able to list all plugins, even if some of them cannot be loaded, even under debug, without having to manually continue under the debugger, i.e. there should be some way to programmatically handle the error.

On a more philosophical note, it seems suspicious to have an assert fail where you expect to continue past it in release to get the list of working plug-ins.

Operating systems

macOS

What versions of the operating systems?

13.4

Architectures

ARM

Stacktrace

2023-08-10 08:23:45.493579+0300 SuperSVFProductionTest[91661:3541795] [loading] Error loading /Library/Audio/Plug-Ins/VST3/s(M)exoscope.vst3/Contents/MacOS/s(M)exoscope (74):  dlopen(/Library/Audio/Plug-Ins/VST3/s(M)exoscope.vst3/Contents/MacOS/s(M)exoscope, 0x0106): tried: '/Users/timoalho/Repos/SuperSVFFirmware/ProductionTestGui/SuperSVFProductionTest/Builds/MacOSX/build/Debug/s(M)exoscope' (no such file), '/usr/lib/system/introspection/s(M)exoscope' (no such file, not in dyld cache), '/Library/Audio/Plug-Ins/VST3/s(M)exoscope.vst3/Contents/MacOS/s(M)exoscope' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Audio/Plug-Ins/VST3/s(M)exoscope.vst3/Contents/MacOS/s(M)exoscope' (no such file), '/Library/Audio/Plug-Ins/VST3/s(M)exoscope.vst3/Contents/MacOS/s(M)exoscope' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
The bundle doesn’t contain a version for the current architecture.
JUCE Assertion failure in juce_VST3PluginFormat.cpp:1050

Plug-in formats (if applicable)

VST3

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • [X] I agree to follow the Code of Conduct

timoscs avatar Aug 11 '23 06:08 timoscs