Build VST3 for Linux - #73
Conversation
…Linux Agent-Logs-Url: https://github.com/probonopd/juicysfplugin/sessions/cb11c309-4f8c-40ba-b139-36dfcd83f3b2 Co-authored-by: probonopd <2480569+probonopd@users.noreply.github.com>
Agent-Logs-Url: https://github.com/probonopd/juicysfplugin/sessions/cb11c309-4f8c-40ba-b139-36dfcd83f3b2 Co-authored-by: probonopd <2480569+probonopd@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds Linux VST3 build support and updates the FluidSynth processing call to compile against newer FluidSynth headers (Ubuntu 24.04), enabling Linux builds (including ARM) and CI artifact generation.
Changes:
- Adjust
fluid_synth_processcall to satisfyfloat**API expectations on Ubuntu 24.04. - Add a GitHub Actions workflow to build the VST3 on Linux for x86_64 and aarch64 and upload artifacts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Source/FluidSynthModel.cpp | Updates the FluidSynth render call to compile with the fluid_synth_process signature used by newer FluidSynth packages. |
| .github/workflows/build-vst3-linux.yml | Introduces CI to build Linux VST3 artifacts (x86_64 + ARM) and upload the resulting .vst3. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| nullptr, | ||
| buffer.getNumChannels(), | ||
| buffer.getArrayOfWritePointers()); | ||
| const_cast<float**>(buffer.getArrayOfWritePointers())); |
There was a problem hiding this comment.
Avoid casting away constness here. AudioBuffer::getArrayOfWritePointers() returns float* const* (the pointer array is const), and const_cast<float**> can become undefined behavior if fluid_synth_process ever writes to that pointer array. Prefer creating a local non-const array (e.g., std::vector<float*> outs; outs[ch]=buffer.getWritePointer(ch);) and pass outs.data().
| path: /opt/JUCE | ||
| key: juce-7.0.12-${{ matrix.arch }} | ||
|
|
||
| - name: Clone and install JUCE | ||
| if: steps.cache-juce.outputs.cache-hit != 'true' | ||
| run: | | ||
| git clone --depth 1 --branch 7.0.12 \ | ||
| https://github.com/juce-framework/JUCE.git /tmp/JUCE | ||
| cmake -B /tmp/JUCE/build -S /tmp/JUCE \ | ||
| -G Ninja \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_INSTALL_PREFIX=/opt/JUCE \ | ||
| -DJUCE_BUILD_EXTRAS=OFF \ | ||
| -DJUCE_BUILD_EXAMPLES=OFF | ||
| cmake --build /tmp/JUCE/build --target install |
There was a problem hiding this comment.
This workflow installs/caches JUCE under /opt/JUCE but the subsequent cmake --build ... --target install is not run with sudo, and /opt is typically not writable on GitHub-hosted runners. This will likely fail at install time (and cache restore/save can also fail due to permissions). Use a user-writable prefix (e.g. $HOME/.local or ${{ github.workspace }}/.deps/JUCE) or run the install and any required chown steps with sudo consistently.
| - name: Locate VST3 binary | ||
| id: locate | ||
| run: | | ||
| SO=$(find build -name "*.so" -path "*/VST3/*" | head -1) |
There was a problem hiding this comment.
If find doesn't locate a VST3 .so, SO will be empty and later steps (ls, stat) will fail with a less clear error (or ls may list the current directory). Add an explicit check after find to fail fast with a clear message when no binary is found.
| SO=$(find build -name "*.so" -path "*/VST3/*" | head -1) | |
| SO=$(find build -name "*.so" -path "*/VST3/*" | head -1) | |
| if [ -z "$SO" ]; then | |
| echo "ERROR: No VST3 .so binary found under build matching */VST3/*" | |
| exit 1 | |
| fi |
fluid_synth_processexpectingfloat**, but JUCE'sAudioBuffer::getArrayOfWritePointers()returnsfloat* const*. Added aconst_castat the call site