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

build module requires Go 1.13 cross-compiling #313

Closed
nzlov opened this issue Nov 18, 2019 · 11 comments
Closed

build module requires Go 1.13 cross-compiling #313

nzlov opened this issue Nov 18, 2019 · 11 comments
Labels
bug Something isn't working has-workarround hover

Comments

@nzlov
Copy link

nzlov commented Nov 18, 2019

Hover doctor

$ hover doctor
hover: Running on darwin
hover: Docker installed: true
hover: Sharing flutter version
Flutter 1.10.15-pre.23 • channel master • https://github.com/flutter/flutter.git
Framework • revision 440753bae8 (6 weeks ago) • 2019-10-08 21:33:17 -0700
Engine • revision 0d749933bc
Tools • Dart 2.6.0 (build 2.6.0-dev.0.0 f4a72bfc64)
hover: Flutter engine commit: https://github.com/flutter/engine/commit/0d749933bc
hover: ⚠ The go-flutter project tries to stay compatible with the beta channel of Flutter.
hover: ⚠     It's advised to use the beta channel: `flutter channel beta`
hover: Finding out the C compiler version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
hover: Sharing the content of go.mod
module minesweeper/go

go 1.13

require (
	github.com/go-flutter-desktop/go-flutter v0.33.0
	github.com/go-flutter-desktop/plugins/shared_preferences v0.4.3
	github.com/pkg/errors v0.8.1
)
hover: Sharing the content of hover.yaml
target: lib/main_desktop.dart
branch: ""
cache-path: ""
opengl: ""
docker: false
hover: Sharing the content of go/cmd
go/cmd/import-shared_preferences-plugin.go	go/cmd/main.go	go/cmd/options.go

Error output

Using hover build [...] --XXX to build my application, I get the following
error:

hover: Using engine from cache
hover: Cleaning the build directory
hover: ⚠ The go-flutter project tries to stay compatible with the beta channel of Flutter.
hover: ⚠     It's advised to use the beta channel: `flutter channel beta`
hover: Bundling flutter app
hover: Because darwin is not able to compile for windows out of the box, a cross-compiling container is used
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM dockercore/golang-cross
 ---> 44188208cab3
Step 2/2 : RUN apt-get update && apt-get install libgl1-mesa-dev xorg-dev -y
 ---> Using cache
 ---> a7763d7b30c3
Successfully built a7763d7b30c3
Successfully tagged hover-build-cc:latest
hover: Cross-Compiling 'go-flutter' and plugins using docker
github.com/go-flutter-desktop/plugins/shared_preferences
# github.com/go-flutter-desktop/plugins/shared_preferences
/go/pkg/mod/github.com/go-flutter-desktop/plugins/[email protected]/plugin.go:47:28: undefined: os.UserConfigDir
note: module requires Go 1.13
hover: Docker run failed: exit status 2

Why:

docker image golang-cross based on golang 1.12.12.
shared_preferences use os.UserConfigDir in golang 1.13

How Fix

rebuild golang-cross image based on golang 1.13

@provokateurin
Copy link
Member

I think you need to update the docker image. I have no problem with cross-compiling.

@pchampio
Copy link
Member

pchampio commented Nov 18, 2019

@jld3103 can you test with github.com/go-flutter-desktop/plugins/shared_preferences v0.4.3?
dockercore/golang-cross doesn't support golang 1.13. Pending PR docker/golang-cross#45.
I didn't realized it when I've fixed: #170

@nzlov a temporary fix is to downgrade shared_preferences to v0.4.1. sorry for the inconvenience.


Edit:
here is a plugin list for golang 1.12:
git tag 'image_picker/v0.1.4' && git tag 'url_launcher/v0.1.1' && git tag 'shared_preferences/v0.4.1' && git tag 'path_provider/v0.3.1'

@pchampio pchampio added the bug Something isn't working label Nov 18, 2019
@pchampio
Copy link
Member

Waiting for docker/golang-cross#45

@pchampio
Copy link
Member

pchampio commented Nov 18, 2019

After a bit of search on the docker hub, I've found this container that supports golang 1.13.

If you want to compile everything using golang 1.13, the temporary solution is to edit the go/cross-compiling/Dockerfile file and change the FROM dockercore/golang-cross to FROM goreng/golang-cross:v1.13.1.

Keeping this issue open, I would prefer to use docker/golang-cross as a build container, because the code source is open.
And hover needs to be updated!

@pchampio pchampio added the hover label Nov 18, 2019
@pchampio pchampio changed the title [Plugin] shared_preferences don't cross build build module requires Go 1.13 cross-compiling Nov 18, 2019
@provokateurin
Copy link
Member

Maybe goreng/golang-cross:v1.13.1 should be the default as long as the official golang cross-compiling image is not published.
We require go 1.13 as minimum version, but don't support it on cross-compiling. We should be consistent about that.

@pchampio
Copy link
Member

Ok, @jld3103 you can do the PR/Merge on hover.

@provokateurin
Copy link
Member

@pchampio Can you do it? I need to get some sleep and can only do something again tomorrow evening

@pchampio
Copy link
Member

ok

pchampio added a commit to go-flutter-desktop/hover that referenced this issue Nov 18, 2019
@pchampio
Copy link
Member

@nzlov please update hover: go get -u github.com/go-flutter-desktop/hover, rm go/cross-compiling and rerun your build!

@nzlov
Copy link
Author

nzlov commented Nov 19, 2019

@pchampio @jld3103
Why use goreng/golang-cross: v1.13.1 instead of the dockercore/golang-cross change implementation?

I think your choices are a little too arbitrary.

@pchampio
Copy link
Member

pchampio commented Nov 19, 2019

We use the goreng/golang-cross image because we don't have another choice.
It's the only image that supports golang 1.13.

You aren't affected by this change.
And there is no implementation changes, we only updated the template in hover

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-workarround hover
Development

No branches or pull requests

3 participants