therecipe / qt

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
GNU Lesser General Public License v3.0
10.49k stars 748 forks source link

$GOPATH/bin/qtsetup fail, how to make it work #747

Open orange-jacky opened 5 years ago

orange-jacky commented 5 years ago

macbookpro:qt fredlee$ go version go version go1.11 darwin/amd64 macbookpro:qt fredlee$ go env GOARCH="amd64" GOBIN="/Users/fredlee/Documents/develop/go/workspace/bin" GOCACHE="/Users/fredlee/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/fredlee/Documents/develop/go/workspace" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/34/z2z_vp1573g5014m8k7wys100000gn/T/go-build912566296=/tmp/go-build -gno-record-gcc-switches -fno-common" macbookpro:qt fredlee$ macbookpro:qt fredlee$ macbookpro:qt fredlee$ macbookpro:qt fredlee$ echo $QT_DIR /Users/fredlee/Qt5.11.1 macbookpro:qt fredlee$ echo $QT_VERSION 5.11.1 macbookpro:qt fredlee$ $GOPATH/bin/qtsetup INFO[0000] running: 'qtsetup prep'
INFO[0000] successfully created qtrcc symlink in your PATH (/usr/local/bin/qtrcc) INFO[0000] successfully created qtmoc symlink in your PATH (/usr/local/bin/qtmoc) INFO[0000] successfully created qtminimal symlink in your PATH (/usr/local/bin/qtminimal) INFO[0000] successfully created qtdeploy symlink in your PATH (/usr/local/bin/qtdeploy) INFO[0000] running: 'qtsetup check darwin' [docker=false] [vagrant=false] INFO[0000] GOOS: 'darwin'
INFO[0000] GOARCH: 'amd64'
INFO[0000] GOVERSION: 'go1.11'
INFO[0000] GOROOT: '/usr/local/go' INFO[0000] GOPATH: '/Users/fredlee/Documents/develop/go/workspace' INFO[0000] GOBIN: '/Users/fredlee/Documents/develop/go/workspace/bin' INFO[0000] QT_HASH: '33cc66032318128c0fd7657937d109bc8d75e478' INFO[0000] QT_API: ''
INFO[0000] QT_VERSION: '5.11.1'
INFO[0000] QT_VERSION_MAJOR: '5.11.1'
INFO[0000] QT_DIR:
'/Users/fredlee/Qt5.11.1' INFO[0000] QT_STUB: 'false'
INFO[0000] QT_DEBUG: 'false'
INFO[0000] QT_QMAKE_DIR: ''
INFO[0000] QT_WEBKIT: 'false'
INFO[0000] QT_HOMEBREW: 'false'
INFO[0000] QT_MACPORTS: 'false'
INFO[0000] QT_NIX: 'false'
INFO[0000] XCODE_DIR: '/Applications/Xcode.app' INFO[0000] running: 'qtsetup generate darwin' [docker=false] [vagrant=false] INFO[0007] generating full qt/core
ERRO[0024] failed to run command _func=RunCmdOptional cmd="/Users/fredlee/Qt5.11.1/5.11.1/clang_64/bin/qmake -o Mfile ../core.pro -spec macx-clang CONFIG+=x86_64 CONFIG+=release" dir=/Users/fredlee/Documents/develop/go/workspace/src/github.com/therecipe/qt/core env= error="exit status 3" name="run qmake for darwin on darwin" Info: creating stash file /Users/fredlee/Documents/develop/go/workspace/src/github.com/therecipe/qt/core/.qmake.stash Project ERROR: failed to parse default search paths from compiler output

ERRO[0024] failed to load /Users/fredlee/Documents/develop/go/workspace/src/github.com/therecipe/qt/core/Mfile error="open /Users/fredlee/Documents/develop/go/workspace/src/github.com/therecipe/qt/core/Mfile: no such file or directory" INFO[0024] generating full qt/androidextras
INFO[0025] generating full qt/gui
ERRO[0082] failed to run command _func=RunCmdOptional cmd="/Users/fredlee/Qt5.11.1/5.11.1/clang_64/bin/qmake -o Mfile ../gui.pro -spec macx-clang CONFIG+=x86_64 CONFIG+=release" dir=/Users/fredlee/Documents/develop/go/workspace/src/github.com/therecipe/qt/gui env= error="exit status 3" name="run qmake for darwin on darwin" Info: creating stash file /Users/fredlee/Documents/develop/go/workspace/src/github.com/therecipe/qt/gui/.qmake.stash Project ERROR: failed to parse default search paths from compiler output

ERRO[0082] failed to load /Users/fredlee/Documents/develop/go/workspace/src/github.com/therecipe/qt/gui/Mfile error="open /Users/fredlee/Documents/develop/go/workspace/src/github.com/therecipe/qt/gui/Mfile: no such file or directory" INFO[0082] generating full qt/network

^C macbookpro:qt fredlee$ pw -bash: pw: command not found macbookpro:qt fredlee$ pwd /Users/fredlee/Documents/develop/go/workspace/src/github.com/therecipe/qt

therecipe commented 5 years ago

Hey

Maybe your Xcode installation is outdated. What does xcodebuild -version give you? Also maybe run xcode-select --install

orange-jacky commented 5 years ago

macbookpro:~ fredlee$ xcodebuild -version Xcode 10.1 Build version 10B61

orange-jacky commented 5 years ago

follwing your wiki guide, i still can't install therecipe/qt it still failed after run "$GOPATH/bin/qtsetup". can you help me figure it out?

therecipe commented 5 years ago

The issue Project ERROR: failed to parse default search paths from compiler output indicates that you probably have an outdated/unsupported clang version in your PATH

What does clang --version and/or clang++ --version give you? Also which macOS version do you use? (you can simply run sw_vers)

orange-jacky commented 5 years ago

macbookpro:tmp fredlee$ clang --version Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin macbookpro:tmp fredlee$ clang++ --version Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin macbookpro:tmp fredlee$ xcodebuild -version Xcode 10.1 Build version 10B61 macbookpro:tmp fredlee$

therecipe commented 5 years ago

Mh, this all looks good ...

Could you run $QT_DIR/5.11.1/clang_64/bin/qmake -query ?

edit: also which macOS version do you use? 10.14?

orange-jacky commented 5 years ago

macbookpro:tmp fredlee$ $QT_DIR/5.11.1/clang_64/bin/qmake -query QFileSystemEngine::currentPath: getcwd() failed QFileSystemEngine::currentPath: getcwd() failed QT_SYSROOT: QT_INSTALL_PREFIX:/Users/fredlee/Qt5.11.1/5.11.1/clang_64 QT_INSTALL_ARCHDATA:/Users/fredlee/Qt5.11.1/5.11.1/clang_64 QT_INSTALL_DATA:/Users/fredlee/Qt5.11.1/5.11.1/clang_64 QT_INSTALL_DOCS:/Users/fredlee/Qt5.11.1/Docs/Qt-5.11.1 QT_INSTALL_HEADERS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/include QT_INSTALL_LIBS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/lib QT_INSTALL_LIBEXECS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/libexec QT_INSTALL_BINS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/bin QT_INSTALL_TESTS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/tests QT_INSTALL_PLUGINS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/plugins QT_INSTALL_IMPORTS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/imports QT_INSTALL_QML:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/qml QT_INSTALL_TRANSLATIONS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/translations QT_INSTALL_CONFIGURATION:/Users/fredlee/Qt5.11.1/5.11.1/clang_64 QT_INSTALL_EXAMPLES:/Users/fredlee/Qt5.11.1/Examples/Qt-5.11.1 QT_INSTALL_DEMOS:/Users/fredlee/Qt5.11.1/Examples/Qt-5.11.1 QT_HOST_PREFIX:/Users/fredlee/Qt5.11.1/5.11.1/clang_64 QT_HOST_DATA:/Users/fredlee/Qt5.11.1/5.11.1/clang_64 QT_HOST_BINS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/bin QT_HOST_LIBS:/Users/fredlee/Qt5.11.1/5.11.1/clang_64/lib QMAKE_SPEC:macx-clang QMAKE_XSPEC:macx-clang QMAKE_VERSION:3.1 QT_VERSION:5.11.1 macbookpro:tmp fredlee$

macOS Mojave 10.14.1

therecipe commented 5 years ago

strange, this looks good as well, beside the getcwd() failed part (which might be the cause of your issues, but I'm not sure)

I think the easiest way to go about this now, is to try it from scratch. Luckily I made some changes in the last few days, and now you won't need to manually install Qt for this to work anymore.

Maybe try to do the following: