fyne-cross icon indicating copy to clipboard operation
fyne-cross copied to clipboard

Error cross-compiling to windows 386

Open xfengw opened this issue 3 years ago • 13 comments

D:\project\mygosoft\src\riskExcel2021>fyne-cross windows -arch=386 [i] Target: windows/386 [i] Cleaning target directories... [✓] "bin" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\bin\windows-386 [✓] "dist" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\dist\windows-386 [✓] "temp" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\tmp\windows-386 [i] Checking for go.mod: D:\project\mygosoft\src\riskExcel2021\go.mod [✓] go.mod found [i] Building binary... go: fyne.io/fyne/[email protected]: Get "https://proxy.golang.org/fyne.io/fyne/v2/@v/v2.0.3.mod": dial tcp 172.217.24.17:443: connect: connection refused [✗] exit status 1

xfengw avatar May 18 '21 03:05 xfengw

This might be a stupid question, do you have an internet connection?

Jacalz avatar May 18 '21 07:05 Jacalz

yes

xfengw avatar May 18 '21 13:05 xfengw

GOPROXY=https://goproxy.o,direct

xfengw avatar May 18 '21 13:05 xfengw

If you need a proxy it can be specified with the --env flag:

fyne-cross linux --env GOPROXY=<your_proxy>

Note: make sure you're using the latest version v1.1.0 since it fixes an issue (#35) about this

lucor avatar May 18 '21 18:05 lucor

D:\project\mygosoft\src\riskExcel2021>fyne-cross windows -arch=386 --env GOPROXY=https://goproxy.io [i] Target: windows/386 [i] Cleaning target directories... [✓] "bin" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\bin\windows-386 [✓] "dist" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\dist\windows-386 [✓] "temp" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\tmp\windows-386 [i] Checking for go.mod: D:\project\mygosoft\src\riskExcel2021\go.mod [✓] go.mod found [i] Building binary...

riskExcel2021

/usr/local/go/pkg/tool/linux_amd64/link: running i686-w64-mingw32-gcc failed: exit status 1 /tmp/go-link-826086927/000000.o: file not recognized: file format not recognized collect2: error: ld returned 1 exit status

[✗] exit status 2 why?

xfengw avatar May 19 '21 00:05 xfengw

It's hars to say without looking at your code. Anyway one possibility could be a *.syso library in your project that is linked during the linux cross-compilation. Also make sure if you're using third-party libs that they support not Windows OSes.

lucor avatar May 19 '21 07:05 lucor

D:\project\mygosoft\src\riskExcel2021>fyne-cross windows -arch=amd64,386 --env GOPROXY=https://goproxy.io [i] Target: windows/amd64 [i] Cleaning target directories... [✓] "bin" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\bin\windows-amd64 [✓] "dist" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\dist\windows-amd64 [✓] "temp" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\tmp\windows-amd64 [i] Checking for go.mod: D:\project\mygosoft\src\riskExcel2021\go.mod [✓] go.mod found [i] Building binary...

riskExcel2021

/usr/bin/x86_64-w64-mingw32-ld: .rsrc merge failure: duplicate leaf: type: 3 (ICON) name: 1 lang: 409 [✓] Binary: D:\project\mygosoft\src\riskExcel2021\fyne-cross\bin\windows-amd64\riskExcel2021.exe [i] Packaging app... [✓] Package: D:\project\mygosoft\src\riskExcel2021\fyne-cross\dist\windows-amd64\riskExcel2021.exe.zip [i] Target: windows/386 [i] Cleaning target directories... [✓] "bin" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\bin\windows-386 [✓] "dist" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\dist\windows-386 [✓] "temp" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\tmp\windows-386 [i] Checking for go.mod: D:\project\mygosoft\src\riskExcel2021\go.mod [✓] go.mod found [i] Building binary...

riskExcel2021

/usr/local/go/pkg/tool/linux_amd64/link: running i686-w64-mingw32-gcc failed: exit status 1 /tmp/go-link-777420976/000000.o: file not recognized: file format not recognized collect2: error: ld returned 1 exit status

[✗] exit status 2

D:\project\mygosoft\src\riskExcel2021>fyne-cross windows -arch=386 --env GOPROXY=https://goproxy.io [i] Target: windows/386 [i] Cleaning target directories... [✓] "bin" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\bin\windows-386 [✓] "dist" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\dist\windows-386 [✓] "temp" dir cleaned: D:\project\mygosoft\src\riskExcel2021\fyne-cross\tmp\windows-386 [i] Checking for go.mod: D:\project\mygosoft\src\riskExcel2021\go.mod [✓] go.mod found [i] Building binary...

riskExcel2021

/usr/local/go/pkg/tool/linux_amd64/link: running i686-w64-mingw32-gcc failed: exit status 1 /tmp/go-link-864744859/000000.o: file not recognized: file format not recognized collect2: error: ld returned 1 exit status

[✗] exit status 2

@.***

From: Luca Corbo Date: 2021-05-19 02:24 To: fyne-io/fyne-cross CC: xfengw; Author Subject: Re: [fyne-io/fyne-cross] dial tcp 172.217.24.17:443: connect: connection refused (#47) If you need a proxy it can be specified with the --env flag: fyne-cross linux --env GOPROXY=<your_proxy>

Note: make sure you're using the latest version v1.1.0 since it fixes an issue (#35) about this — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

xfengw avatar May 19 '21 08:05 xfengw

Looking at it there seems to be a mix between windows and linux tools being used - don't you think @lucor ? /usr/local/go/pkg/tool/linux_amd64/link: running i686-w64-mingw32-gcc failed: exit status 1 That's linux amd64 linker using the windows 64bit compiler...

andydotxyz avatar May 19 '21 12:05 andydotxyz

I wonder if it's worth removing the fyne_cross folder and starting again after the network troubles earlier?

andydotxyz avatar May 19 '21 12:05 andydotxyz

D:\project\mygosoft\src\testFyne>fyne-cross version fyne-cross version v1.1.0

D:\project\mygosoft\src\testFyne>fyne-cross windows -arch=386 --env GOPROXY=https://goproxy.io,direct [i] Target: windows/386 [i] Cleaning target directories... [✓] "dist" dir cleaned: D:\project\mygosoft\src\testFyne\fyne-cross\dist\windows-386 [✓] "temp" dir cleaned: D:\project\mygosoft\src\testFyne\fyne-cross\tmp\windows-386 [✓] "bin" dir cleaned: D:\project\mygosoft\src\testFyne\fyne-cross\bin\windows-386 [i] Checking for go.mod: D:\project\mygosoft\src\testFyne\go.mod [✓] go.mod found [i] Building binary...

testFyne

/usr/local/go/pkg/tool/linux_amd64/link: running i686-w64-mingw32-gcc failed: exit status 1 /tmp/go-link-263870719/000000.o: file not recognized: file format not recognized collect2: error: ld returned 1 exit status

[✗] exit status 2

@.***

From: Luca Corbo Date: 2021-05-19 02:24 To: fyne-io/fyne-cross CC: xfengw; Author Subject: Re: [fyne-io/fyne-cross] dial tcp 172.217.24.17:443: connect: connection refused (#47) If you need a proxy it can be specified with the --env flag: fyne-cross linux --env GOPROXY=<your_proxy>

Note: make sure you're using the latest version v1.1.0 since it fixes an issue (#35) about this — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

xfengw avatar May 19 '21 12:05 xfengw

Looking at it there seems to be a mix between windows and linux tools being used - don't you think @lucor ? /usr/local/go/pkg/tool/linux_amd64/link: running i686-w64-mingw32-gcc failed: exit status 1 That's linux amd64 linker using the windows 64bit compiler...

It should be the correct one i686 is for cross-compiling targeting 386 arch. The rest of the name is related to the debian package...

I wonder if it's worth removing the fyne_cross folder and starting again after the network troubles earlier?

fyne-cross should remove the temporary dirs at every run. To ensure also the go cache is not used:

fyne-cross windows -arch=386 --env GOPROXY=https://goproxy.io,direct --no-cache

@xfengw can you please confirm that no third-party packages are used in your project ? Additionally, it would be great a link to the repo project or a minimal example (main.go + go.mod) that reproduces the issue.

lucor avatar May 19 '21 12:05 lucor

is ok

xfengw avatar May 20 '21 00:05 xfengw

is ok

Does this mean that the issue is resolved?

andydotxyz avatar May 24 '21 09:05 andydotxyz

GOPROXY=https://goproxy.o,direct

GOPROXY=https://goproxy.cn,direct

junmaqiang avatar Feb 03 '23 03:02 junmaqiang