autocxx icon indicating copy to clipboard operation
autocxx copied to clipboard

`test_issue_1089` fails locally for me

Open bsilver8192 opened this issue 2 years ago • 1 comments

Tests fail for me like this on current main (cdebaee6434b90d9711278ca1493519274f232be), despite passing in CI:

thread 'integration_test::test_issue_1089' panicked at '"a__(anonymous_namespace)__ac__bj" is not a valid Ident', /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.37/src/fallback.rs:701:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
   2: proc_macro2::fallback::validate_ident
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.37/src/fallback.rs:701:9
   3: proc_macro2::fallback::Ident::_new
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.37/src/fallback.rs:642:9
   4: proc_macro2::fallback::Ident::new
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.37/src/fallback.rs:652:9
   5: proc_macro2::imp::Ident::new
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.37/src/wrapper.rs:691:50
   6: proc_macro2::Ident::new
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.37/src/lib.rs:952:21
   7: autocxx_bindgen::ir::context::BindgenContext::rust_ident_raw
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/ir/context.rs:867:9
   8: autocxx_bindgen::ir::context::BindgenContext::rust_ident
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/ir/context.rs:859:9
   9: <autocxx_bindgen::ir::ty::Type as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:886:33
  10: <autocxx_bindgen::ir::item::Item as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:494:17
  11: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen::{{closure}}
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:517:21
  12: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen::{{closure}}
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:565:13
  13: autocxx_bindgen::codegen::CodegenResult::inner
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:318:9
  14: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:552:27
  15: <autocxx_bindgen::ir::item::Item as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:485:17
  16: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen::{{closure}}
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:517:21
  17: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:547:13
  18: <autocxx_bindgen::ir::item::Item as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:485:17
  19: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen::{{closure}}
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:517:21
  20: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen::{{closure}}
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:565:13
  21: autocxx_bindgen::codegen::CodegenResult::inner
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:318:9
  22: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:552:27
  23: <autocxx_bindgen::ir::item::Item as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:485:17
  24: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen::{{closure}}
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:517:21
  25: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen::{{closure}}
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:565:13
  26: autocxx_bindgen::codegen::CodegenResult::inner
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:318:9
  27: <autocxx_bindgen::ir::module::Module as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:552:27
  28: <autocxx_bindgen::ir::item::Item as autocxx_bindgen::codegen::CodeGenerator>::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:485:17
  29: autocxx_bindgen::codegen::codegen::{{closure}}
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:4531:9
  30: autocxx_bindgen::ir::context::BindgenContext::gen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/ir/context.rs:1179:19
  31: autocxx_bindgen::codegen::codegen
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/codegen/mod.rs:4495:5
  32: autocxx_bindgen::Bindings::generate
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/lib.rs:2449:32
  33: autocxx_bindgen::Builder::generate
             at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-bindgen-0.59.17/src/lib.rs:1536:9
  34: autocxx_engine::IncludeCppEngine::generate
             at /home/brian/Desktop/autocxx/engine/src/lib.rs:411:24
<snip>

I don't see anything else helpful in the RUST_LOG=autocxx_engine=info logs, it's failing pretty early on in the process.

I suspect this is due to a different libclang version. I'm using libclang-11-dev 1:11.0.1-2 from the Debian Bullseye repositories (my system is Debian Bullseye). If so, then CI is going to start failing when GitHub Actions ubuntu-latest switches to Ubuntu 22.04, which has 1:11.1.0-6 currently.

I'm using Rust 1.62.1, just like the CI builds.

bsilver8192 avatar Jul 25 '22 06:07 bsilver8192

Thanks for this. I haven't managed to get the right versions of libclang to reproduce it yet. I am pretty sure this would be an upstream issue in bindgen but there's no sign of anyone reporting it yet (https://github.com/rust-lang/rust-bindgen/issues?q=+anonymous_namespace+). Next steps here are to get to reproduce this, then report upstream.

adetaylor avatar Sep 14 '22 18:09 adetaylor