From 06343fef4200c4e32d18f08df5a6a8bd84dcc710 Mon Sep 17 00:00:00 2001 From: can1357 Date: Sun, 2 Aug 2026 00:39:53 +0200 Subject: [PATCH] fix(bazel): anchored maudio-sys patch hunks with context lines Bazel's patch parser applies pure-insertion -U0 hunks one line early, which dropped the lib.rs layout asserts inside 'mod ffi' on linux builds (E0433). Regenerated the text hunks with -U1 context and moved the C probe block after the miniaudio include so no hunk touches the crate's newline-less final line, which the parser also rejects. Verified the patched lib.rs type-checks for all four linux binding sets and the darwin natives + maudio_layout_test pass under bazel. --- bazel/patches/maudio-sys-target-bindings.patch | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bazel/patches/maudio-sys-target-bindings.patch b/bazel/patches/maudio-sys-target-bindings.patch index e2775bbde..6b2b76325 100644 --- a/bazel/patches/maudio-sys-target-bindings.patch +++ b/bazel/patches/maudio-sys-target-bindings.patch @@ -1,8 +1,9 @@ diff --git a/native/miniaudio_version_check.c b/native/miniaudio_version_check.c -index 58b5fee..4df5150 100644 +index 58b5fee..23662b4 100644 --- a/native/miniaudio_version_check.c +++ b/native/miniaudio_version_check.c -@@ -6,0 +7,27 @@ +@@ -2,2 +2,29 @@ + +/* Cross-build baseline: validate the C target without executing its binary. */ +#if defined(__linux__) +#if defined(__aarch64__) && defined(__GLIBC__) @@ -30,11 +31,13 @@ index 58b5fee..4df5150 100644 +size_t omp_maudio_sizeof_device(void) { return sizeof(ma_device); } +size_t omp_maudio_alignof_device(void) { return _Alignof(ma_device); } + + #if MA_VERSION_MAJOR != 0 || MA_VERSION_MINOR != 11 || MA_VERSION_REVISION != 23 diff --git a/src/lib.rs b/src/lib.rs index 479fc91..04c3b65 100644 --- a/src/lib.rs +++ b/src/lib.rs -@@ -10,0 +11,29 @@ pub mod ffi { +@@ -10 +10,30 @@ pub mod ffi { + } + +// These target-gated checks pair with the C static assertions in +// miniaudio_version_check.c, so cross-builds validate both sides without