Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Exclude Intel Mac

laurenspriem81329be24d27
diff --git a/infra/ml/README.md b/infra/ml/README.md
index 44e7568239..01d94e5849 100644
--- a/infra/ml/README.md
+++ b/infra/ml/README.md
@@ -17,6 +17,9 @@ Playground notebooks use their own Python project:
- `infra/ml/playground/pyproject.toml`
- `infra/ml/playground/uv.lock`
+ONNX Runtime 1.27 no longer publishes Apple x86_64 binaries. On macOS, the
+parity and playground Python environments therefore require Apple Silicon.
+
Use the directory-specific READMEs for day-to-day work:
- `infra/ml/playground/README.md`
diff --git a/infra/ml/test/run_ml_parity_tests.sh b/infra/ml/test/run_ml_parity_tests.sh
index 258f1f9309..7d439e7c7e 100755
--- a/infra/ml/test/run_ml_parity_tests.sh
+++ b/infra/ml/test/run_ml_parity_tests.sh
@@ -164,6 +164,11 @@ cleanup_resources() {
trap cleanup_resources EXIT
ensure_goldens_python_runtime_deps() {
+ if [[ "$(uname -s)" == "Darwin" && "$(uname -m)" == "x86_64" ]]; then
+ echo "Python golden generation requires Apple Silicon on macOS because ONNX Runtime 1.27 does not publish Intel Mac binaries." >&2
+ return 1
+ fi
+
if ! command -v uv >/dev/null 2>&1; then
echo "Python golden generation requires uv, but uv is unavailable." >&2
return 1
diff --git a/mobile/apps/photos/ios/Podfile.lock b/mobile/apps/photos/ios/Podfile.lock
index 9225961529..1160a925c4 100644
--- a/mobile/apps/photos/ios/Podfile.lock
+++ b/mobile/apps/photos/ios/Podfile.lock
@@ -466,7 +466,7 @@ SPEC CHECKSUMS:
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
cupertino_http: 94ac07f5ff090b8effa6c5e2c47871d48ab7c86c
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
- ente_photos_rust: 361e162c8d0d816ad94d8a80d41e8f8b96324d93
+ ente_photos_rust: 3ba148cb0582699855b6c154aecd41ca604ba1e8
ente_qr: 86beaf5d2644705db9b565b32dd8b82c05fb36af
ente_rust: d0197ebd5460e8f67576579452b073d698404abe
ente_screen_cover: 6792566774f1c83939f9c1d03ed0a1f1ded45ae4
diff --git a/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj b/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj
index 6383532a4b..2cde566701 100644
--- a/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj
+++ b/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj
@@ -1019,6 +1019,7 @@
CUSTOM_GROUP_ID = group.io.ente.frame.ShareExtension;
DEVELOPMENT_TEAM = 6Z68YJY9Q2;
ENABLE_BITCODE = NO;
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "$(inherited) x86_64";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
@@ -1322,6 +1323,7 @@
CUSTOM_GROUP_ID = group.io.ente.frame.ShareExtension;
DEVELOPMENT_TEAM = 6Z68YJY9Q2;
ENABLE_BITCODE = NO;
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "$(inherited) x86_64";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
@@ -1365,6 +1367,7 @@
CUSTOM_GROUP_ID = group.io.ente.frame.ShareExtension;
DEVELOPMENT_TEAM = 6Z68YJY9Q2;
ENABLE_BITCODE = NO;
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "$(inherited) x86_64";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
diff --git a/mobile/apps/photos/rust_builder/ios/ente_photos_rust.podspec b/mobile/apps/photos/rust_builder/ios/ente_photos_rust.podspec
index 4733c97cec..0be03181a4 100644
--- a/mobile/apps/photos/rust_builder/ios/ente_photos_rust.podspec
+++ b/mobile/apps/photos/rust_builder/ios/ente_photos_rust.podspec
@@ -22,8 +22,9 @@ A new Flutter FFI plugin project.
s.dependency 'Flutter'
s.platform = :ios, '11.0'
- # Flutter.framework does not contain a i386 slice.
- s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
+ # Flutter.framework does not contain an i386 slice, and ONNX Runtime 1.27
+ # does not publish an x86_64 iOS Simulator binary.
+ s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 x86_64' }
s.swift_version = '5.0'
s.script_phase = {
@@ -38,8 +39,8 @@ A new Flutter FFI plugin project.
}
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
- # Flutter.framework does not contain a i386 slice.
- 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
+ # ONNX Runtime 1.27 supports only the ARM64 iOS Simulator slice.
+ 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 x86_64',
# Root the primary Flutter Rust Bridge dispatcher so the linker pulls in
# the bridge and its transitive FFI exports without force-loading ONNX
# Runtime's duplicate protobuf objects.
diff --git a/mobile/apps/photos/rust_builder/macos/ente_photos_rust.podspec b/mobile/apps/photos/rust_builder/macos/ente_photos_rust.podspec
index 34209b1b66..c4b336156d 100644
--- a/mobile/apps/photos/rust_builder/macos/ente_photos_rust.podspec
+++ b/mobile/apps/photos/rust_builder/macos/ente_photos_rust.podspec
@@ -22,7 +22,6 @@ A new Flutter FFI plugin project.
s.dependency 'FlutterMacOS'
s.platform = :osx, '10.11'
- s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
s.script_phase = {
@@ -37,8 +36,8 @@ A new Flutter FFI plugin project.
}
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
- # Flutter.framework does not contain a i386 slice.
- 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
+ # ONNX Runtime 1.27 does not publish Apple x86_64 binaries.
+ 'EXCLUDED_ARCHS[sdk=macosx*]' => 'x86_64',
'OTHER_LDFLAGS' => '-force_load ${BUILT_PRODUCTS_DIR}/libente_photos_rust.a -lc++',
}
end
diff --git a/mobile/native/apple/apps/ensu/scripts/build-rust.sh b/mobile/native/apple/apps/ensu/scripts/build-rust.sh
index 0254713384..828cfd3a8d 100755
--- a/mobile/native/apple/apps/ensu/scripts/build-rust.sh
+++ b/mobile/native/apple/apps/ensu/scripts/build-rust.sh
@@ -7,6 +7,15 @@ set -euo pipefail
: "${SRCROOT:?}" "${TARGET_TEMP_DIR:?}" "${PLATFORM_NAME:?}" "${ARCHS:?}"
+if [[ "$PLATFORM_NAME" == "iphonesimulator" ]]; then
+ for arch in $ARCHS; do
+ if [[ "$arch" != "arm64" ]]; then
+ echo "error: ONNX Runtime 1.27 does not support the $arch iOS Simulator; Ensu Simulator builds require arm64." >&2
+ exit 1
+ fi
+ done
+fi
+
REPO_ROOT=$(cd "$SRCROOT/../../../../.." && pwd)
GENERATED_DIR="$SRCROOT/Ensu/Generated"
OUT_DIR="$TARGET_TEMP_DIR/ensu_rust"
@@ -45,7 +54,6 @@ rust_target_for() {
case "$1:$2" in
iphoneos:arm64) echo aarch64-apple-ios ;;
iphonesimulator:arm64) echo aarch64-apple-ios-sim ;;
- iphonesimulator:x86_64) echo x86_64-apple-ios ;;
*) return 1 ;;
esac
}
diff --git a/rust/crates/photos/tests/support/ml_indexing.rs b/rust/crates/photos/tests/support/ml_indexing.rs
index 0a30230bb6..5b693475d6 100644
--- a/rust/crates/photos/tests/support/ml_indexing.rs
+++ b/rust/crates/photos/tests/support/ml_indexing.rs
@@ -626,15 +626,32 @@ fn resolve_onnx_runtime_library(
}
fn onnx_runtime_target_key() -> Result<String> {
- match (std::env::consts::OS, std::env::consts::ARCH) {
+ onnx_runtime_target_key_for(std::env::consts::OS, std::env::consts::ARCH)
+}
+
+fn onnx_runtime_target_key_for(os: &str, arch: &str) -> Result<String> {
+ match (os, arch) {
("linux", "x86_64") => Ok("x86_64-unknown-linux-gnu".to_string()),
("linux", "aarch64") => Ok("aarch64-unknown-linux-gnu".to_string()),
- ("macos", "x86_64") => Ok("x86_64-apple-darwin".to_string()),
+ ("macos", "x86_64") => bail!(
+ "ONNX Runtime 1.27 does not support Apple x86_64; the ML indexing test requires Apple Silicon on macOS"
+ ),
("macos", "aarch64") => Ok("aarch64-apple-darwin".to_string()),
(os, arch) => bail!("unsupported ONNX Runtime target for ML indexing test: {arch}-{os}"),
}
}
+#[cfg(test)]
+mod onnx_runtime_target_key_tests {
+ use super::onnx_runtime_target_key_for;
+
+ #[test]
+ fn rejects_intel_macos() {
+ let error = onnx_runtime_target_key_for("macos", "x86_64").unwrap_err();
+ assert!(error.to_string().contains("requires Apple Silicon"));
+ }
+}
+
fn url_file_name(url: &str) -> Result<String> {
Url::parse(url)
.with_context(|| format!("parse asset URL '{url}'"))?