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

not support export GO111MODULE=on #755

Closed
orange-jacky opened this issue Dec 25, 2018 · 5 comments
Closed

not support export GO111MODULE=on #755

orange-jacky opened this issue Dec 25, 2018 · 5 comments

Comments

@orange-jacky
Copy link

when export GO111MODULE=on with go1.11 and go1.12, this package will not work, when to support go modules methods

@therecipe
Copy link
Owner

Hey

I will look into this, maybe try pinning the repo to one of these commits in the meantime 8610850 or 179fefb

@itswisdomagain
Copy link

I'm also having issues building with go module on, I'm using go1.11.4. Any fix yet?

@therecipe
Copy link
Owner

therecipe commented Jan 17, 2019

If you are behind the GFW, please take a look here #808 (comment)


Okay with e73768b something like the following should work.

git clone https://github.com/myName/myProject.git

cd ./myProject

go mod download && go get -u -v github.com/therecipe/qt/cmd/qtsetup && go get -u -v github.com/therecipe/qt/cmd/...

go mod vendor && cd ./vendor/github.com/therecipe && git clone https://github.com/therecipe/env_$(go env GOOS)_amd64_512.git && cd ../../..

(replace the last line with

go mod vendor && cd ./vendor/github.com/therecipe && git clone https://github.com/therecipe/env_windows_amd64_512.git && cd ../../..

on windows)

then you can either run $HOME/go/bin/qtdeploy to directly build the application

or run $HOME/go/bin/qtsetup to make qtdeploy -fast and plain go run/build -mod=vendor work



and now a tiny rant ...

If I could, I would make

git clone https://github.com/myName/myProject.git && cd ./myProject
go mod download && go get -u -v github.com/therecipe/qt/cmd/... && $HOME/go/bin/qtdeploy

work for you, however there are several issues preventing me from doing so

one minor issue is due the immaturity of the module support in general and might be fixed at some point:

go get -u -v github.com/therecipe/qt/cmd/qtsetup && go get -u -v github.com/therecipe/qt/cmd/...

instead of

go get -u -v github.com/therecipe/qt/cmd/...

the bigger issue is however the removal of symlinks: golang/go#24057 (comment)
sure, it makes sense from the go teams pov to prune everything not directly related to the go build process, however this makes working with module'd macOS .frameworks as well as soname'd libraries difficult/impossible

there is some really ugly way to hack around this, by simply duplicating the binaries instead of using symlinks, however this is not possible due the arbitrary size limitation of go modules: golang/go#29210
(another idea I had to work around this was to create some kind of synthetic env entirely made out of symlinks, but ... yeah)

also some other issues I encountered along the way:

you will need to use

go get -u -v github.com/therecipe/qt/cmd/...

instead of

go get -u -v -tags=no_env github.com/therecipe/qt/cmd/...

which forces you to download the env_*_amd64_512 twice, once with go get and once later with git clone, since go list -mod=vendor -f {{.Dir}} github.com/therecipe/env_*_amd64_512 won't work otherwise

also, golang/go#29452 which causes go list to compile cgo code
and whose workaround CGO_ENABLED=0 won't work if you also use GOPROXY=disallow



just for reference #726 #742

@therecipe
Copy link
Owner

Modules should be supported now with e73768b, take a look here #755 (comment)

I will close this now, but please open an issue if you encounter any issues using them

@liugangnhm
Copy link

export GOPROXY=https://goproxy.io

it is maybe more simple

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

4 participants