Skip to content

Failing test on macOS #1619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lopopolo opened this issue Sep 16, 2019 · 5 comments
Closed

Failing test on macOS #1619

lopopolo opened this issue Sep 16, 2019 · 5 comments

Comments

@lopopolo
Copy link
Contributor

macOS 10.14.6

failures:

---- header_objc_template_h stdout ----



diff expected generated
--- expected: "/Users/lopopolo/dev/repos/rust-bindgen/tests/expectations/tests/libclang-5/objc_template.rs"
+++ generated from: "/Users/lopopolo/dev/repos/rust-bindgen/tests/headers/objc_template.h"
 /* automatically generated by rust-bindgen */

 #![allow(
     dead_code,
     non_snake_case,
     non_camel_case_types,
     non_upper_case_globals
 )]
 #![cfg(target_os = "macos")]

 #[macro_use]
 extern crate objc;
 #[allow(non_camel_case_types)]
 pub type id = *mut objc::runtime::Object;
 pub trait Foo {
-    unsafe fn get(self) -> *mut ObjectType;
+    unsafe fn get(self) -> u64;
 }
 impl Foo for id {
-    unsafe fn get(self) -> *mut ObjectType {
+    unsafe fn get(self) -> u64 {
         msg_send!(self, get)
     }
 }

thread 'header_objc_template_h' panicked at 'Header and binding differ! Run with BINDGEN_OVERWRITE_EXPECTED=1 in the environment to automatically overwrite the expectation.', /Users/lopopolo/dev/repos/rust-bindgen/target/debug/build/bindgen-543c1c6b7046c1ec/out/tests.rs:204:1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.


failures:
    header_objc_template_h

test result: FAILED. 467 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--test tests'
@emilio
Copy link
Contributor

emilio commented Sep 16, 2019

This is because you're using a newer libclang than 5.0, which is the last one we test. We should update the matrix to test newer libclangs and make that test libclang-version-specific, I'd think.

@ctaggart
Copy link

Looks like libclang 9 support was added in #1646. Is this resolved now? I'm on a Mac, what should I run to verify?

@emilio
Copy link
Contributor

emilio commented Oct 24, 2019

If you use clang 9, then just cargo test should work.

@ctaggart
Copy link

Yes, I installed it with brew install llvm.

Camerons-MacBook-Pro:rust-bindgen cameron$ export PATH=/usr/local/opt/llvm/bin:$PATH
Camerons-MacBook-Pro:rust-bindgen cameron$ clang --version
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

All tests pass:

test result: ok. 471 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Several show non-fatal errors while running, such as:

test header_anonymous_template_types_hpp ... ok
[2019-10-24T17:27:25Z ERROR bindgen::ir::item] Unhandled cursor kind 9: Cursor(kBar kind: VarDecl, loc: /Users/cameron/github/rust-bindgen/tests/headers/auto.hpp:10:31, usr: Some("c:@ST>1#T@Bar@kBar"))
test header_attribute_warn_unused_result_no_attribute_detection_hpp ... ok

@emilio
Copy link
Contributor

emilio commented Oct 26, 2019

Yup, that's expected. Alright then, let's call this fixed by #1646, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants