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

Cross compilation fails #563

Closed
1 task done
Frankofoedu opened this issue Nov 24, 2020 · 10 comments
Closed
1 task done

Cross compilation fails #563

Frankofoedu opened this issue Nov 24, 2020 · 10 comments

Comments

@Frankofoedu
Copy link

Frankofoedu commented Nov 24, 2020

Description

I am trying to build using the xgo docker image. When I run the build command wails build -x darwin/amd64 without the -verbose flag, the app shows it built successfully. After setting the verbose flag, I noticed a few errors on the last few lines before it finished

go: downloading github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
go: downloading github.com/jinzhu/now v1.1.1
/go/pkg/mod/github.com/wailsapp/[email protected]/runtime/window.go:9:2: golang.org/x/[email protected]: stream error: stream ID 17; INTERNAL_ERROR
/go/pkg/mod/github.com/wailsapp/[email protected]/runtime/window.go:10:2: golang.org/x/[email protected]: stream error: stream ID 17; INTERNAL_ERROR
/go/pkg/mod/github.com/wailsapp/[email protected]/runtime/window.go:11:2: golang.org/x/[email protected]: stream error: stream ID 17; INTERNAL_ERROR
/go/pkg/mod/github.com/wailsapp/[email protected]/runtime/window.go:12:2: golang.org/x/[email protected]: stream error: stream ID 17; INTERNAL_ERROR
/go/pkg/mod/github.com/wailsapp/[email protected]/runtime/window.go:13:2: golang.org/x/[email protected]: stream error: stream ID 17; INTERNAL_ERROR
Cleaning up build environment...
Awesome! Project 'myapp' built!

I have the following packages in my project

    github.com/BurntSushi/xgb v0.0.0-20200324125942-20f126ea2843 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gen2brain/shm v0.0.0-20200228170931-49f9650110c5 // indirect
github.com/kbinani/screenshot v0.0.0-20191211154542-3a185f1ce18f
github.com/leaanthony/mewn v0.10.7
github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 // indirect
github.com/pkg/errors v0.9.1
github.com/robotn/gohook v0.30.3
github.com/wailsapp/wails v1.8.0
gorm.io/driver/sqlite v1.1.3
gorm.io/gorm v1.20.2

The build folder is always empty.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behaviour
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

System Details

Name Value
Wails Version v1.8.0
Go Version go1.15
Platform windows
Arch amd64
GO111MODULE (Not Set)
GCC 9.2.0
Npm 6.14.5
Node v12.18.2

|

Additional context

If I run the same build command for a new wails project, it compiles it successfully to macos version

@leaanthony
Copy link
Member

I'll check on my machine bit stream errors suggest transient connection errors

@Frankofoedu
Copy link
Author

I'll check on my machine bit stream errors suggest transient connection errors

So I changed my internet provider and retried it. The build now shoes a different error

Screenshot 2020-11-25 145755

@Frankofoedu
Copy link
Author

Frankofoedu commented Nov 30, 2020

@leaanthony @tmclane Hello, please can you help with this?

The build keeps exiting at the linker command error. No file is produced in the build directory.

I am on a windows 10 machine cross-compiling to macos

@leaanthony
Copy link
Member

Hi. Sorry for the delay in getting back to you.

This came up before: #410 - Added a question there.

@Frankofoedu
Copy link
Author

Frankofoedu commented Nov 30, 2020

I think i have somehow isolated the problem. So if I have my code structured this way, it will run.

func GetTime() time.Time {
	return time.Now()
}
func main() {

  js := mewn.String("./frontend/dist/app.js")
  css := mewn.String("./frontend/dist/app.css") 

  app := wails.CreateApp(&wails.AppConfig{
    Width:  1024,
    Height: 768,
    Title:  "todo",
    JS:     js,
    CSS:    css,
    Colour: "#131313",
  })

  app.Bind(GetTime)
  app.Run()
}

Once I move the GetTime function to a different file in a different package folder, I get the linker error.

@Frankofoedu
Copy link
Author

I think i have somehow isolated the problem. So if I have my code structured this way, it will run.

func GetTime() time.Time {
	return time.Now()
}
func main() {

  js := mewn.String("./frontend/dist/app.js")
  css := mewn.String("./frontend/dist/app.css") 

  app := wails.CreateApp(&wails.AppConfig{
    Width:  1024,
    Height: 768,
    Title:  "todo",
    JS:     js,
    CSS:    css,
    Colour: "#131313",
  })

  app.Bind(GetTime)
  app.Run()
}

Once I move the GetTime function to a different file in a different package folder, I get the linker error.

I can't reproduce this behaviour in a new repository. I will still investigate further

@Frankofoedu
Copy link
Author

@tmclane @leaanthony Helo, Please can I add you to my repo to help debug the linker issue?

@leaanthony
Copy link
Member

Sure

@leaanthony
Copy link
Member

leaanthony commented Nov 30, 2020

Doing a brief google search, I found this: golang/go#33968
It looks like it's an issue with tools external to Wails so I'm not going to be able to fix this for you.

Edit: This has more info: golang/go#36025 with a potential fix. Try this: CGO_CFLAGS=-mmacosx-version-min=10.12 wails build

@Frankofoedu
Copy link
Author

Doing a brief google search, I found this: golang/go#33968
It looks like it's an issue with tools external to Wails so I'm not going to be able to fix this for you.

Edit: This has more info: golang/go#36025 with a potential fix. Try this: CGO_CFLAGS=-mmacosx-version-min=10.12 wails build

I don't know how to pass that flag into the docker container for cross compiling.

I isolated my problem to a specific package. https://github.com/kbinani/screenshot

It depends on a different package (https://github.com/BurntSushi/xgbutil) that requires some files to build which aren't present in the docker image.

I ended up getting a Mac to compile my project.

Thanks for helping

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

2 participants