Tracktion / pluginval

Cross platform plugin testing and validation tool
GNU General Public License v3.0
394 stars 57 forks source link

Make "pluginval as a dependency" a 1st class citizen #137

Open sudara opened 1 week ago

sudara commented 1 week ago

Jotting this down to keep track of me looking into this. The idea is to have pluginval as a project dependency vs. an external tool.

To be clear (also for GPL licensing reasons), pluginval wouldn't be linked to the plugin and shipped to end users. It's just used locally when debugging.

The benefits are:

@eyalamirmusic and I merged some initial work to enable this a while back. https://github.com/Tracktion/pluginval/pull/78

He has a sample plugin showing how he added a custom target for running:

add_custom_target(${BaseTargetName}_Pluginval
        COMMAND
        pluginval
        --validate
        --strictness-level 10
        ${artefact}
        DEPENDS ${BaseTargetName}_VST3 pluginval
        VERBATIM)
sudara commented 1 week ago

Ok, this runs pluginval, but the command doesn't run in the debugger, the process just exits on fail saying "ninja: failed to build"

add_subdirectory("modules/pluginval")

# Use our version of JUCE, not pluginval's
# This is brittle, the string has to match perfectly
set(PLUGINVAL_FETCH_JUCE OFF CACHE BOOL "Fetch JUCE along with PluginVal" FORCE)

get_target_property(artefact ${PROJECT_NAME}_VST3 JUCE_PLUGIN_ARTEFACT_FILE)

add_custom_target(${PROJECT_NAME}_Pluginval
        COMMAND
        pluginval
        --strictness-level 10
        --validate
        ${artefact}
        DEPENDS ${PROJECT_NAME}_VST3 pluginval
        VERBATIM)

This just adds a pluginval target (opens the Pluginval GUI), which is perfect for local dev:

add_custom_target(${PROJECT_NAME}_Pluginval
        DEPENDS ${PROJECT_NAME}_VST3 pluginval
        VERBATIM)

However, on my current error on Windows, with Validate In Process checked, I still don't get any more of the call stack!

sudara commented 1 week ago

Ok, that particular error I was dealing with was behaving strangely in the way the program aborted.

The next issue is hitting a jassert in JUCE.

When running pluginval standalone, it is quite unhelpful, showing only pluginval and juce code in the call stack.

image

When running pluginval as a target in my plugin project, I get a nice call stack all the way through my app code:

image

So far I'm sold cautiously optimistic that this makes debugging much easier.

drowaudio commented 6 days ago

Sounds very cool!