From 3b62bff7ffdef955f31e9aaaf3db3825fb21730c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Fri, 10 Jul 2026 15:16:37 +0200 Subject: [PATCH 1/2] emscripten: pass notify arg to observer update() in devices_poll observer_emscripten::update() gained a 'bool notify' parameter, but the devices_poll() call site still passed 2 args, breaking the wasm build (the emscripten backend is only compiled for wasm, so other CI never caught it). Poll detects hotplugged devices -> notify=true. --- include/libremidi/backends/emscripten/midi_access.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libremidi/backends/emscripten/midi_access.hpp b/include/libremidi/backends/emscripten/midi_access.hpp index 0956181b..02708a7b 100644 --- a/include/libremidi/backends/emscripten/midi_access.hpp +++ b/include/libremidi/backends/emscripten/midi_access.hpp @@ -175,7 +175,7 @@ class midi_access_emscripten for (auto& obs : m_observers) { - obs->update(m_current_inputs, m_current_outputs); + obs->update(m_current_inputs, m_current_outputs, true); } } From f6be81d2ac51758259bdb26c81fc30223bbeabdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Fri, 10 Jul 2026 15:21:16 +0200 Subject: [PATCH 2/2] ci: add Emscripten (WASM) build Builds libremidi + the emscripten example with emsdk so the WebMIDI backend (backends/emscripten/*) is compiled on every PR. That backend is wasm-only, so no other CI job exercised it -- which is how the observer update() arg-count regression fixed in this PR slipped through. --- .github/workflows/wasm.yml | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/wasm.yml diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml new file mode 100644 index 00000000..4cdf642c --- /dev/null +++ b/.github/workflows/wasm.yml @@ -0,0 +1,47 @@ +name: Emscripten + +on: + push: + branches: + - master + tags: + - v* + paths-ignore: + - 'docs/**' + - '**.md' + pull_request: + paths-ignore: + - '**.md' + - 'docs/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + wasm: + name: WebAssembly + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7 + + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y ninja-build + + - uses: mymindstorm/setup-emsdk@v14 + + # Build the library and the emscripten example so the WebMIDI backend + # (backends/emscripten/*) is actually compiled -- it is only ever built for + # wasm, so the native/mingw/android/etc. jobs never exercise it. + - name: Configure + run: | + emcmake cmake -S . -B build -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DLIBREMIDI_LIBRARY_MODE=LIBRARY \ + -DLIBREMIDI_EXAMPLES=1 + + - name: Build + run: cmake --build build