Skip to content

QFlags generation fails across crate boundaries #115

Description

@jnbooth
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions