Shellscript compiled on macOS 10.15 does not work on 10.14 although the -r option was used
tofi86 opened this issue · comments
Hi,
first, let me thank you for this wonderful project!
I'm using it to compile a Shellscript as a binary launcher script for a Mac app. I tested on macOS 10.14 and the compiled script worked well on macOS 10.15 when I used the shc -r
commandline option.
Next I tried it the other way round: I built on macOS 10.15 but then I wasn't able to use it on macOS 10.14 – although the -r option was used.
macOS is displaying a system dialog (sorry, german) that tells that the programm requires macOS 10.15 to run.
Is there anything I can do about it? Anythin you could fix on your side?
Thanks!
Best regards,
Tobias
you have to compile on lower versions always if you care about compatibility. compiled binaries depend on some system dynamic libs which are different in different versions. Later versions can backword support the older versions, but older versions can never forward support future unknown versions. Thus, when you compile with the latest version of something, it will be an unknown entity to the older version (this theory does not apply everywhere though).
Thanks for your quick answer!
I was kinda expecting this, but maybe there would have been a way... 🤷♂️
I guess I have to find a new solution to my issues because GitHub Actions CI is only offering macOS 10.15 as a build platform...
@tofi86 Not sure why the kind folks here were unable to help you. There is actually an easy solution for this. Prepend your shc
command with CC="clang -mmacosx-version-min=10.10"
- to inform the compiler to make the executable compatible with macos 10.10... or whatever your min macos target might be. Your command ultimately would be CC="clang -mmacosx-version-min=10.10" shc -r -f universalJavaApplicationStub