fyne-io / fyne-cross

Cross compiler tool for Fyne apps
BSD 3-Clause "New" or "Revised" License
237 stars 48 forks source link

fyne cross build fails with latest version v1.4.0 #185

Closed pkk-code closed 1 year ago

pkk-code commented 1 year ago

Describe the bug:

fyne cross build fails with latest version v1.4.0 where as the same works on v1.3.0 release

To Reproduce:

Steps to reproduce the behaviour: go install github.com/fyne-io/fyne-cross@latest fyne-cross windows ..build app command

Device and debug info (please complete the following information):

Device info
Debug info

[i] Target: windows/amd64
[i] Cleaning target directories...
[✓] "bin" dir cleaned: /app/fyne-cross/bin/windows-amd64
[✓] "dist" dir cleaned: /app/fyne-cross/dist/windows-amd64
[✓] "temp" dir cleaned: /app/fyne-cross/tmp/windows-amd64
[i] Checking for go.mod: C:\apps\gui\go.mod
[✓] go.mod found
[i] Packaging app...
/usr/local/go/pkg/tool/linux_amd64/link: running zig failed: exit status 1
lld-link: error: duplicate resource: type ICON (ID 3)/name ID 3/language 1033, in /tmp/go-link-4066145781/000000.o and in /tmp/go-link-4066145781/000001.o
lld-link: error: duplicate resource: type MANIFEST (ID 24)/name ID 1/language 1033, in /tmp/go-link-4066145781/000000.o and in /tmp/go-link-4066145781/000001.o

failed to rebuild after adding metadata: exit status 2
Jacalz commented 1 year ago

Can you please share an error log? There is not enough information available to reproduce as far as I can see. EDIT: Never mind. Sorry for the fuss. I didn't see it as it was hidden away under the debug info.

Jacalz commented 1 year ago

Do you get the same error if you build for Linux instead of Windows? I can not replicate this locally. Do you get the same error if you are compiling a simple Fyne application (like https://github.com/fyne-io/fyne/tree/master/cmd/hello)?

Bluebugs commented 1 year ago

Is there anything in your program named MANIFEST or ICON?

pkk-code commented 1 year ago

This is the error i get for building Linux on windows fyne-cross linux -app-id "app 1.0.1" ./src/main [i] Target: linux/amd64 [i] Cleaning target directories... Unable to find image 'fyneio/fyne-cross-images:linux' locally linux: Pulling from fyneio/fyne-cross-images f1f26f570256: Already exists ac8bff897005: Already exists d3bf6660b440: Already exists e5dc830a6e83: Already exists 4f4fb700ef54: Already exists 0de09f7a5fdc: Already exists 180ea05fc1e8: Already exists 023cf6ee2dc5: Already exists e70852a853bc: Already exists 5c3fbd07c8a9: Already exists 2ca97eabffd0: Pull complete Digest: sha256:12a940979499d6865d4addeaee1bcdcd7ef01670aea46b6b9e3ea2939f8f162b Status: Downloaded newer image for fyneio/fyne-cross-images:linux [✓] "bin" dir cleaned: /app/fyne-cross/bin/linux-amd64 [✓] "dist" dir cleaned: /app/fyne-cross/dist/linux-amd64 [✓] "temp" dir cleaned: /app/fyne-cross/tmp/linux-amd64 [i] Checking for go.mod: C:\dev\apps\gui\go.mod [✓] go.mod found [i] Packaging app... go: downloading github.com/godbus/dbus/v5 v5.1.0

dev/apps/gui/src/main

/usr/local/go/pkg/tool/linux_amd64/link: running zig failed: exit status 1 ld.lld: error: /tmp/go-link-2917912233/000000.o: unknown file type

error building application: exit status 2 [✗] could not package the Fyne app: could not package the Fyne app: exit status 1

Bluebugs commented 1 year ago

Does it have the same behavior with for example fyne calculator: https://github.com/fyne-io/calculator ?

pkk-code commented 1 year ago

Calculator worked fine.

fyne-cross windows -app-id "calc 1.0.1" . [i] Target: windows/amd64 [i] Cleaning target directories... [✓] "dist" dir cleaned: /app/fyne-cross/dist/windows-amd64 [✓] "temp" dir cleaned: /app/fyne-cross/tmp/windows-amd64 [✓] "bin" dir cleaned: /app/fyne-cross/bin/windows-amd64 [i] Checking for go.mod: C:\dev\github\calculator\go.mod [✓] go.mod found [i] Packaging app... adding: Calculator.exe (deflated 58%) [✓] Package: "C:\dev\github\calculator\fyne-cross\dist\windows-amd64\Calculator.exe.zip"

andydotxyz commented 1 year ago

Do you by any chance have some pre-compiled or platform specific object files in your repository?

pkk-code commented 1 year ago

Yes. I do have rsrc.syso in my repository.

After removing that file fyne cross builds correctly.

Bluebugs commented 1 year ago

Oh, that is an unexpected file. That totally explain the error. Was there a reason for this file?

squash commented 1 year ago

I have seen .syso files appear during interrupted Windows target builds and they do break other compilations until they're removed.

andydotxyz commented 1 year ago

We do auto-generate some during the build - required for windows builds as we package. Any local .syso file will probably break things as they are platform/architecture specific.