fyne-io / fyne-cross

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

Darwin compilation issue with Xcode 15.3 or 14.3.1 #266

Open Jextter opened 1 month ago

Jextter commented 1 month ago

Submitted per conversation with andy.xyz on discord

Describe the bug:

When trying to compile an application for the Darwin platform, there is a compilation error with Xcode. Versions of Xcode tried: 14.3.1 • 12.3 • 13.3 15.3 • 13.3 • 14.4

To Reproduce:

Steps to reproduce the behavior:

  1. Create a sample application file
  2. Commands run to try various Xcode versions:

fyne-cross darwin --debug --no-cache -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-14.3.1/MacOSX12.3.sdk/ -app-id hello.app -output build ./cmd/testapp/ > 14.3.1-12.3.sdk.log 2>&1

fyne-cross darwin --debug --no-cache -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-14.3.1/MacOSX13.3.sdk/ -app-id hello.app -output build ./cmd/testapp/ > 14.3.1-13.3.sdk.log 2>&1

fyne-cross darwin --debug --no-cache -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-15.3/MacOSX13.3.sdk/ -app-id hello.app -output build ./cmd/testapp/ > 15.3-13.3.sdk.log 2>&1

fyne-cross darwin --debug --no-cache -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-15.3/MacOSX14.4.sdk/ -app-id hello.app -output build ./cmd/testapp/ > 15.3-14.4.sdk.log 2>&1

  1. See the error in attached log files

Example code:

Sample app:
package main

import (
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/container"
    "fyne.io/fyne/v2/widget"
)

func main() {
    myApp := app.New()
    myWindow := myApp.NewWindow("Hello Fyne")

    myWindow.SetContent(container.NewVBox(
        widget.NewLabel("Hello Fyne!"),
        widget.NewButton("Quit", func() {
            myApp.Quit()
        }),
    ))

    myWindow.ShowAndRun()
}

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

Device info
Debug info
See attached logs

15.3-13.3.sdk.log 15.3-14.4.sdk.log 14.3.1-12.3.sdk.log 14.3.1-13.3.sdk.log

Hopefully, this is just a mistake on my part, but I can't seem to figure out what the issue is. If you could point me in the right direction, I would very much appreciate it.

andydotxyz commented 1 month ago

This is strange, it seems to be failing to compile in the SDK code not ours... SDK 15 has caused trouble elsewhere but 14 should have worked. Can you try the latest version of 12 as well? That was heavily used for a long time and is known to work. Just trying to eliminate possible issues at your end...

Jextter commented 1 month ago

Ok , I will give that a try. It will be a couple of days before I can get to it though.

From: Andy Williams @.> Sent: Tuesday, August 6, 2024 11:06 AM To: fyne-io/fyne-cross @.> Cc: Jextter @.>; Author @.> Subject: Re: [fyne-io/fyne-cross] Darwin compilation issue with Xcode 15.3 or 14.3.1 (Issue #266)

This is strange, it seems to be failing to compile in the SDK code not ours... SDK 15 has caused trouble elsewhere but 14 should have worked. Can you try the latest version of 12 as well? That was heavily used for a long time and is known to work. Just trying to eliminate possible issues at your end...

— Reply to this email directly, view it on GitHub https://github.com/fyne-io/fyne-cross/issues/266#issuecomment-2270769890 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHDXTIAUYG6HYN3ILMTFZCLZQCGXDAVCNFSM6AAAAABL6FGESKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZQG43DSOBZGA . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AHDXTIC3OKJBLX5OZPNI3XTZQCGXDA5CNFSM6AAAAABL6FGESKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUHLEZOE.gif Message ID: @. @.> >

Jextter commented 1 month ago

I downloaded version twelve and tried it also. It also fails.

Here are some notes:

Oddly, there is a different issue. It seems that there are only warning in the compilation of the code but there is a link option being used that is not recognized:

 /go/pkg/mod/fyne.io/fyne/v2@v2.5.0/app
 $WORK/b258
 /usr/local/zig/lib/include
 /usr/local/zig/lib/libc/include/x86_64-macos.10-gnu
 /usr/local/zig/lib/libc/include/any-macos-any
 /sdk/usr/include
 /sdk/System/Library/Frameworks (framework directory)
End of search list.
# CSVToPDFReports/cmd/csvtopdf
flag provided but not defined: -w"
usage: link [options] main.o
  -B note
        add an ELF NT_GNU_BUILD_ID note when using ELF; use "gobuildid" to generate it from the Go build ID
  -E entry
        set entry symbol name

I have attached new logs for review: 16_beta_5-15.0.sdk.log 12.5-10.15.sdk.log 12.5-11.3.sdk.log 13.2-11.3.sdk.log 13.2-12.1.sdk.log 13.4-11.3.sdk.log 13.4-12.3.sdk.log 14.3.1-12.3.sdk.log 14.3.1-13.3.sdk.log 16_beta_5-14.5.sdk.log 16_beta_5-15.0.sdk.log

is there some other link command executable I need to hunt down?

Jextter commented 1 month ago

Also:

jextter@localhost:~/Desktop/Workspace/Jextter/CSVToPDFReports> link --version link (GNU coreutils) 9.5 Copyright (C) 2024 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Written by Michael Stone.

andydotxyz commented 1 month ago

Also:

jextter@localhost:~/Desktop/Workspace/Jextter/CSVToPDFReports> link --version link (GNU coreutils) 9.5 Copyright (C) 2024 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Written by Michael Stone.

Please don't get confused with local tools - fyne-cross uses completely container-based compilation so your developer setup won't matter.

andydotxyz commented 1 month ago

I can't see where the error is coming from or what the problem is, hopefully @lucor, @Jacalz or @Bluebugs will have some idea. It is incredibly strange that you are getting similar errors across a large range of different versions and that one we know works also isn't functioning for you. I guess it is possible that there is a bug on master - did you try with the 1.5.0 release not master?

Jextter commented 1 month ago

Yes, you are right; I wasn't thinking clearly about that. I don't usually do my development or compilation in a docker container, so it was just a knee-jerk thing to get that while trying to be thorough.

Jextter commented 1 month ago

I had not tried the 1.5.0 release again. I will try that and let you know.

Jextter commented 1 month ago

Hello All! I am pleased to report progress. It does successfully compile with a fresh build from master on some of the Xcode SDKs. It seems that 10.15 -> 12.3 compile just fine. Then at 13.3, something is definitely not happy in the Xcode SDK. I have attached the updated logs for your review. Thank you guys for getting this fixed so quickly! Let me know if there is more I can do to help you guys.

Same commands as before: 13.4-12.3.sdk.log 14.3.1-12.3.sdk.log 14.3.1-13.3.sdk.log 16_beta_5-14.5.sdk.log 16_beta_5-15.0.sdk.log 12.5-10.15.sdk.log 12.5-11.3.sdk.log 13.2-11.3.sdk.log 13.2-12.1.sdk.log 13.4-11.3.sdk.log

I am not sure if you guys would like me to close this or not or have this as an open ticket to come back to on the newer SDKs. In some searches I did, the compilation issue appears to correlate to the same time they eliminated 32-bit support and added new support for IOS15. I suspect they changed up the tooling quite a bit. But, not being an Apple person, I just don't know the actual details.

Anyway, Thanks!

andydotxyz commented 3 weeks ago

As far as I'm aware the Fyne toolkit itself works great with these more recent versions, so perhaps there is an issue with the image or fyne-cross initialisation and the SDKs? Possibly it relates even to the way we are extracting the data to create a viable image?

Any thoughts @lucor or @Bluebugs ?

eschricker commented 3 weeks ago

Could this be related to https://github.com/fyne-io/fyne-cross/pull/246

The error message contains the parameter -w which was removed in the upper pr:

# CSVToPDFReports/cmd/csvtopdf
flag provided but not defined: -w"

The pr is merged, but no new version has been released, yet.