Skip to content

Commit ef0dcc4

Browse files
committed
fix: disable bindgen layout tests
They are mainly useful to catch unexpected layout discrepancies across platforms, but we were already expecting such discrepancies on Windows, due to the bindings being pregenerated on Linux. It'd be great to still have these tests on Linux, but with current versions of bindgen that's not doable without resorting to increasing tech debt. (See rust-lang/rust-bindgen#2787 (comment))
1 parent 4cb5cf2 commit ef0dcc4

File tree

9 files changed

+15
-978
lines changed

9 files changed

+15
-978
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ jobs:
5757
packages-to-test: -p ogg_next_sys -p aotuv_lancer_vorbis_sys -p vorbis_rs
5858
- target: x86_64-pc-windows-gnu
5959
runner: windows-2022
60-
# Low-level FFI binding crates mostly contain layout tests
61-
# that assume a Unix-like platform, so they won't work
62-
# on Windows
63-
packages-to-test: -p vorbis_rs
6460
- target: x86_64-apple-darwin
6561
runner: macos-13
6662
packages-to-test: -p ogg_next_sys -p aotuv_lancer_vorbis_sys -p vorbis_rs

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ and this project adheres to
1111
### Changed
1212

1313
- Bumped MSRV to 1.82 due to refactors to use methods like `Box::new_uninit`.
14+
- Reduced size of the autogenerated C bindings code by dropping layout tests,
15+
which were expected to fail on non-Linux platforms anyway due to
16+
platform-specific code generation differences.
1417

1518
### Fixed
1619

packages/aotuv_lancer_vorbis_sys/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ cc.workspace = true
2626
bindgen = { workspace = true, optional = true }
2727

2828
[features]
29-
# Requires Clang and slows down the build, but guarantees that the bindings are up to date.
30-
# It usually is better to run the generate-bindings.sh script instead
29+
# Requires Clang and slows down the build, but guarantees that the bindings are tailored for the platform and up to date.
30+
# It is usually better to run the generate-bindings.sh script instead
3131
build-time-bindgen = ["bindgen"]

packages/aotuv_lancer_vorbis_sys/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ fn main() {
6464
.blocklist_item("FILE")
6565
.blocklist_item("ogg_.*")
6666
.blocklist_item("__.*")
67-
.rust_target(RustTarget::Stable_1_73)
67+
.rust_target(RustTarget::Stable_1_77)
68+
.layout_tests(false) // Type layout is platform-specific
6869
.generate()
6970
.expect("Unable to generate bindings")
7071
.write_to_file("src/bindings.rs")

0 commit comments

Comments
 (0)