From ccee658436be3d8bd721bbdda4a02f47235799da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Thu, 2 Dec 2021 07:44:40 +0000 Subject: [PATCH] Fix iOS CI on Intel (for real this time) (#3232) # Objective - iOS CI has linker issues https://github.com/bevyengine/bevy/runs/4388921574?check_suite_focus=true ## Solution - Building for iOS actually requires ~~both iOS SDK for target and~~ macOS SDK for build scripts. ~~I added them both when needed~~ I replaced the iOS SDK with the maOS. This was not an issue on m1 as they are compatible enough to make the build pass. - This completely confused `shader-sys` which fails to build in this configuration. Luckily as the example now uses the new renderer, I was able to remove the old renderer and depend no more on this lib. This is confirmed to work: - on intel mac with simulator - on m1 mac with simulator - on m1 mac with real iphone --- examples/ios/Cargo.toml | 4 ---- examples/ios/build_rust_deps.sh | 11 ++++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/ios/Cargo.toml b/examples/ios/Cargo.toml index 6f9c3e5bdb..4f8796a1b7 100644 --- a/examples/ios/Cargo.toml +++ b/examples/ios/Cargo.toml @@ -15,14 +15,10 @@ bevy = { path = "../../", features = [ "bevy_audio", "bevy_core_pipeline", "bevy_gltf2", - "bevy_wgpu", "bevy_sprite2", "bevy_render2", "bevy_pbr2", "bevy_winit", - "render", - "png", - "hdr", "mp3", "x11", "filesystem_watcher" diff --git a/examples/ios/build_rust_deps.sh b/examples/ios/build_rust_deps.sh index ec39adf372..7714d6c6f8 100755 --- a/examples/ios/build_rust_deps.sh +++ b/examples/ios/build_rust_deps.sh @@ -13,11 +13,12 @@ fi set -euvx -# add path to the system SDK, needed since macOS 11 -if [ -z ${LIBRARY_PATH+x} ]; then - export LIBRARY_PATH="$(xcrun --show-sdk-path)/usr/lib" -else - export LIBRARY_PATH="$LIBRARY_PATH:$(xcrun --show-sdk-path)/usr/lib" +if [[ -n "${DEVELOPER_SDK_DIR:-}" ]]; then + # Assume we're in Xcode, which means we're probably cross-compiling. + # In this case, we need to add an extra library search path for build scripts and proc-macros, + # which run on the host instead of the target. + # (macOS Big Sur does not have linkable libraries in /usr/lib/.) + export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib:${LIBRARY_PATH:-}" fi # add homebrew bin path, as it's the most commonly used package manager on macOS