oxidize-rb / rb-sys

Easily build Ruby native extensions in Rust
https://oxidize-rb.github.io/rb-sys/
Apache License 2.0
219 stars 34 forks source link

cannot find type {RArray,RString} in this scope #355

Closed WeepingClown13 closed 4 months ago

WeepingClown13 commented 4 months ago

Packaging rb-sys for Debian has shown me this specific error in multiple test cases. cargo test --all-targets --features bindgen-impl-debug,link-ruby (with or without link-ruby) can reproduce this. Not sharing the whole stacktrace as that is huge, but I'll add the relevant errors.

elp: consider importing one of these items
  |
1 | # [doc = r" Contains all items that are not yet categorized by ABI stability."] # [doc = r" These items are candidates for promotion to `stable` or `unstable`"] # [doc = r" in the future."] pub mod uncategorized { use crate::RString;
  |                                                                                                                                                                                                                       +++++++++++++++++++
1 | # [doc = r" Contains all items that are not yet categorized by ABI stability."] # [doc = r" These items are candidates for promotion to `stable` or `unstable`"] # [doc = r" in the future."] pub mod uncategorized { use crate::internal::RString;
  |                                                                                                                                                                                                                       +++++++++++++++++++++++++++++
1 | # [doc = r" Contains all items that are not yet categorized by ABI stability."] # [doc = r" These items are candidates for promotion to `stable` or `unstable`"] # [doc = r" in the future."] pub mod uncategorized { use crate::stable::RString;
  |                                                                                                                                                                                                                       +++++++++++++++++++++++++++

error[E0412]: cannot find type `RArray` in this scope
 --> /home/weepingclown/debian/rust/debcargo-conf/build/rb-sys/target/debug/build/rb-sys-83031d16783079ea/out/bindings-0.9.94-x86_64-linux-gnu-3.1.2.rs:1:86178
  |
1 | ... :: Result { write ! (f , "RArray__bindgen_ty_1 {{ union }}") } } impl :: std :: fmt :: Debug for RArray { fn fmt (& self , f : & mut :: std :: fmt :: Formatter < '_ >) -> :: std :: fmt :: Result { write ! (f , "RArray {{ basic...
  |                                                                                                      ^^^^^^ not found in this scope
  |
help: consider importing one of these items
  |
1 | # [doc = r" Contains all items that are not yet categorized by ABI stability."] # [doc = r" These items are candidates for promotion to `stable` or `unstable`"] # [doc = r" in the future."] pub mod uncategorized { use crate::RArray;
  |                                                                                                                                                                                                                       ++++++++++++++++++
1 | # [doc = r" Contains all items that are not yet categorized by ABI stability."] # [doc = r" These items are candidates for promotion to `stable` or `unstable`"] # [doc = r" in the future."] pub mod uncategorized { use crate::internal::RArray;
  |                                                                                                                                                                                                                       ++++++++++++++++++++++++++++
1 | # [doc = r" Contains all items that are not yet categorized by ABI stability."] # [doc = r" These items are candidates for promotion to `stable` or `unstable`"] # [doc = r" in the future."] pub mod uncategorized { use crate::stable::RArray;
  |                                                                                                                                                                                                                       ++++++++++++++++++++++++++

For more information about this error, try `rustc --explain E0412`.
error: could not compile `rb-sys` due to 2 previous errors
ianks commented 4 months ago

Thanks for the report. I am able to recreate this issue on my machine. Looks to be an issue with bindgen-impl-debug, will fix

ianks commented 4 months ago

Released fix in https://github.com/oxidize-rb/rb-sys/releases/tag/v0.9.96