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

Qt6 Python bindings - failure to build on macOS #3188

Closed
1 of 3 tasks
Tracked by #3223
XVilka opened this issue May 22, 2023 · 4 comments · Fixed by #3268
Closed
1 of 3 tasks
Tracked by #3223

Qt6 Python bindings - failure to build on macOS #3188

XVilka opened this issue May 22, 2023 · 4 comments · Fixed by #3268

Comments

@XVilka
Copy link
Member

XVilka commented May 22, 2023

Environment information

  • Operating System: macOS 13.x (ARM64)
  • Cutter version: 4491760
  • Obtained from:
    • Built from source
    • Downloaded release from Cutter website or GitHub
    • Distribution repository
  • File format: -

Describe the bug

  1. Install Qt 6 from Homebrew
  2. Build using the following CMake command: cmake -B build -DCUTTER_QT6=ON -DCUTTER_ENABLE_SIGDB=ON -DCUTTER_PACKAGE_RZ_GHIDRA=ON -DCUTTER_PACKAGE_RZ_LIBSWIFT=ON -DCUTTER_PACKAGE_RZ_LIBYARA=ON -DCUTTER_ENABLE_PYTHON=ON -DCUTTER_ENABLE_PYTHON_BINDINGS=ON && make -C build

Observe the error

[  4%] Generating Python bindings with shiboken2
(bindings) clang_parseTranslationUnit2(0x0, cmd[41]=-nostdinc -isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -isystem/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include -isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -isystem/Library/Developer/CommandLineTools/usr/include -iframework/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -fPIC -Wno-expansion-to-defined -Wno-constant-logical-operand -x c++ -std=c++17 -I/opt/homebrew/Frameworks/Python.framework/Versions/3.11/include/python3.11:/opt/homebrew/include/PySide6:/opt/homebrew/include/PySide6/QtCore:/opt/homebrew/include/PySide6/QtGui:/opt/homebrew/include/PySide6/QtWidgets:/Volumes/Sources/Rizin/cutter/build/src/bindings/CutterBindings:/Volumes/Sources/Rizin/cutter/src/core:/Volumes/Sources/Rizin/cutter/src/widgets:/Volumes/Sources/Rizin/cutter/src/common:/Volumes/Sources/Rizin/cutter/src/plugins:/Volumes/Sources/Rizin/cutter/src/menus:/Volumes/Sources/Rizin/cutter/src/.:/opt/homebrew/lib/QtCore.framework/Headers:/opt/homebrew/lib/QtCore.framework:/opt/homebrew/lib/QtWidgets.framework/Headers:/opt/homebrew/lib/QtWidgets.framework:/opt/homebrew/lib/QtCore.framework/Headers:/opt/homebrew/lib/QtCore.framework:/opt/homebrew/lib/QtGui.framework/Headers:/opt/homebrew/lib/QtGui.framework:/opt/homebrew/lib/QtDBus.framework/Headers:/opt/homebrew/lib/QtDBus.framework:/opt/homebrew/lib/QtGui.framework/Headers:/opt/homebrew/lib/QtGui.framework:/opt/homebrew/lib/QtCore.framework/Headers:/opt/homebrew/lib/QtCore.framework:/opt/homebrew/lib/QtDBus.framework/Headers:/opt/homebrew/lib/QtDBus.framework:/Volumes/Sources/Rizin/cutter/build/Rizin-prefix/include/librz:/Volumes/Sources/Rizin/cutter/build/Rizin-prefix/include/librz/sdb:/Volumes/Sources/Rizin/cutter/src -I/opt/homebrew/lib/QtCore.framework/Headers -I/opt/homebrew/lib/QtCore.framework -I/opt/homebrew/lib/QtWidgets.framework/Headers -I/opt/homebrew/lib/QtWidgets.framework -I/opt/homebrew/lib/QtCore.framework/Headers -I/opt/homebrew/lib/QtCore.framework -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtGui.framework -I/opt/homebrew/lib/QtDBus.framework/Headers -I/opt/homebrew/lib/QtDBus.framework -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtGui.framework -I/opt/homebrew/lib/QtCore.framework/Headers -I/opt/homebrew/lib/QtCore.framework -I/opt/homebrew/lib/QtDBus.framework/Headers -I/opt/homebrew/lib/QtDBus.framework -I/Volumes/Sources/Rizin/cutter/src/core -I/Volumes/Sources/Rizin/cutter/src/widgets -I/Volumes/Sources/Rizin/cutter/src/common -I/Volumes/Sources/Rizin/cutter/src/plugins -I/Volumes/Sources/Rizin/cutter/src/menus -I/Volumes/Sources/Rizin/cutter/src -I/Volumes/Sources/Rizin/cutter/build/Rizin-prefix/include/librz -I/Volumes/Sources/Rizin/cutter/build/Rizin-prefix/include/librz/sdb /private/var/folders/x9/k5dys75d2vg49zqcw82546680000gq/T/bindings_IRijpp.hpp "-DQT_ANNOTATE_ACCESS_SPECIFIER(a)=__attribute__((annotate(#a)))" "-DQT_ANNOTATE_CLASS(type,...)=static_assert(sizeof(#__VA_ARGS__),#type);" -DQSIMD_H)
/opt/homebrew/lib/QtCore.framework/Headers/qstring.h:14:10: fatal error: 'QtCore/qchar.h' file not found
(bindings) Errors in -DQSIMD_H:
/opt/homebrew/lib/QtCore.framework/Headers/qstring.h:14:10: fatal: 'QtCore/qchar.h' file not found
   /private/var/folders/x9/k5dys75d2vg49zqcw82546680000gq/T/bindings_IRijpp.hpp:1:10: note: in file included from /private/var/folders/x9/k5dys75d2vg49zqcw82546680000gq/T/bindings_IRijpp.hpp:1:
   /Volumes/Sources/Rizin/cutter/src/bindings/bindings.h:7:10: note: in file included from /Volumes/Sources/Rizin/cutter/src/bindings/bindings.h:7:
   /Volumes/Sources/Rizin/cutter/src/core/Cutter.h:4:10: note: in file included from /Volumes/Sources/Rizin/cutter/src/core/Cutter.h:4:
   /Volumes/Sources/Rizin/cutter/src/core/CutterCommon.h:9:10: note: in file included from /Volumes/Sources/Rizin/cutter/src/core/CutterCommon.h:9:
   /opt/homebrew/lib/QtCore.framework/Headers/QString:1:10: note: in file included from /opt/homebrew/lib/QtCore.framework/Headers/QString:1:


(bindings) Clang: 1 diagnostic messages:
  /opt/homebrew/lib/QtCore.framework/Headers/qstring.h:14:10: fatal: 'QtCore/qchar.h' file not found
   /private/var/folders/x9/k5dys75d2vg49zqcw82546680000gq/T/bindings_IRijpp.hpp:1:10: note: in file included from /private/var/folders/x9/k5dys75d2vg49zqcw82546680000gq/T/bindings_IRijpp.hpp:1:
   /Volumes/Sources/Rizin/cutter/src/bindings/bindings.h:7:10: note: in file included from /Volumes/Sources/Rizin/cutter/src/bindings/bindings.h:7:
   /Volumes/Sources/Rizin/cutter/src/core/Cutter.h:4:10: note: in file included from /Volumes/Sources/Rizin/cutter/src/core/Cutter.h:4:
   /Volumes/Sources/Rizin/cutter/src/core/CutterCommon.h:9:10: note: in file included from /Volumes/Sources/Rizin/cutter/src/core/CutterCommon.h:9:
   /opt/homebrew/lib/QtCore.framework/Headers/QString:1:10: note: in file included from /opt/homebrew/lib/QtCore.framework/Headers/QString:1:


Keeping temporary file: /private/var/folders/x9/k5dys75d2vg49zqcw82546680000gq/T/bindings_IRijpp.hpp
shiboken: Error running ApiExtractor.

See #2952

@XVilka
Copy link
Member Author

XVilka commented Nov 1, 2023

@karliss do you have any idea what could possibly be the reason of this? I tried different solutions but all failed miserably.

@karliss
Copy link
Member

karliss commented Nov 1, 2023

@XVilka What kind of Qt are you using? One from cutter-deps, homebrew or similar package manager, something else?

I can't read.

@lilyinstarlight
Copy link

Shouldn't cutter be using --framework-include-paths= on darwin/macOS when calling shiboken like PySide6 does, since there is no upstream Qt6 guarantee that ${QT6_INSTALL_PREFIX}/include includes the framework headers as far as I can tell?

I'm still getting this error even with #3268 when building from Nix because Homebrew does an old Qt5 workaround that was originally intended to deal with broken pkg-config files to simulate a ${QT6_INSTALL_PREFIX}/include via symlinked headers

@karliss
Copy link
Member

karliss commented Nov 28, 2023

@lilyinstarlight Thanks for suggestion and all the links. I will take a look at framework-include-paths.

Fully agree that that ${QT6_INSTALL_PREFIX} is dirty hack and I don't like it.

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

Successfully merging a pull request may close this issue.

3 participants