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

Failure to Build MacOS Release from Linux on Multiple MacOS SDK Versions #275

Open
JustinTimperio opened this issue Dec 16, 2024 · 9 comments

Comments

@JustinTimperio
Copy link

JustinTimperio commented Dec 16, 2024

Describe the bug:

Hi All,
First off thanks for the great work on Fyne! I'm currently attempting to build a release for MacOS using a github workflow runner by following these steps here. I'm attempting the build on a number of SDK versions and seem to be getting some mostly unreadable errors (for me at least) about building with zig. I've attached the log here in the issue on my repo.

I currently am unsure what to make of the errors as they don't seem to be steming from any go code I have written. It maybe some package that is importing but again the trace in the logs is a little hard to follow.

To Reproduce:

Steps to reproduce the behaviour:

  1. Git Pull OnionSoup
  2. Attempt a build using a command like: fyne-cross darwin -arch=amd64,arm64 -app-id="Onion.Soup" --macosx-sdk-path /home/user/onionsoup/macos-sdk/MacOSX15.2.sdk

Device and debug info

Device info
  • OS: (Ubuntu Desktop - Arch Linux)
  • Version: (24.04.1 - Latest)
  • Go version: go version go1.23.4 linux/amd64
  • fyne-cross version: v1.5.0
  • Fyne version: fyne cli version: v2.4.5
Debug info
Debug Information on this issue can be found here: https://github.com/JustinTimperio/onionsoup/issues/1
@andydotxyz
Copy link
Member

They all seem to relate to visionos macros as far as I can see, out of curiosity have you tried a version that does not bundle visionOS SDK?

@JustinTimperio
Copy link
Author

Hi @andydotxyz, I spent some time today looking at this and was unable to find a version of the sdk that doesn't have visionOS bundled in it. I also tried the most recent version of the sdk directly from the apple website today, and got failures on all the versions packed in the dmg. Let me know if there is anything I can help test.

@andydotxyz
Copy link
Member

andydotxyz commented Dec 31, 2024

From what some others have reported there may be a bug with the compiler we use in The images.
It was been confirmed to work with 11.3, is it possible to grab that from the archives just to eliminate the possibility that something on your machine is different?

Seems to relate to fyne-io/fyne-cross-images#46 and fyne-io/fyne-cross-images#21

@JustinTimperio
Copy link
Author

Hey @andydotxyz, so I have actively been following along with this issue and did some testing preemptively at submission. I've tested this on my personal desktop (Arch) and also a Ubuntu 24.04 VM and I get identical errors on both so im at least fairly confident its not something machine related. I also went ahead and tested versions all the way back to 11.3 and specifically it gives me this error flag provided but not defined: -w on version 1.5.0 which seems to relate to: #266. I just now pulled the latest tag which is 1.6.0 and I do get a sucessful build on SDK 11.3, but get new linking errors if I point to SDK 16.2.

Happy to close this issue out if I should be version locking to 11.3 with fyne-cross 1.6.0

@JustinTimperio
Copy link
Author

Well I need to redact my statement at least in part @andydotxyz. The build works on my desktop which I'll give some info on below but I've tested multiple versions of Ubuntu (20.xx --> 24.xx) and the build fails each time. Really at a loss as I thought this was happeing in a docker container external of the host it was running on but maybe something is linking over? I have a github action with a failing build that may provide some logs for you. https://github.com/JustinTimperio/onionsoup/actions/runs/12563254907/job/35024852235

My desktop:

Arch Linux - 6.12.6
go version go1.23.4 linux/amd64
gcc (GCC) 14.2.1 20240910
c++ (GCC) 14.2.1 20240910
zig 0.13.0

Took a look at the logs and im seeing this:

 In file included from systray_darwin.m:3:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:91:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:87:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h:26:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:56:
In file included from /sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h:28:
In file included from /sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:49:
/sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h:81:49: error: expected ';' after top level declarator
typedef mach_vm_address_t       IOVirtualAddress __kernel_ptr_semantics;
                                                ^
In file included from systray_darwin.m:3:
In file included from /sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:91:
In file included from /sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:87:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h:26:
In file included from /sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:56:
In file included from /sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h:28:
In file included from /sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:52:
/sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:120:53: error: expected ';' after top level declarator
typedef natural_t OSAsyncReference[kOSAsyncRefCount] __kernel_ptr_semantics;

@kpauljoseph
Copy link

I have an error trace similar to yours, and I'm unable to package the app for darwin-amd64/arm64 and linux-arm64.
linux-amd64 and Windows amd64+arm64 work fine.

All these commands work correctly when running fyne-cross locally on a Mac.
macOS runner on GitHub has issues with Docker.
When trying to switch to fyne package, there were other cross-compilation issues for Windows.

Although, in my case I suspect the root cause is CGO dependencies from the go-fitz package. I'm planning to open a discussion about this issue in that repository.

Linux arm64 failure
Mac amd64 failure

@kpauljoseph
Copy link

An update.
Linux arm64 package does not work even locally on mac.

[✓] go.mod found
[i] Packaging app...
# github.com/kpauljoseph/notesankify/cmd/gui
/go/pkg/mod/golang.org/[email protected]/pkg/tool/linux_arm64/link: running zig failed: exit status 1
/usr/local/zig/zig cc -target aarch64-linux-gnu -isystem /usr/include -L/usr/lib/aarch64-linux-gnu -s -o $WORK/b001/exe/a.out -rdynamic /tmp/go-link-3312108629/go.o /tmp/go-link-3312108629/000000.o /tmp/go-link-3312108629/000001.o /tmp/go-link-3312108629/000002.o /tmp/go-link-3312108629/000003.o /tmp/go-link-3312108629/000004.o /tmp/go-link-3312108629/000005.o /tmp/go-link-3312108629/000006.o /tmp/go-link-3312108629/000007.o /tmp/go-link-3312108629/000008.o /tmp/go-link-3312108629/000009.o /tmp/go-link-3312108629/000010.o /tmp/go-link-3312108629/000011.o /tmp/go-link-3312108629/000012.o /tmp/go-link-3312108629/000013.o /tmp/go-link-3312108629/000014.o /tmp/go-link-3312108629/000015.o /tmp/go-link-3312108629/000016.o /tmp/go-link-3312108629/000017.o /tmp/go-link-3312108629/000018.o /tmp/go-link-3312108629/000019.o /tmp/go-link-3312108629/000020.o /tmp/go-link-3312108629/000021.o /tmp/go-link-3312108629/000022.o /tmp/go-link-3312108629/000023.o /tmp/go-link-3312108629/000024.o /tmp/go-link-3312108629/000025.o /tmp/go-link-3312108629/000026.o /tmp/go-link-3312108629/000027.o /tmp/go-link-3312108629/000028.o /tmp/go-link-3312108629/000029.o /tmp/go-link-3312108629/000030.o /tmp/go-link-3312108629/000031.o /tmp/go-link-3312108629/000032.o /tmp/go-link-3312108629/000033.o /tmp/go-link-3312108629/000034.o /tmp/go-link-3312108629/000035.o /tmp/go-link-3312108629/000036.o /tmp/go-link-3312108629/000037.o /tmp/go-link-3312108629/000038.o /tmp/go-link-3312108629/000039.o /tmp/go-link-3312108629/000040.o /tmp/go-link-3312108629/000041.o /tmp/go-link-3312108629/000042.o /tmp/go-link-3312108629/000043.o /tmp/go-link-3312108629/000044.o /tmp/go-link-3312108629/000045.o /tmp/go-link-3312108629/000046.o /tmp/go-link-3312108629/000047.o /tmp/go-link-3312108629/000048.o /tmp/go-link-3312108629/000049.o /tmp/go-link-3312108629/000050.o -O2 -g -O2 -g -L/go/pkg/mod/github.com/gen2brain/[email protected]/libs -lmupdf_linux_arm64 -lmupdfthird_linux_arm64 -lm -O2 -g -lresolv -O2 -g -lGL -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -lm -lXinerama -ldl -lrt -O2 -g -lpthread -O2 -g -O2 -g -lGL
ld.lld: error: undefined symbol: __isoc23_strtol
>>> referenced by hb-number.cc
>>>               hb-number.o:(hb_parse_int(char const**, char const*, int*, bool)) in archive /go/pkg/mod/github.com/gen2brain/[email protected]/libs/libmupdfthird_linux_arm64.a

ld.lld: error: undefined symbol: __isoc23_strtoul
>>> referenced by hb-number.cc
>>>               hb-number.o:(hb_parse_uint(char const**, char const*, unsigned int*, bool, int)) in archive /go/pkg/mod/github.com/gen2brain/[email protected]/libs/libmupdfthird_linux_arm64.a


error building application: exit status 1
[✗] could not package the Fyne app: could not package the Fyne app: exit status 1
make: *** [linux-app] Error 1

@andydotxyz
Copy link
Member

Yes it looks like you're compiling against a native library that is not in the container.

@JustinTimperio
Copy link
Author

It does seem that way. Is that intended behavior? If so, is there any flags or settings I should use that would prevent this?

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