Open strowk opened 5 months ago
Is there a fix for this, because no combinations of sdks for the apple targets work for me right now.
@Knniff
For myself, I did a "hacky" workaround here - https://github.com/strowk/tisq/commit/afacd74aecd639ca4790950352c4e41b008fcf7f
Basically I have "cross" folder with cloned cross, which has a problematic file under this subpath: "docker/cross-toolchains/docker/darwin.sh". I override this file with that one - https://github.com/strowk/tisq/blob/afacd74aecd639ca4790950352c4e41b008fcf7f/patched-darwin.sh#L52 before building (it is wired in using cargo-make, I was too lazy for xargo or other fancy ways).
The only difference is in line 52 there
TARGET_DIR=/opt/osxcross UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh
is replaced by
TARGET_DIR=/opt/osxcross UNATTENDED=yes OSX_VERSION_MIN=10.12 ./build.sh # this line is changed 10.7 to 10.12
Result of this is successful build, though obviously the binary would not work anymore for MacOS < 10.12 (which is not officially supported by Apple themselves anyway).
I suppose alternative to this could be pinning Rust toolchain to something before 1.74 , if old versions of OS are more important for you than new versions of language.
Thank you for your explanation. Which version of the SDK are you using? I tried a few but all came out with some kind of linker error.
See https://blog.rust-lang.org/2023/09/25/Increasing-Apple-Version-Requirements.html
This: https://github.com/cross-rs/cross-toolchains/blob/83b28663ebf6b38436e534652a2522a6963fa132/docker/darwin.sh#L52 needs to be upped to 10.12 in at least some targets, otherwise error looking like this:
would be happening (this is from build for x86_64).
Simply upping the value to 10.12 would be more strict than what Rust seems to require now though. There was no issue for me on aarch64-apple-darwin, and that is in alignment with blog post linked above, as that target is not mentioned as affected by change (aarch64-apple-ios is mentioned, but not darwin).