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.38k stars 735 forks source link

qtsetup fails: no Go files in ../vendor/github.com/therecipe/qt #1139

Open Merrit opened 4 years ago

Merrit commented 4 years ago
❯ ~/go/bin/qtsetup
INFO[0000] running: 'qtsetup prep'                      
WARN[0000] failed to create qtrcc symlink in your PATH (/sbin/qtrcc); please use /home/merritt/go/bin/qtrcc instead 
WARN[0000] failed to create qtmoc symlink in your PATH (/sbin/qtmoc); please use /home/merritt/go/bin/qtmoc instead 
WARN[0000] failed to create qtminimal symlink in your PATH (/sbin/qtminimal); please use /home/merritt/go/bin/qtminimal instead 
WARN[0000] failed to create qtdeploy symlink in your PATH (/sbin/qtdeploy); please use /home/merritt/go/bin/qtdeploy instead 
INFO[0000] running: 'qtsetup check linux' [docker=false] [vagrant=false] 
INFO[0000] GOOS:                        'linux'         
INFO[0000] GOARCH:                      'amd64'         
INFO[0000] GOVERSION:                   'go1.14.4'      
INFO[0000] GOROOT:                      '/usr/lib/go'   
INFO[0000] GOPATH:                   *  '/home/merritt/go' 
INFO[0000] GOBIN:                    *  '/home/merritt/go/bin' 
INFO[0000] GOMOD:                       '/home/merritt/Development/nyrna/go.mod' 
INFO[0000] QT_HASH:                     'v0.0.0-20200701200531-7f61353ee73e' 
INFO[0000] QT_API:                      ''              
INFO[0000] QT_VERSION:                  '5.13.0'        
INFO[0000] QT_DIR:                   *  '/home/merritt/Development/Qt5.13.0' 
INFO[0000] QT_STUB:                     'false'         
INFO[0000] QT_DEBUG:                    'false'         
INFO[0000] QT_QMAKE_DIR:                ''              
INFO[0000] QT_WEBKIT:                   'false'         
INFO[0000] QT_STATIC:                   'false'         
INFO[0000] QT_GEN_TSD:                  'false'         
INFO[0000] QT_GEN_OPENGL:               'false'         
INFO[0000] QT_GEN_QUICK_EXTRAS:         'false'         
INFO[0000] QT_RESOURCES_BIG:            'false'         
INFO[0000] QT_NOT_CACHED:               'false'         
INFO[0000] QT_DISTRO:                   'arch'          
INFO[0000] QT_PKG_CONFIG:               'false'         
INFO[0000] running: 'qtsetup generate linux' [docker=false] [vagrant=false] 
INFO[0007] generating full qt/core                      
INFO[0037] generating full qt/androidextras             
INFO[0038] generating full qt/gui                       
INFO[0073] generating full qt/network                   
INFO[0082] generating full qt/xml                       
INFO[0085] generating full qt/dbus                      
INFO[0089] generating full qt/nfc                       
INFO[0091] generating full qt/script                    
INFO[0092] generating full qt/sensors                   
INFO[0101] generating full qt/positioning               
INFO[0103] generating full qt/widgets                   
INFO[0179] generating full qt/sql                       
INFO[0185] generating full qt/qml                       
INFO[0190] generating full qt/websockets                
INFO[0192] generating full qt/xmlpatterns               
INFO[0193] generating full qt/bluetooth                 
INFO[0198] generating full qt/webchannel                
INFO[0199] generating full qt/svg                       
INFO[0202] generating full qt/multimedia                
INFO[0232] generating full qt/quick                     
INFO[0240] generating full qt/help                      
INFO[0248] generating full qt/location                  
INFO[0251] generating full qt/scripttools               
INFO[0252] generating full qt/uitools                   
INFO[0252] generating full qt/webengine                 
INFO[0257] generating full qt/testlib                   
INFO[0258] generating full qt/serialport                
INFO[0259] generating full qt/serialbus                 
INFO[0262] generating full qt/printsupport              
INFO[0268] generating full qt/designer                  
INFO[0276] generating full qt/scxml                     
INFO[0279] generating full qt/gamepad                   
INFO[0280] generating full qt/purchasing                
INFO[0281] generating full qt/datavisualization    [GPLv3] 
INFO[0292] generating full qt/charts               [GPLv3] 
INFO[0311] generating full qt/virtualkeyboard      [GPLv3] 
INFO[0314] generating full qt/speech                    
INFO[0315] generating full qt/quickcontrols2            
INFO[0315] generating full qt/sailfish                  
INFO[0315] generating full qt/webview                   
INFO[0315] generating full qt/remoteobjects             
INFO[0320] running: 'qtsetup install linux' [docker=false] [vagrant=false] 
INFO[0320] installing full qt/core                      
vendor/github.com/therecipe/qt/core/core.go:11:2: no Go files in /home/merritt/Development/nyrna/vendor/github.com/therecipe/qt

ERRO[0320] failed to install 'core'; aborting setup

go env

❯ go env       
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/home/merritt/go/bin"
GOCACHE="/home/merritt/.cache/go-build"
GOENV="/home/merritt/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/merritt/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/merritt/Development/nyrna/go.mod"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build196980404=/tmp/go-build -gno-record-gcc-switches"
Fapiko commented 4 years ago

Also getting this error on Ubuntu running Go 1.15.


ljandrew@ljandrew-desktop:/opt/go-qt-gui$ export GO111MODULE=on; go get -v github.com/therecipe/qt && go install -v -tags=no_env github.com/therecipe/qt/cmd/... && go mod vendor && git clone https://github.com/therecipe/env_linux_amd64_513.git vendor/github.com/therecipe/env_linux_amd64_513 && $(go env GOPATH)/bin/qtsetup
go: github.com/therecipe/qt upgrade => v0.0.0-20200819184607-ca87f3552e22
go: finding module for package github.com/therecipe/qt/internal/binding/files/docs/5.12.0
go: finding module for package github.com/therecipe/qt/internal/binding/files/docs/5.13.0
go: found github.com/therecipe/qt/internal/binding/files/docs/5.12.0 in github.com/therecipe/qt/internal/binding/files/docs/5.12.0 v0.0.0-20200819184607-ca87f3552e22
go: found github.com/therecipe/qt/internal/binding/files/docs/5.13.0 in github.com/therecipe/qt/internal/binding/files/docs/5.13.0 v0.0.0-20200819184607-ca87f3552e22
Cloning into 'vendor/github.com/therecipe/env_linux_amd64_513'...
remote: Enumerating objects: 9446, done.
remote: Total 9446 (delta 0), reused 0 (delta 0), pack-reused 9446
Receiving objects: 100% (9446/9446), 129.24 MiB | 31.56 MiB/s, done.
Resolving deltas: 100% (4194/4194), done.
Updating files: 100% (9714/9714), done.
INFO[0001] running: 'qtsetup prep'                      
WARN[0001] failed to create qtrcc symlink in your PATH (/sbin/qtrcc); please use /opt/gopath/bin/qtrcc instead 
WARN[0001] failed to create qtmoc symlink in your PATH (/sbin/qtmoc); please use /opt/gopath/bin/qtmoc instead 
WARN[0001] failed to create qtminimal symlink in your PATH (/sbin/qtminimal); please use /opt/gopath/bin/qtminimal instead 
WARN[0001] failed to create qtdeploy symlink in your PATH (/sbin/qtdeploy); please use /opt/gopath/bin/qtdeploy instead 
INFO[0001] running: 'qtsetup check linux' [docker=false] [vagrant=false] 
INFO[0001] GOOS:                        'linux'         
INFO[0001] GOARCH:                      'amd64'         
INFO[0001] GOVERSION:                   'go1.15'        
INFO[0001] GOROOT:                   *  '/opt/go/1.15'  
INFO[0001] GOPATH:                   *  '/opt/gopath'   
INFO[0001] GOBIN:                       '/opt/gopath/bin' 
INFO[0001] GOMOD:                       '/opt/go-qt-gui/go.mod' 
INFO[0001] QT_HASH:                     'v0.0.0-20200819184607-ca87f3552e22' 
INFO[0001] QT_API:                      ''              
INFO[0001] QT_VERSION:                  '5.13.0'        
INFO[0001] QT_DIR:                   *  '/opt/go-qt-gui/vendor/github.com/therecipe/env_linux_amd64_513' 
INFO[0001] QT_STUB:                     'false'         
INFO[0001] QT_DEBUG:                    'false'         
INFO[0001] QT_QMAKE_DIR:                ''              
INFO[0001] QT_WEBKIT:                   'false'         
INFO[0001] QT_STATIC:                   'false'         
INFO[0001] QT_GEN_GO:                   'false'         
INFO[0001] QT_GEN_OPENGL:               'false'         
INFO[0001] QT_GEN_QUICK_EXTRAS:         'false'         
INFO[0001] QT_RESOURCES_BIG:            'false'         
INFO[0001] QT_NOT_CACHED:               'false'         
INFO[0001] QT_DISTRO:                   'ubuntu'        
INFO[0001] QT_PKG_CONFIG:               'false'         
INFO[0001] running: 'qtsetup generate linux' [docker=false] [vagrant=false] 
INFO[0006] generating full qt/core                      
INFO[0024] generating full qt/androidextras             
INFO[0024] generating full qt/gui                       
INFO[0047] generating full qt/network                   
INFO[0053] generating full qt/xml                       
INFO[0055] generating full qt/dbus                      
INFO[0057] generating full qt/nfc                       
INFO[0058] generating full qt/script                    
INFO[0059] generating full qt/sensors                   
INFO[0064] generating full qt/positioning               
INFO[0066] generating full qt/widgets                   
INFO[0114] generating full qt/sql                       
INFO[0117] generating full qt/qml                       
INFO[0120] generating full qt/websockets                
INFO[0121] generating full qt/xmlpatterns               
INFO[0122] generating full qt/bluetooth                 
INFO[0125] generating full qt/webchannel                
INFO[0126] generating full qt/svg                       
INFO[0127] generating full qt/multimedia                
INFO[0146] generating full qt/quick                     
INFO[0151] generating full qt/help                      
INFO[0156] generating full qt/location                  
INFO[0157] generating full qt/scripttools               
INFO[0158] generating full qt/uitools                   
INFO[0158] generating full qt/webengine                 
INFO[0161] generating full qt/testlib                   
INFO[0161] generating full qt/serialport                
INFO[0162] generating full qt/serialbus                 
INFO[0164] generating full qt/printsupport              
INFO[0167] generating full qt/designer                  
INFO[0171] generating full qt/scxml                     
INFO[0173] generating full qt/gamepad                   
INFO[0174] generating full qt/purchasing                
INFO[0174] generating full qt/datavisualization    [GPLv3] 
INFO[0180] generating full qt/charts               [GPLv3] 
INFO[0191] generating full qt/virtualkeyboard      [GPLv3] 
INFO[0193] generating full qt/speech                    
INFO[0193] generating full qt/quickcontrols2            
INFO[0194] generating full qt/sailfish                  
INFO[0194] generating full qt/webview                   
INFO[0194] generating full qt/remoteobjects             
INFO[0196] running: 'qtsetup install linux' [docker=false] [vagrant=false] 
INFO[0196] installing full qt/core                      
package github.com/therecipe/qt/core
        imports github.com/therecipe/qt: no Go files in /opt/go-qt-gui/vendor/github.com/therecipe/qt

ERRO[0196] failed to install 'core'; aborting setup 
therecipe commented 4 years ago

Hey

I looked into this and using something like this:

FROM ubuntu:16.04

ENV USER user
ENV HOME /home/$USER
ENV GOPATH $HOME/work
ENV PATH /usr/local/go/bin:$PATH

## Those are only needed on docker ##
RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install build-essential libglib2.0-dev libglu1-mesa-dev libpulse-dev \
    && apt-get --no-install-recommends -qq -y install fontconfig libasound2 libegl1-mesa libnss3 libpci3 libxcomposite1 libxcursor1 libxi6 libxrandr2 libxtst6 && apt-get -qq clean && apt-get -qq update && apt-get --no-install-recommends -qq -y install fcitx-frontend-qt5 && apt-get -qq clean
#####################################

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install ca-certificates curl git
RUN GO=go1.13.4.linux-amd64.tar.gz && curl -sL --retry 10 --retry-delay 60 -O https://dl.google.com/go/$GO && tar -xzf $GO -C /usr/local

RUN git clone https://github.com/therecipe/examples.git

ENV GO111MODULE on
RUN cd examples && go get -v github.com/therecipe/qt && go install -v -tags=no_env github.com/therecipe/qt/cmd/... && go mod vendor && git clone https://github.com/therecipe/env_linux_amd64_513.git vendor/github.com/therecipe/env_linux_amd64_513 && $(go env GOPATH)/bin/qtsetup

should work, it could be that you need to remove your old vendor folder first thought.

Also btw, I'm currently working on an experimental mode that greatly simplifies the support for go modules and makes it possible to simply go get the repo without any additional requirements or installation steps. To test it, you can use something like this:

FROM ubuntu:16.04

ENV USER user
ENV HOME /home/$USER
ENV GOPATH $HOME/work
ENV PATH /usr/local/go/bin:$PATH

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install ca-certificates curl git
RUN GO=go1.15.linux-amd64.tar.gz && curl -sL --retry 10 --retry-delay 60 -O https://dl.google.com/go/$GO && tar -xzf $GO -C /usr/local

RUN git clone https://github.com/therecipe/examples.git

ENV GO111MODULE on
RUN cd examples && go get -v github.com/therecipe/qt && go build -o widgets ./basic/widgets && ./widgets

On another note, it seems like Go 1.14 in module mode, breaks using go install outside of the GOPATH and you would need to move your repo inside the go path to have qtsetup run successfully.

I will probably start to advise against using go modules in the future, since they seem to find a way to make the usage for people using cgo in their project, more tedious with each release.

ChriZ982 commented 4 years ago

On another note, it seems like Go 1.14 in module mode, breaks using go install outside of the GOPATH and you would need to move your repo inside the go path to have qtsetup run successfully.

This fixed the issue for me. Did not find it in the installation notes. Should probably be included.

Thanks!