Skip to content
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

Make cargo test work #95

Merged
merged 4 commits into from Oct 18, 2016
Merged

Make cargo test work #95

merged 4 commits into from Oct 18, 2016

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Oct 17, 2016

Fixes #51.

r? @emilio

@fitzgen
Copy link
Member Author

fitzgen commented Oct 17, 2016

Will rebase once #82 and #85 land.

@fitzgen
Copy link
Member Author

fitzgen commented Oct 17, 2016

Hm this is usually what I see when I link to the wrong clang, not sure why that would be happening on travis...

/home/travis/build/servo/rust-bindgen/src/clang.rs:229: undefined reference to `clang_Cursor_isFunctionInlined'
/home/travis/build/servo/rust-bindgen/target/debug/deps/libbindgen.rlib(bindgen.0.o): In function `bindgen::clang::Type::named::h1dc6428e959df288':
/home/travis/build/servo/rust-bindgen/src/clang.rs:592: undefined reference to `clang_Type_getNamedType'
collect2: ld returned 1 exit status

Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. The error you're getting is because travis still doesn't have llvm 3.9, so we're stuck with 3.8 until they whitelist it :/

@@ -87,7 +87,7 @@ impl Annotations {
///
/// the generated code would look something like:
///
/// ```rust
/// ```rust,ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be ```c++`.

- git add -A
- git diff @
- git diff-index --quiet HEAD
- cargo test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll need to run cargo test --features llvm_stable, otherwise you're compiling with llvm 3.9 support, which can't be done for now (see #70).

test: regen-tests
@echo > /dev/null
test:
cargo test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, I think we want to stick with llvm_stable for now.

@@ -40,10 +40,7 @@ before_script:

script:
- cargo build --verbose --features llvm_stable
- make test
- git add -A
- git diff @
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also keep the diff and diff-index checks, since they're harmless, but avoid potential errors.

@fitzgen
Copy link
Member Author

fitzgen commented Oct 18, 2016

After rebasing on master, I get this failure when running the tests:

FAIL: /home/fitzgen/src/rust-bindgen/tests/headers/typeref.hpp
child stderr> ERROR:bindgen::ir::ty: unsupported type Type(mozilla::StyleShapeSource<int>, kind: ?, decl: Cursor(StyleShapeSource kind: StructDecl, loc: /home/fitzgen/src/rust-bindgen/tests/headers/typeref.hpp:17:8, usr: Some("c:@N@mozilla@S@StyleShapeSource>#I")), canon: Cursor(StyleShapeSource kind: StructDecl, loc: /home/fitzgen/src/rust-bindgen/tests/headers/typeref.hpp:17:8, usr: Some("c:@N@mozilla@S@StyleShapeSource>#I"))) at Some(Cursor(mBar kind: FieldDecl, loc: /home/fitzgen/src/rust-bindgen/tests/headers/typeref.hpp:27:34, usr: Some("c:@S@nsFoo@FI@mBar")))
child stderr> thread 'main' panicked at 'What happened?: Continue', ../src/libcore/result.rs:799
child stderr> stack backtrace:
child stderr>    1:     0x55b72ce343bf - std::sys::backtrace::tracing::imp::write::h22f199c1dbb72ba2
child stderr>    2:     0x55b72ce3963d - std::panicking::default_hook::{{closure}}::h9a389c462b6a22dd
child stderr>    3:     0x55b72ce38562 - std::panicking::default_hook::h852b4223c1c00c59
child stderr>    4:     0x55b72ce38af8 - std::panicking::rust_panic_with_hook::hcd9d05f53fa0dafc
child stderr>    5:     0x55b72ce38992 - std::panicking::begin_panic::hf6c488cee66e7f17
child stderr>    6:     0x55b72ce388d0 - std::panicking::begin_panic_fmt::hb0a7126ee57cdd27
child stderr>    7:     0x55b72ce38851 - rust_begin_unwind
child stderr>    8:     0x55b72ce701bf - core::panicking::panic_fmt::h9af671b78898cdba
child stderr>    9:     0x55b72c774640 - core::result::unwrap_failed::h97cb1800d3fcc74f
child stderr>                         at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/macros.rs:29
child stderr>   10:     0x55b72c755096 - <core::result::Result<T, E>>::expect::h542024ecac47c473
child stderr>                         at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/result.rs:761
child stderr>   11:     0x55b72c7ed4f5 - bindgen::ir::context::BindgenContext::resolve_typerefs::he4b5e02346ecf95a
child stderr>                         at /home/fitzgen/src/rust-bindgen/src/ir/context.rs:262
child stderr>   12:     0x55b72c7ee016 - bindgen::ir::context::BindgenContext::gen::h3ade8f711bd1c0c2
child stderr>                         at /home/fitzgen/src/rust-bindgen/src/ir/context.rs:354
child stderr>   13:     0x55b72c82ab3b - bindgen::codegen::codegen::h44cca026fd2da5bb
child stderr>                         at /home/fitzgen/src/rust-bindgen/src/lib.rs:26
child stderr>   14:     0x55b72c803335 - bindgen::Bindings::generate::he4a13e0c40b5be41
child stderr>                         at /home/fitzgen/src/rust-bindgen/src/lib.rs:249
child stderr>   15:     0x55b72c6e1f05 - bindgen::main::h35ee5f44d54e0e8d
child stderr>                         at /home/fitzgen/src/rust-bindgen/src/bin/bindgen.rs:242
child stderr>   16:     0x55b72ce41106 - __rust_maybe_catch_panic
child stderr>   17:     0x55b72ce37de1 - std::rt::lang_start::h14cbded5fe3cd915
child stderr>   18:     0x55b72c6e2843 - main
child stderr>   19:     0x7f80df39d730 - __libc_start_main
child stderr>   20:     0x55b72c6b6468 - _start
child stderr>   21:                0x0 - <unknown>

@fitzgen
Copy link
Member Author

fitzgen commented Oct 18, 2016

After rebasing on master, I get this failure when running the tests:

This was due to mixing up --features llvm_stable and LLVM versions. When I use LLVM 3.9 without --features llvm_stable then all is well.

I've addressed review comments, rebased on master, and force pushed. Hopefully the travis ci will come back green and we can merge this.

@fitzgen
Copy link
Member Author

fitzgen commented Oct 18, 2016

CI failed again because of different test expectations for --features llvm_stable vs not. I've removed the commit that updated the test expectation to what was expected if we don't have that feature (which is what I'm doing locally, but isn't what we do on CI).

@emilio
Copy link
Contributor

emilio commented Oct 18, 2016

Green, yay!

@bors-servo: r+

@bors-servo
Copy link

📌 Commit 7cadabb has been approved by emilio

@bors-servo
Copy link

⚡ Test exempted - status

@bors-servo bors-servo merged commit 7cadabb into rust-lang:master Oct 18, 2016
bors-servo pushed a commit that referenced this pull request Oct 18, 2016
Make `cargo test` work

Fixes #51.

r? @emilio
@fitzgen fitzgen deleted the cargo-test branch October 18, 2016 20:36
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

Successfully merging this pull request may close these issues.

None yet

4 participants