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

Panic while building [surfer project](https://surfer-project.org/) bindings #1039

Open
robtaylor opened this issue Jan 12, 2025 · 2 comments

Comments

@robtaylor
Copy link

robtaylor commented Jan 12, 2025

Originating from an issue hit with maturin - PyO3/maturin#2431

While attempting to build the bindings for libsurfer,
using cbindgen 0.27.0, with the following config:

language = "C"
no_includes = true
sys_includes = []
defines = {}
include_guard = ""
pragma_once = false
cpp_compat = false

The following panic occurs:

$ cbindgen -c cbindgen.toml -vv
DEBUG: Parsing crate libsurfer
INFO: Take libsurfer::StartupParams - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::MoveDir - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::ColorSpecifier - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::CachedDrawData - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::CachedWaveDrawData - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CachedTransactionDrawData - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Channels - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CanvasState - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::StateWrapper - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::NUM_PERF_SAMPLES.
INFO: Take libsurfer::TimingRegion - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Timing - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SCReceiver - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SCSender - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SCHandler - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::GlobalChannelTx - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::GlobalChannelRx - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ClockHighlightType - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::RestCommand - opaque (Unsupported type: Type::TraitObject { dyn_token: Some(Dyn), bounds: [TypeParamBound::Trait(TraitBound { paren_token: None, modifier: TraitBoundModifier::None, lifetimes: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Fn), arguments: PathArguments::Parenthesized { paren_token: Paren, inputs: [Type::Reference { and_token: And, lifetime: None, mutability: None, elem: Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(str), arguments: PathArguments::None }] } } }], output: ReturnType::Type(RArrow, Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Option), arguments: PathArguments::AngleBracketed { colon2_token: None, lt_token: Lt, args: [GenericArgument::Type(Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Command), arguments: PathArguments::AngleBracketed { colon2_token: None, lt_token: Lt, args: [GenericArgument::Type(Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Message), arguments: PathArguments::None }] } })], gt_token: Gt } }] } })], gt_token: Gt } }] } }) } }] } })] }).
INFO: Take libsurfer::CommandPrompt - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SuggestionLabel - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::HierarchyStyle - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::ArrowKeyBindings - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::SurferConfig - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SurferLayout - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SurferBehavior - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SurferGesture - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SurferLineStyle - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SurferTicks - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SurferTheme - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ThemeColorPair - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ThemeColorTriple - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::WcpConfig - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Diagnostic - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::CxxrtlCommand - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::CSMessage - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::CxxrtlWorker - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ValueList.
INFO: Take libsurfer::QueryContainer - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CxxrtlSample - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Features - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SimulationStatusType - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::CxxrtlSimulationStatus - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CommandResponse - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::PauseCause - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::Event - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::Error - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SCMessage - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::CxxrtlTimestamp - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
WARN: Skip libsurfer::DEFAULT_REFERENCE - (not `pub`).
INFO: Take libsurfer::Callback - opaque (Unsupported type: Type::TraitObject { dyn_token: Some(Dyn), bounds: [TypeParamBound::Trait(TraitBound { paren_token: None, modifier: TraitBoundModifier::None, lifetimes: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(FnOnce), arguments: PathArguments::Parenthesized { paren_token: Paren, inputs: [Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(CommandResponse), arguments: PathArguments::None }] } }, Comma, Type::Reference { and_token: And, lifetime: None, mutability: Some(Mut), elem: Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(CxxrtlData), arguments: PathArguments::None }] } } }], output: ReturnType::Default } }] } }), Plus, TypeParamBound::Trait(TraitBound { paren_token: None, modifier: TraitBoundModifier::None, lifetimes: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Sync), arguments: PathArguments::None }] } }), Plus, TypeParamBound::Trait(TraitBound { paren_token: None, modifier: TraitBoundModifier::None, lifetimes: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Send), arguments: PathArguments::None }] } })] }).
INFO: Take libsurfer::CxxrtlScope - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CxxrtlItem - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CachedData - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::CxxrtlData - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CSSender - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CxxrtlContainer - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DataContainer - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::VariableType - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::ReloadWaveformDialog - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
WARN: Skip libsurfer::DEFAULT_DIVIDER_NAME - (not `pub`).
INFO: Take libsurfer::DisplayedItemRef - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DisplayedFieldRef - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DisplayedItemIndex - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DisplayedItem - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::FieldFormat - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DisplayedVariable - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DisplayedDivider - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DisplayedMarker - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DisplayedTimeLine - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DisplayedPlaceholder - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DisplayedStream - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DrawnRegion - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DrawingCommands - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::TxDrawingCommands - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::VariableDrawCommands - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::FileWatcher - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Direction - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::Anchor - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::GraphicsY - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::GrPoint - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::GraphicId - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Graphic - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
WARN: Skip libsurfer::EGUI_LOGGER - (not `no_mangle`).
INFO: Take libsurfer::LogMessage - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::EguiLogger - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
WARN: Skip libsurfer::DEFAULT_MARKER_NAME - (Unsupported literal expression. Lit::Str { token: "Marker" })
INFO: Take libsurfer::ButtonBuilder - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CommandCount.
INFO: Take libsurfer::HeaderResult - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::BodyResult - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::AsyncJob - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::Message - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::GestureKind - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::HierarchyResponse - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::State - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SystemState - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::TimeScale - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::TimeUnit - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
WARN: Skip libsurfer::DEFAULT_TIMELINE_NAME - (Unsupported literal expression. Lit::Str { token: "Time" })
WARN: Skip libsurfer::THIN_SPACE - (Unsupported literal expression. Lit::Str { token: "\u{2009}" })
INFO: Take libsurfer::TimeFormat - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::TimeStringFormatting - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::TransactionContainer - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::StreamScopeRef - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::TransactionStreamRef - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::TransactionRef - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DynTranslator - opaque (Unsupported type: Type::TraitObject { dyn_token: Some(Dyn), bounds: [TypeParamBound::Trait(TraitBound { paren_token: None, modifier: TraitBoundModifier::None, lifetimes: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Translator), arguments: PathArguments::AngleBracketed { colon2_token: None, lt_token: Lt, args: [GenericArgument::Type(Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(VarId), arguments: PathArguments::None }] } }), Comma, GenericArgument::Type(Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(ScopeId), arguments: PathArguments::None }] } }), Comma, GenericArgument::Type(Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Message), arguments: PathArguments::None }] } })], gt_token: Gt } }] } })] }).
INFO: Take libsurfer::DynBasicTranslator - opaque (Unsupported type: Type::TraitObject { dyn_token: Some(Dyn), bounds: [TypeParamBound::Trait(TraitBound { paren_token: None, modifier: TraitBoundModifier::None, lifetimes: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(BasicTranslator), arguments: PathArguments::AngleBracketed { colon2_token: None, lt_token: Lt, args: [GenericArgument::Type(Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(VarId), arguments: PathArguments::None }] } }), Comma, GenericArgument::Type(Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(ScopeId), arguments: PathArguments::None }] } })], gt_token: Gt } }] } })] }).
INFO: Take libsurfer::AnyTranslator - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::TranslatorList - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::StringTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::HexTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::BitTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::OctalTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::GroupingBinaryTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::BinaryTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ASCIITranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::LebTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::NumberOfOnesTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::TrailingOnesTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::TrailingZerosTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::LeadingOnesTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::LeadingZerosTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::IdenticalMSBsTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ClockTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::EnumTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::InstructionTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::UnsignedTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SignedTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SinglePrecisionTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DoublePrecisionTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::QuadPrecisionTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::HalfPrecisionTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::BFloat16Translator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Posit32Translator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Posit16Translator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Posit8Translator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::PositQuire8Translator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::PositQuire16Translator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::E5M2Translator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::E4M3Translator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::PythonTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SpadeTestInfo - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::SpadeTranslator - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::VariableNameFilterType - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::VariableNameType - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
WARN: Skip libsurfer::INTEGER_TYPES - (Unsupported type: Type::Slice { bracket_token: Bracket, elem: Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Option), arguments: PathArguments::AngleBracketed { colon2_token: None, lt_token: Lt, args: [GenericArgument::Type(Type::Path { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(VariableType), arguments: PathArguments::None }] } })], gt_token: Gt } }] } } })
INFO: Take libsurfer::DrawingContext - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DrawConfig - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::VariableDrawingInfo - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::DividerDrawingInfo - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::MarkerDrawingInfo - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::TimeLineDrawingInfo - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::StreamDrawingInfo - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ItemDrawingInfo - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::Relative - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Absolute - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::Viewport - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ViewportStrategy - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::Callback - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::WebHandle - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::on_surfer_error.
INFO: Take libsurfer::new.
INFO: Take libsurfer::stack.
INFO: Take libsurfer::UrlArgs - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::FieldRef.
INFO: Take libsurfer::ScopeRef.
INFO: Take libsurfer::VariableRef.
INFO: Take libsurfer::VariableMeta.
INFO: Take libsurfer::SimulationStatus - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::MetaData - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ScopeId - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::VarId - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::QueryResult - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::WaveContainer - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::PER_SCROLL_EVENT.
INFO: Take libsurfer::SCROLL_EVENTS_PER_PAGE.
INFO: Take libsurfer::ScopeType - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::WaveData - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::CxxrtlKind - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::WaveSource - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::WaveFormat - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::LoadOptions - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::OpenMode - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::LoadProgress - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::LoadProgressStatus - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::DisplayedItemRef - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::ItemInfo - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::WcpResponse - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::WcpEvent - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::WcpSCMessage - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::WcpCommand - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::WcpCSMessage - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::WcpServer - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
WARN: Skip libsurfer::UNIQUE_ID_COUNT - (not `no_mangle`).
INFO: Take libsurfer::WellenContainer - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::LoadSignalsCmd - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
INFO: Take libsurfer::LoadSignalPayload - opaque (Enum is not marked with a valid #[repr(prim)] or #[repr(C)].).
INFO: Take libsurfer::LoadSignalsResult - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).
thread 'main' panicked at /Users/roberttaylor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cbindgen-0.27.0/src/bindgen/ir/generic_path.rs:112:9:
FieldRef has 0 params but is being instantiated with 2 values
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <cbindgen::bindgen::ir::typedef::Typedef as cbindgen::bindgen::ir::item::Item>::instantiate_monomorph
   3: cbindgen::bindgen::ir::ty::Type::add_monomorphs
   4: cbindgen::bindgen::library::Library::generate
   5: cbindgen::bindgen::builder::Builder::generate
   6: cbindgen::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@robtaylor
Copy link
Author

bisecting on the config, it seems that language = "C" causes the crash.
Without this setting, the panic goes away, and I get this message instead:

WARN: Can't find JsValue. This usually means that this type was incompatible or not found.

@za-creature
Copy link

za-creature commented Jan 14, 2025

Same error, different config (also with lang = C)

index.crates.io-6f17d22bba15001f/cbindgen-0.27.0/src/bindgen/ir/generic_path.rs:112:9:
CipherState has 0 params but is being instantiated with 1 values
stack backtrace:
   0:        0x100a5ef8c - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h7adefaad4a31afc0
   1:        0x100a7c3ac - core::fmt::write::h381c0b0ce6ab972a
   2:        0x100a5c2c4 - std::io::Write::write_fmt::h75af97148630d8d3
   3:        0x100a5ee40 - std::sys::backtrace::BacktraceLock::print::h8baf33e22611de71
   4:        0x100a5ff84 - std::panicking::default_hook::{{closure}}::h369c7295ef58c5b1
   5:        0x100a5fdc8 - std::panicking::default_hook::h50746358288a9d6a
   6:        0x100a60738 - std::panicking::rust_panic_with_hook::h7d795911432661cb
   7:        0x100a603ec - std::panicking::begin_panic_handler::{{closure}}::h36f15310ecbde379
   8:        0x100a5f450 - std::sys::backtrace::__rust_end_short_backtrace::heed121414170e0c7
   9:        0x100a600a4 - _rust_begin_unwind
  10:        0x100a90794 - core::panicking::panic_fmt::h17b1b80ec02ffd19
  11:        0x100864bc0 - <cbindgen::bindgen::ir::typedef::Typedef as cbindgen::bindgen::ir::item::Item>::instantiate_monomorph::h0fefc74b31a1f48f
  12:        0x100863404 - cbindgen::bindgen::ir::ty::Type::add_monomorphs::h127e6d0a68508172
  13:        0x10075deac - cbindgen::bindgen::library::Library::generate::hc2dc1f6b3453865c
  14:        0x10075408c - cbindgen::bindgen::builder::Builder::generate::h43c4e4d3d93343b5
  15:        0x100779e4c - cbindgen::main::hc4d15bd9a67512a3
  16:        0x1008b17f0 - std::sys::backtrace::__rust_begin_short_backtrace::hcd8c0b76650aee9e
  17:        0x1008d4fc0 - std::rt::lang_start::{{closure}}::hba17c8ba27d7a812
  18:        0x100a57968 - std::rt::lang_start_internal::h77891a2543177e4b
  19:        0x10077c050 - _main

On previous version, error is:

index.crates.io-6f17d22bba15001f/cbindgen-0.26.0/src/bindgen/ir/generic_path.rs:83:9:
CipherState is not generic
stack backtrace:
   0:        0x10464b318 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hadba1856081fe8dc
   1:        0x104668e74 - core::fmt::write::h5358bd20891469bc
   2:        0x104648170 - std::io::Write::write_fmt::hbf0611cc5d72cc91
   3:        0x10464b1cc - std::sys::backtrace::BacktraceLock::print::he2302a8c253c9a13
   4:        0x10464c344 - std::panicking::default_hook::{{closure}}::hec1f77a77d7e7ffc
   5:        0x10464c178 - std::panicking::default_hook::hdd59ab537dd27efb
   6:        0x10464cb34 - std::panicking::rust_panic_with_hook::h533a16f5f89e4278
   7:        0x10464c7ac - std::panicking::begin_panic_handler::{{closure}}::h168c3a4362c8e4df
   8:        0x10464b7dc - std::sys::backtrace::__rust_end_short_backtrace::h601e3529ca2053df
   9:        0x10464c464 - _rust_begin_unwind
  10:        0x10467d3c8 - core::panicking::panic_fmt::ha0f8363f677e0181
  11:        0x1044146b4 - cbindgen::bindgen::ir::generic_path::GenericParams::call::h21cdb9181ac31818
  12:        0x104402298 - <cbindgen::bindgen::ir::typedef::Typedef as cbindgen::bindgen::ir::item::Item>::instantiate_monomorph::h9c65928f319224df
  13:        0x1043c8a70 - cbindgen::bindgen::ir::ty::Type::add_monomorphs::h6d03122789a32894
  14:        0x1043c9b5c - cbindgen::bindgen::library::Library::generate::h744d7ecc81ca0bbd
  15:        0x1044b5744 - cbindgen::bindgen::builder::Builder::generate::h3dbf443082d2d287
  16:        0x1044c0998 - cbindgen::main::h532544089265d91b
  17:        0x104463074 - std::sys::backtrace::__rust_begin_short_backtrace::h6e4a9dae1a663f44
  18:        0x1044a2668 - std::rt::lang_start::{{closure}}::he258fedf84d6b3cc
  19:        0x104643dc8 - std::rt::lang_start_internal::hacda2dedffd2edb4
  20:        0x1044c1a40 - _main

In my case it actually generates correct bindings in C++ mode

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

2 participants