Skip to content

Start testing libclang 5 in CI #966

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
fitzgen opened this issue Sep 8, 2017 · 10 comments
Closed

Start testing libclang 5 in CI #966

fitzgen opened this issue Sep 8, 2017 · 10 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Sep 8, 2017

http://lists.llvm.org/pipermail/llvm-announce/2017-September/000075.html

@AndrewGaspar
Copy link
Contributor

Just ran the tests on Windows with LLVM 5.0 and got a single test failure on dump_preprocessed_input.

Backtrace:

---- dump_preprocessed_input stdout ----
        thread 'dump_preprocessed_input' panicked at 'should dump preprocessed input: Error { repr: Custom(Custom { kind: Other, error: StringEr
ror("Cannot find clang executable") }) }', src\libcore\result.rs:860
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys_common::backtrace::_print
             at C:\projects\rust\src\libstd\sys_common\backtrace.rs:71
   1: std::panicking::default_hook::{{closure}}
             at C:\projects\rust\src\libstd\panicking.rs:354
   2: std::panicking::default_hook
             at C:\projects\rust\src\libstd\panicking.rs:365
   3: std::panicking::rust_panic_with_hook
             at C:\projects\rust\src\libstd\panicking.rs:549
   4: std::panicking::begin_panic<collections::string::String>
             at C:\projects\rust\src\libstd\panicking.rs:511
   5: std::panicking::begin_panic_fmt
             at C:\projects\rust\src\libstd\panicking.rs:495
   6: std::panicking::rust_begin_panic
             at C:\projects\rust\src\libstd\panicking.rs:471
   7: core::panicking::panic_fmt
             at C:\projects\rust\src\libcore\panicking.rs:69
   8: core::result::unwrap_failed<std::io::error::Error>
             at C:\projects\rust\src\libcore\macros.rs:29
   9: core::result::Result<(), std::io::error::Error>::expect<(),std::io::error::Error>
             at C:\projects\rust\src\libcore\result.rs:762
  10: tests::dump_preprocessed_input
             at .\tests\tests.rs:392
  11: test::{{impl}}::call_box<(),closure>
             at C:\projects\rust\src\libtest\lib.rs:140
  12: panic_unwind::__rust_maybe_catch_panic
             at C:\projects\rust\src\libpanic_unwind\lib.rs:98

@fitzgen
Copy link
Member Author

fitzgen commented Sep 20, 2017

That looks like clang_sys can't find your clang executable -- is it on your PATH? If not, then can you retest after adding it to your PATH? If it is on your PATH already, then this seems like a clang_sys bug and we should file an issue upstream.

@AndrewGaspar
Copy link
Contributor

I checked and I do have clang in my path.

C:\Users\andre\Projects\rust-bindgen [underscore-identifier +1 ~0 -0 !]> cargo test dump_preprocessed_input
    Finished dev [unoptimized + debuginfo] target(s) in 0.1 secs
     Running target\debug\deps\bindgen-76cfeef6ef14c834.exe

running 0 tests

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

     Running target\debug\deps\bindgen-d558dd1f7775d2f1.exe

running 0 tests

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

     Running target\debug\deps\stylo_sanity-f59ade549a70c518.exe

running 0 tests

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

     Running target\debug\deps\tests-25da81996709f0a8.exe

running 1 test
test dump_preprocessed_input ... FAILED

failures:

---- dump_preprocessed_input stdout ----
        thread 'dump_preprocessed_input' panicked at 'arg_keyword.hpp is in the preprocessed file', tests\tests.rs:409
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    dump_preprocessed_input

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

error: test failed, to rerun pass '--test tests'
C:\Users\andre\Projects\rust-bindgen [underscore-identifier +1 ~0 -0 !]> clang --version
clang version 5.0.0 (tags/RELEASE_500/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin

@fitzgen
Copy link
Member Author

fitzgen commented Sep 21, 2017

What are the contents of __bindgen.ii after running that test? It should contain arg_keyword.h since it is dumping the fully preprocessed source.

@AndrewGaspar
Copy link
Contributor

It seems to repro with LLVM 4.0, too.

__bindgen.ii

# 1 "__bindgen.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 340 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "__bindgen.cpp" 2
# 1 "C:\\Users\\andre\\Projects\\rust-bindgen/tests/headers/arg_keyword.hpp" 1
// This comment exists to ensure that `--dump-preprocessed-input` doesn't strip
// comments.
void foo(const char* type);
# 2 "__bindgen.cpp" 2
# 1 "C:\\Users\\andre\\Projects\\rust-bindgen/tests/headers/cpp-empty-layout.hpp" 1
struct Foo {};
# 3 "__bindgen.cpp" 2

@fitzgen
Copy link
Member Author

fitzgen commented Sep 22, 2017

Huh. It looks like it includes arg_keyword.h right there... Is there a difference in whitespace or something?

@AndrewGaspar
Copy link
Contributor

Ah, that's a good idea. My guess it's a CRLF vs. LF issue. I have git configured to checkout with CRLF line endings, but check in LF endings. So my checkout of arg_keyword.h is CRLF. However, __bindgen.ii seems to have LF line endings. I'll investigate what it takes to resolve this issue.

I'l open a separate issue.

@AndrewGaspar
Copy link
Contributor

Filed #1023

@sanxiyn
Copy link
Member

sanxiyn commented May 27, 2020

I think this should be closed. As I understand, bindgen now requires Clang 6.0 or later.

@emilio
Copy link
Contributor

emilio commented May 28, 2020

We should close it, though I don't think the last bit is true.

@emilio emilio closed this as completed May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants