Cannot build for macOS Catalina on Linux
opened this issue · comments
I get the error LSOpenURLsWithRole() failed with error -10810
at runtime when cross-building from Linux to macOS. The same code works fine when building directly on macOS.
My app does not use any relative paths, and I made sure that Gatekeeper wasn't the problem (I right-click -> open and conirm open, and the same thing happens).
I read the other issues on this repo related to this error but I did not find anything that could solve this.
Here is my bundler.json
:
{
"app_name": "pluralcards",
"icon_path_darwin": "resources/icon.icns",
"icon_path_linux": "resources/icon.png",
"icon_path_windows": "resources/icon.ico",
"environments": [
{"arch": "amd64", "os": "darwin"}
]
}
Repository is here: https://git.sr.ht/~spiral/pluralcards (checkout git commit 1cb8082d6d281964cb53b2f717ff7314e8bdfd3b)
Can you check whether /path/to/file.app/Content/MacOS/pluralcards
has execute
rights ? (if you don't know how, paste output of $ ls -l /path/to/file.app/Content/MacOS/pluralcards
with the correct path)
Yes, it does.
Mmm I'll be honest, I don't have a Linux machine therefore I can't reproduce the problem and I don't really see where this could be coming from 🤔 your best bet would be to make a diff
of all files contained in the .app
folder between the linux
and macos
generated files.
If you want my help for that, you can upload both .app
generated by either linux
or macos
I tried diffing the contents but the only difference is "binary files differ" on the actual executable.
Here are links to the .app
s:
Built on Linux: https://plural.cards/download/alpha1/pluralcards-darwin-alpha1.app.zip
Built on macOS: https://plural.cards/download/alpha2/pluralcards-darwin-alpha2.app.zip
The only thing I can think of is, as you're using CGO and cross-compiling from Linux to Mac, it uses relative path inside the binary. And that's why it fails in MacOS. But that's only an assumption, and I have no solution for you here 😞
That's really weird. I forgot to mention this, and not sure if you noticed this when testing my .app's, but executing the linux-built executable directly works perfectly fine, so I'm assuming this is an issue with the packaging and not the executable itself (though it might be? I don't know anything about macOS executables and .app's and stuff)
Anyway, thanks for trying to look into it. I'll leave the issue open for if I or someone else finds an answer, but I don't mind building the app in a macOS VM, so I'll do that for now :)