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

Darwin compilation issue with Xcode 15.3 or 14.3.1 #266

Open
Jextter opened this issue Aug 3, 2024 · 11 comments
Open

Darwin compilation issue with Xcode 15.3 or 14.3.1 #266

Jextter opened this issue Aug 3, 2024 · 11 comments

Comments

@Jextter
Copy link

Jextter commented Aug 3, 2024

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
  • OS: OpenSuse Tumbleweed (updated)
  • Version: Latest version of Tumbleweed
  • Go version: go version go1.22.5 linux/amd64
  • fyne-cross version: v1.5.0 plus custom build from master
  • Fyne version: 2.5.0
Debug info
See attached logs
[15.3-13.3.sdk.log](https://github.com/user-attachments/files/16482664/15.3-13.3.sdk.log) [15.3-14.4.sdk.log](https://github.com/user-attachments/files/16482665/15.3-14.4.sdk.log) [14.3.1-12.3.sdk.log](https://github.com/user-attachments/files/16482666/14.3.1-12.3.sdk.log) [14.3.1-13.3.sdk.log](https://github.com/user-attachments/files/16482667/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
Copy link
Member

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
Copy link
Author

Jextter commented Aug 6, 2024 via email

@Jextter
Copy link
Author

Jextter commented Aug 7, 2024

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

Here are some notes:

  • during the extraction process, I noticed that there was an new image being downloaded. So to be thorough, I ran a "docker system prune -a --volumes -f" to force clean everything and start over.
  • I then extracted the sdks from these packages:
    Command_Line_Tools_for_Xcode_12.5.dmg
    Command_Line_Tools_for_Xcode_13.2.dmg
    Command_Line_Tools_for_Xcode_13.4.dmg
    Command_Line_Tools_for_Xcode_14.3.1.dmg
    Command_Line_Tools_for_Xcode_15.3.dmg
    Command_Line_Tools_for_Xcode_16_beta_5.dmg
  • I then proceeded to try each and every SDK in these packages after extraction, using these commands:
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-12.5/MacOSX10.15.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 12.5-10.15.sdk.log 2>&1
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-12.5/MacOSX11.3.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 12.5-11.3.sdk.log 2>&1
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-13.2/MacOSX11.3.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 13.2-11.3.sdk.log 2>&1
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-13.2/MacOSX12.1.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 13.2-12.1.sdk.log 2>&1
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-13.4/MacOSX11.3.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 13.4-11.3.sdk.log 2>&1
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-13.4/MacOSX12.3.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 13.4-12.3.sdk.log 2>&1
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-14.3.1/MacOSX12.3.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 14.3.1-12.3.sdk.log 2>&1
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-14.3.1/MacOSX13.3.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 14.3.1-13.3.sdk.log 2>&1
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-16_beta_5/MacOSX14.5.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 16_beta_5-14.5.sdk.log 2>&1
    fyne-cross darwin --debug -arch amd64 --macosx-sdk-path ./resources/AppleXcode/SDKs-16_beta_5/MacOSX15.0.sdk/ -app-id cvs.report.pdf -output build ./cmd/csvtopdf > 16_beta_5-15.0.sdk.log 2>&1

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
Copy link
Author

Jextter commented Aug 7, 2024

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
Copy link
Member

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
Copy link
Member

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
Copy link
Author

Jextter commented Aug 8, 2024

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
Copy link
Author

Jextter commented Aug 8, 2024

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

@Jextter
Copy link
Author

Jextter commented Aug 10, 2024

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
Copy link
Member

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
Copy link

Could this be related to #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.

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

3 participants