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

QFlags generation fails across crate boundaries #115

Open
jnbooth opened this issue Jul 5, 2021 · 0 comments
Open

QFlags generation fails across crate boundaries #115

jnbooth opened this issue Jul 5, 2021 · 0 comments

Comments

@jnbooth
Copy link

jnbooth commented Jul 5, 2021

DEBUG [ritual::database]     source: qt_gui#8726
TRACE [ritual::database]     rust item data: Function(RustFunction { is_public: true, is_unsafe: false, path: RustPath { parts: ["qt_gui", "QRegularExpressionValidator", "regular_expression_changed"] }, kind: SignalOrSlotGetter(RustSignalOrSlotGetter), arguments: [RustFunctionArgument { argument_type: RustFinalType { ffi_type: PointerLike { kind: Reference { lifetime: None }, is_const: true, target: Common(RustCommonType { path: RustPath { parts: ["qt_gui", "QRegularExpressionValidator"] }, generic_arguments: None }) }, api_type: PointerLike { kind: Reference { lifetime: None }, is_const: true, target: Common(RustCommonType { path: RustPath { parts: ["qt_gui", "QRegularExpressionValidator"] }, generic_arguments: None }) }, conversion: None }, name: "self", ffi_index: 42 }], return_type: RustFinalType { ffi_type: Common(RustCommonType { path: RustPath { parts: ["qt_core", "Signal"] }, generic_arguments: Some([Tuple([PointerLike { kind: Pointer, is_const: true, target: Common(RustCommonType { path: RustPath { parts: ["qt_core", "QRegularExpression"] }, generic_arguments: None }) }])]) }), api_type: Common(RustCommonType { path: RustPath { parts: ["qt_core", "Signal"] }, generic_arguments: Some([Tuple([PointerLike { kind: Pointer, is_const: true, target: Common(RustCommonType { path: RustPath { parts: ["qt_core", "QRegularExpression"] }, generic_arguments: None }) }])]) }), conversion: None } })
TRACE [ritual::rust_generator] process_cpp_class: DbItem { id: ItemId { crate_name: "qt_gui", id: 15981 }, source_id: Some(ItemId { crate_name: "qt_core", id: 116 }), item: CppTypeDeclaration { path: CppPath { items: ["QFlags"<Enum { path: CppPath { items: ["Qt", "KeyboardModifier"] } }>] }, kind: Class } }
ERROR [ritual::processor] Step failed! Aborting...
INFO [ritual::workspace] Saving data
ERROR [ritual_common::errors] Error:
ERROR [ritual_common::errors]    can't add rust item with different crate name: ExtraImpl(RustExtraImpl { parent_path: RustPath { parts: ["qt_core"] }, kind: FlagEnum(RustFlagEnumImpl { enum_path: RustPath { parts: ["qt_core", "KeyboardModifier"] } }) })

This occurs from running the command CLANG_SYSTEM_INCLUDE_PATH=/usr/lib/clang/12.0.0/include target/release/qt_ritual workspace -c all --local-paths true -o main -v 0.5.0 (which I'm mostly certain is the command I'm supposed to run), during the generation of qt_gui. Even if those bail! statements are commented out, a few extra Into<QFlags> implementations aren't generated, meaning the only way to call functions like QTextBlockFormat::set_alignment is to generate the QFlags manually, e.g. QFlags::from(AlignmentFlag::AlignLeft.to_int()).

Specifically, these QFlags are missing:

  • MouseButton
  • Orientation
  • KeyboardModifier
  • WindowType
  • AlignmentFlag
  • Edge
  • ImageConversionFlag
  • DockWidget
  • ToolBarArea
  • WindowState
  • ScreenOrientation
  • TextInteractionFlag
  • InputMethodQuery
  • InputMethodHint
  • TouchPointState
  • MouseEventFlag
  • GestureFlag
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

1 participant