Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/build-vst3-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build VST3 Linux

on:
push:
branches: ["**"]
pull_request:
workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-24.04
- arch: aarch64
runner: ubuntu-24.04-arm

runs-on: ${{ matrix.runner }}
name: VST3 Linux ${{ matrix.arch }}

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y \
cmake ninja-build build-essential pkg-config git \
libfluidsynth-dev \
libasound2-dev \
libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev \
libgl-dev libfreetype-dev libfontconfig1-dev \
libharfbuzz-dev

- name: Cache JUCE
id: cache-juce
uses: actions/cache@v4
with:
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
Comment on lines +41 to +55

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

- name: Configure CMake
run: |
cmake -B build -S . \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/opt/JUCE \
-DBUILD_SHARED_LIBS=ON \
-DJUCE_COPY_PLUGIN_AFTER_BUILD=FALSE

- name: Build VST3
run: cmake --build build --target JuicySFPlugin_VST3 --parallel

- name: Locate VST3 binary
id: locate
run: |
SO=$(find build -name "*.so" -path "*/VST3/*" | head -1)

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
echo "so=$SO" >> "$GITHUB_OUTPUT"
ls -lh "$SO"

- name: Verify artifact size ≥ 1 MB
run: |
SO="${{ steps.locate.outputs.so }}"
SIZE=$(stat -c%s "$SO")
echo "Size: $SIZE bytes"
if [ "$SIZE" -lt 1048576 ]; then
echo "ERROR: artifact is smaller than 1 MB ($SIZE bytes)"
exit 1
fi

- name: Upload VST3 artifact
uses: actions/upload-artifact@v4
with:
name: juicysfplugin-vst3-linux-${{ matrix.arch }}
path: build/**/*.vst3
if-no-files-found: error
2 changes: 1 addition & 1 deletion Source/FluidSynthModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void FluidSynthModel::processBlock(AudioBuffer<float>& buffer, MidiBuffer& midiM
0,
nullptr,
buffer.getNumChannels(),
buffer.getArrayOfWritePointers());
const_cast<float**>(buffer.getArrayOfWritePointers()));

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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().

Copilot uses AI. Check for mistakes.
}

int FluidSynthModel::getNumPrograms()
Expand Down
Loading