cbindgen
cbindgen copied to clipboard
Tests do not pass with Rust 1.32
I'm not sure, but I think cbindgen needs Rust nightly now, even though the README says 1.32+.
cargo test produces:
---- test_expand_no_default_features stdout ----
Running: "/home/ethan/tmp/software/cbindgen/target/debug/cbindgen" "--lang" "c" "--style" "type" "-o" "/home/ethan/tmp/software/cbindgen/tests/expectations/expand_no_default_features.c" "/home/ethan/tmp/software/cbindgen/tests/rust/expand_no_default_features"
thread 'test_expand_no_default_features' panicked at 'cbindgen failed: "/home/ethan/tmp/software/cbindgen/tests/expectations/expand_no_default_features.c"', tests/tests.rs:54:5
---- test_expand_features stdout ----
Running: "/home/ethan/tmp/software/cbindgen/target/debug/cbindgen" "--lang" "c" "--style" "type" "-o" "/home/ethan/tmp/software/cbindgen/tests/expectations/expand_features.c" "/home/ethan/tmp/software/cbindgen/tests/rust/expand_features"
thread 'test_expand_features' panicked at 'cbindgen failed: "/home/ethan/tmp/software/cbindgen/tests/expectations/expand_features.c"', tests/tests.rs:54:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
---- test_expand_default_features stdout ----
Running: "/home/ethan/tmp/software/cbindgen/target/debug/cbindgen" "--lang" "c" "--style" "type" "-o" "/home/ethan/tmp/software/cbindgen/tests/expectations/expand_default_features.c" "/home/ethan/tmp/software/cbindgen/tests/rust/expand_default_features"
thread 'test_expand_default_features' panicked at 'cbindgen failed: "/home/ethan/tmp/software/cbindgen/tests/expectations/expand_default_features.c"', tests/tests.rs:54:5
---- test_expand stdout ----
Running: "/home/ethan/tmp/software/cbindgen/target/debug/cbindgen" "--lang" "c" "--style" "type" "-o" "/home/ethan/tmp/software/cbindgen/tests/expectations/expand.c" "/home/ethan/tmp/software/cbindgen/tests/rust/expand"
thread 'test_expand' panicked at 'cbindgen failed: "/home/ethan/tmp/software/cbindgen/tests/expectations/expand.c"', tests/tests.rs:54:5
failures:
test_expand
test_expand_default_features
test_expand_features
test_expand_no_default_features
test result: FAILED. 66 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--test tests'
I tried this to rerun a failing test:
> cargo run tests/rust/expand
Finished dev [unoptimized + debuginfo] target(s) in 0.05s
Running `target/debug/cbindgen tests/rust/expand`
ERROR: Parsing crate `expand`: couldn't run `cargo rustc --pretty=expanded`: Compile(" Compiling expand v0.1.0 (/home/ethan/tmp/software/cbindgen/tests/rust/expand)\nerror: the option `Z` is only accepted on the nightly compiler\n\nerror: Could not compile `expand`.\n\nTo learn more, run the command again with --verbose.\n")
ERROR: Couldn't generate bindings for tests/rust/expand.
Seeing this as well. Interestingly, the CI log doesn't even run anything:
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
This is only for the cargo expand tests, right?
Correct, the failures are only about expand.
Also seeing the same failure while trying to bump the package for NixOS.
test bindgen::mangle::generics ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/tests-d4f737317c9e9611
running 70 tests
test test_assoc_const_conflict ... ok
test test_alias ... ok
test test_assoc_constant ... ok
test test_array ... ok
test test_bitflags ... ok
test test_asserted_cast ... ok
test test_annotation ... ok
test test_associated_in_body ... ok
test test_body ... ok
test test_cfg_field ... ok
test test_cfg_2 ... ok
test test_const_conflict ... ok
test test_cfg ... ok
test test_cdecl ... ok
test test_const_transparent ... ok
test test_constant ... ok
test test_docstyle_doxy ... ok
test test_docstyle_auto ... ok
test test_docstyle_c99 ... ok
test test_display_list ... ok
test test_destructor_and_copy_ctor ... ok
test test_derive_eq ... ok
test test_enum ... ok
test test_euclid ... ok
test test_extern ... ok
test test_extern_2 ... ok
test test_expand_default_features ... FAILED
test test_expand_features ... FAILED
test test_expand ... FAILED
test test_expand_no_default_features ... FAILED
test test_fns ... ok
test test_external_workspace_child ... ok
test test_global_attr ... ok
test test_inner_mod ... ok
test test_include_item ... ok
test test_include_specific ... ok
test test_item_types ... ok
test test_include ... ok
test test_item_types_renamed ... ok
test test_lifetime_arg ... ok
test test_monomorph_2 ... ok
test test_monomorph_1 ... ok
test test_monomorph_3 ... ok
test test_must_use ... ok
test test_mod_attr ... ok
test test_namespace_constant ... ok
test test_namespaces_constant ... ok
test test_mod_path ... ok
test test_no_includes ... ok
test test_nested_import ... ok
test test_nonnull ... ok
test test_prefix ... ok
test test_prefixed_struct_literal_deep ... ok
test test_prefixed_struct_literal ... ok
test test_rename ... ok
test test_renaming_overrides_prefixing ... ok
test test_rename_crate ... ok
test test_reserved ... ok
test test_static ... ok
test test_simplify_option_ptr ... ok
test test_std_lib ... ok
test test_struct ... ok
test test_struct_literal ... ok
test test_style_crash ... ok
test test_transform_op ... ok
test test_typedef ... ok
test test_union ... ok
test test_va_list ... ok
test test_transparent ... ok
test test_workspace ... ok
failures:
---- test_expand_default_features stdout ----
Running: "/build/source/target/debug/cbindgen" "--lang" "c" "--style" "type" "-o" "/build/source/tests/expectations/expand_default_features.c" "/build/source/tests/rust/expand_default_features"
thread 'test_expand_default_features' panicked at 'cbindgen failed: "/build/source/tests/expectations/expand_default_features.c"', tests/tests.rs:54:5
---- test_expand_features stdout ----
Running: "/build/source/target/debug/cbindgen" "--lang" "c" "--style" "type" "-o" "/build/source/tests/expectations/expand_features.c" "/build/source/tests/rust/expand_features"
thread 'test_expand_features' panicked at 'cbindgen failed: "/build/source/tests/expectations/expand_features.c"', tests/tests.rs:54:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
---- test_expand stdout ----
Running: "/build/source/target/debug/cbindgen" "--lang" "c" "--style" "type" "-o" "/build/source/tests/expectations/expand.c" "/build/source/tests/rust/expand"
thread 'test_expand' panicked at 'cbindgen failed: "/build/source/tests/expectations/expand.c"', tests/tests.rs:54:5
---- test_expand_no_default_features stdout ----
Running: "/build/source/target/debug/cbindgen" "--lang" "c" "--style" "type" "-o" "/build/source/tests/expectations/expand_no_default_features.c" "/build/source/tests/rust/expand_no_default_features"
thread 'test_expand_no_default_features' panicked at 'cbindgen failed: "/build/source/tests/expectations/expand_no_default_features.c"', tests/tests.rs:54:5
failures:
test_expand
test_expand_default_features
test_expand_features
test_expand_no_default_features
test result: FAILED. 66 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--test tests'
Rust 1.32 is ancient by now, this issue can probably be closed.