From 4538559c9a2834f86cae87c1ef57bf14acfa5769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goran=20Meki=C4=87?= Date: Wed, 4 Nov 2026 20:47:00 +0100 Subject: [PATCH] Bump version --- .github/workflows/rust.yml | 28 ++++++++++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 8 ++++---- src/au/mod.rs | 12 ++++++++---- src/au/v2.rs | 4 ++-- src/gui_x11.rs | 2 +- src/main.rs | 5 +++++ src/vst3/interfaces.rs | 12 ++++++++---- src/vst3_lv2_host.rs | 2 +- tests/au_gui_smoke.rs | 2 +- tests/au_host_smoke.rs | 2 +- tests/au_v3_smoke.rs | 2 +- 13 files changed, 62 insertions(+), 21 deletions(-) create mode 100644 src/main.rs diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e00809a..15f8546 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -32,6 +32,34 @@ jobs: - name: Install cargo-audit run: cargo install cargo-audit + - name: Cache apt packages + if: contains(matrix.os, 'ubuntu') + uses: actions/cache@v4 + with: + path: ~/apt-cache + key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/rust.yml') }} + restore-keys: | + ${{ runner.os }}-apt- + + - name: Restore apt cache + if: contains(matrix.os, 'ubuntu') + run: | + sudo mkdir -p /var/cache/apt/archives + sudo cp -r ~/apt-cache/. /var/cache/apt/archives/ 2>/dev/null || true + + - name: Install system packages + if: contains(matrix.os, 'ubuntu') + run: | + sudo apt-get update + sudo apt-get update + sudo apt-get install -y libx11-dev + + - name: Save apt cache + if: contains(matrix.os, 'ubuntu') + run: | + mkdir -p ~/apt-cache + cp /var/cache/apt/archives/*.deb ~/apt-cache/ 2>/dev/null || true + - name: Check formatting run: cargo fmt --check diff --git a/Cargo.lock b/Cargo.lock index c8e01cc..92d0898 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,7 +128,7 @@ dependencies = [ [[package]] name = "maolan-plugin-host" -version = "0.1.2" +version = "0.1.3" dependencies = [ "arc-swap", "crossbeam-channel", diff --git a/Cargo.toml b/Cargo.toml index fdd8366..ef04b83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "maolan-plugin-host" -version = "0.1.2" +version = "0.1.3" edition = "2024" description = "Out-of-process audio plugin hosting library" authors = ["Maolan Team"] diff --git a/README.md b/README.md index 448f4c1..87a9219 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ Out-of-process plugin host for the [Maolan DAW](https://maolan.github.io). -This crate provides the reusable plugin-host library. Applications can build -their own host process around it and communicate with the audio engine over -shared memory and lightweight event channels. The Maolan DAW's host executable -is built from `maolan/src/bin/maolan-plugin-host.rs`. +This crate provides the reusable plugin-host library and a thin +`maolan-plugin-host` executable around it. Applications can also build their +own host process and communicate with the audio engine over shared memory and +lightweight event channels. ## Supported formats diff --git a/src/au/mod.rs b/src/au/mod.rs index 665c0d0..e543d3b 100644 --- a/src/au/mod.rs +++ b/src/au/mod.rs @@ -767,8 +767,10 @@ mod tests { #[test] fn au_params_scratch_roundtrip() { let params = sample_params(); - let mut shm = vec![0u8; LAYOUT_SIZE]; - let ptr = shm.as_mut_ptr(); + let mut shm = std::iter::repeat_with(ShmHeader::default) + .take(LAYOUT_SIZE.div_ceil(std::mem::size_of::())) + .collect::>(); + let ptr = shm.as_mut_ptr().cast::(); unsafe { init_shm_layout(ptr, LAYOUT_SIZE); write_au_params_to_scratch(ptr, ¶ms).expect("write"); @@ -780,8 +782,10 @@ mod tests { #[test] fn au_state_roundtrip() { let state = vec![0xAA; 1000]; - let mut shm = vec![0u8; LAYOUT_SIZE]; - let ptr = shm.as_mut_ptr(); + let mut shm = std::iter::repeat_with(ShmHeader::default) + .take(LAYOUT_SIZE.div_ceil(std::mem::size_of::())) + .collect::>(); + let ptr = shm.as_mut_ptr().cast::(); unsafe { init_shm_layout(ptr, LAYOUT_SIZE); let scratch = scratch_ptr(ptr); diff --git a/src/au/v2.rs b/src/au/v2.rs index 6ef86fe..5f690ba 100644 --- a/src/au/v2.rs +++ b/src/au/v2.rs @@ -344,9 +344,9 @@ extern "C" fn input_render_callback( // descriptors contiguously after the count, so index past the // declared `[AudioBuffer; 1]` via raw pointer arithmetic. let buffers = list.buffers.as_mut_ptr(); - for i in 0..n { + for (i, input) in input_ref.ptrs.iter().copied().enumerate().take(n) { let buf = &mut *buffers.add(i); - buf.data = input_ref.ptrs[i].cast(); + buf.data = input.cast(); buf.number_channels = 1; buf.data_byte_size = frames * 4; } diff --git a/src/gui_x11.rs b/src/gui_x11.rs index b510394..ab0e366 100644 --- a/src/gui_x11.rs +++ b/src/gui_x11.rs @@ -105,7 +105,7 @@ pub mod x11 { } /// # Safety /// No-op stub; all arguments are ignored. - pub unsafe fn create_simple_window( + pub unsafe extern "C" fn create_simple_window( _display: *mut Display, _parent: Window, _x: c_int, diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..218a9dc --- /dev/null +++ b/src/main.rs @@ -0,0 +1,5 @@ +use maolan_plugin_host::cli::run; + +fn main() { + run(); +} diff --git a/src/vst3/interfaces.rs b/src/vst3/interfaces.rs index 5212d0e..864e0a0 100644 --- a/src/vst3/interfaces.rs +++ b/src/vst3/interfaces.rs @@ -1575,10 +1575,14 @@ fn extract_string128(s: &String128) -> String { #[cfg(test)] mod tests { use super::*; + #[cfg(not(miri))] use std::fs::{self, File}; + #[cfg(not(miri))] use std::path::PathBuf; + #[cfg(not(miri))] use std::time::{SystemTime, UNIX_EPOCH}; + #[cfg(not(miri))] fn unique_temp_dir(name: &str) -> PathBuf { let nanos = SystemTime::now() .duration_since(UNIX_EPOCH) @@ -1615,7 +1619,7 @@ mod tests { assert_eq!(extract_cstring(&bytes), "XYZ"); } - #[cfg(unix)] + #[cfg(all(unix, not(miri)))] #[test] fn get_module_path_returns_unix_shared_object_path() { let bundle_path = unique_temp_dir("vst3-module").join("Example.vst3"); @@ -1634,7 +1638,7 @@ mod tests { let _ = fs::remove_dir_all(bundle_path.parent().expect("bundle parent")); } - #[cfg(unix)] + #[cfg(all(unix, not(miri)))] #[test] fn get_module_path_errors_when_unix_module_is_missing() { let bundle_path = unique_temp_dir("missing-vst3").join("Missing.vst3"); @@ -1647,7 +1651,7 @@ mod tests { let _ = fs::remove_dir_all(bundle_path.parent().expect("bundle parent")); } - #[cfg(target_os = "windows")] + #[cfg(all(target_os = "windows", not(miri)))] #[test] fn get_module_path_returns_windows_vst3_binary_path() { let bundle_path = unique_temp_dir("vst3-module").join("Example.vst3"); @@ -1666,7 +1670,7 @@ mod tests { let _ = fs::remove_dir_all(bundle_path.parent().expect("bundle parent")); } - #[cfg(target_os = "windows")] + #[cfg(all(target_os = "windows", not(miri)))] #[test] fn get_module_path_errors_when_windows_module_is_missing() { let bundle_path = unique_temp_dir("missing-vst3").join("Missing.vst3"); diff --git a/src/vst3_lv2_host.rs b/src/vst3_lv2_host.rs index 041fdd8..ef6fd5f 100644 --- a/src/vst3_lv2_host.rs +++ b/src/vst3_lv2_host.rs @@ -211,7 +211,7 @@ mod x11_ffi { } /// # Safety /// No-op stub; all arguments are ignored. - pub unsafe fn create_simple_window( + pub unsafe extern "C" fn create_simple_window( _display: *mut Display, _parent: Window, _x: c_int, diff --git a/tests/au_gui_smoke.rs b/tests/au_gui_smoke.rs index 991091c..3e4f53d 100644 --- a/tests/au_gui_smoke.rs +++ b/tests/au_gui_smoke.rs @@ -1,4 +1,4 @@ -#![cfg(target_os = "macos")] +#![cfg(all(target_os = "macos", not(miri)))] use maolan_plugin_protocol::protocol::*; use maolan_plugin_protocol::shm::ShmMapping; use std::sync::atomic::Ordering; diff --git a/tests/au_host_smoke.rs b/tests/au_host_smoke.rs index d4f1f4c..9b830b9 100644 --- a/tests/au_host_smoke.rs +++ b/tests/au_host_smoke.rs @@ -3,7 +3,7 @@ //! audio blocks, a DAW-side parameter set, and a state save/restore //! roundtrip over the real shared-memory protocol. -#![cfg(target_os = "macos")] +#![cfg(all(target_os = "macos", not(miri)))] use maolan_plugin_protocol::protocol::*; use maolan_plugin_protocol::ringbuf::RingBuffer; diff --git a/tests/au_v3_smoke.rs b/tests/au_v3_smoke.rs index 4076eed..ea2ae06 100644 --- a/tests/au_v3_smoke.rs +++ b/tests/au_v3_smoke.rs @@ -11,7 +11,7 @@ //! against one and pumps an audio block over SHM. This machine may have no //! AUv3 extensions installed; the test skips with a message in that case. -#![cfg(target_os = "macos")] +#![cfg(all(target_os = "macos", not(miri)))] use maolan_plugin_host::au::v3::V3Unit; use maolan_plugin_host::au::{AuComponentDesc, AuInitConfig, AuTransport, AuUnit};