π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Move photos crate under rust crates
Manav Rathi3be48b2a3377
diff --git a/.github/workflows/mobile-lint.yml b/.github/workflows/mobile-lint.ymlindex 9418887468..370cce0293 100644--- a/.github/workflows/mobile-lint.yml+++ b/.github/workflows/mobile-lint.yml@@ -6,7 +6,7 @@ on:pull_request:paths:- "mobile/apps/photos/**"- - "rust/photos/**"+ - "rust/crates/photos/**"- "rust/crates/core/**"- "rust/crates/contacts/**"- "rust/crates/image/**"@@ -52,7 +52,7 @@ jobs:esaccase "$file" in- .github/workflows/mobile-lint.yml|mobile/apps/photos/rust_builder/*|rust/bindings/frb/photos/*|rust/photos/*|rust/crates/image/*|rust/apps/codegen/*|rust/Cargo.lock|rust/Cargo.toml)+ .github/workflows/mobile-lint.yml|mobile/apps/photos/rust_builder/*|rust/bindings/frb/photos/*|rust/crates/photos/*|rust/crates/image/*|rust/apps/codegen/*|rust/Cargo.lock|rust/Cargo.toml)ente_photos_rust=true;;esacdiff --git a/.github/workflows/mobile-packages-lint.yml b/.github/workflows/mobile-packages-lint.ymlindex ad32eafa03..2277f3c4b7 100644--- a/.github/workflows/mobile-packages-lint.yml+++ b/.github/workflows/mobile-packages-lint.yml@@ -7,7 +7,7 @@ on:- "mobile/packages/**"- "mobile/**/pubspec*.yaml"- "mobile/**/pubspec.lock"- - "rust/photos/**"+ - "rust/crates/photos/**"- "rust/bindings/frb/**"- "rust/apps/codegen/**"- "rust/Cargo.lock"@@ -54,7 +54,7 @@ jobs:- 'rust/apps/codegen/**'- 'rust/Cargo.lock'- 'rust/Cargo.toml'- - 'rust/photos/**'+ - 'rust/crates/photos/**'- 'rust/crates/core/**/*.rs'- 'rust/crates/contacts/**/*.rs'workflow:diff --git a/.github/workflows/rust-lint.yml b/.github/workflows/rust-lint.ymlindex 4ab1c8f8f4..a5213620f5 100644--- a/.github/workflows/rust-lint.yml+++ b/.github/workflows/rust-lint.yml@@ -10,7 +10,7 @@ on:- "rust/crates/contacts/**"- "rust/crates/image/**"- "rust/bindings/wasm/ente-wasm/**"- - "rust/photos/**"+ - "rust/crates/photos/**"- "rust/Cargo.lock"- "rust/Cargo.toml"- ".github/workflows/rust-lint.yml"diff --git a/rust/Cargo.toml b/rust/Cargo.tomlindex 00f32bdb81..2f5404d23a 100644--- a/rust/Cargo.toml+++ b/rust/Cargo.toml@@ -21,6 +21,6 @@ members = ["crates/ensu/sync","crates/ensu/transcription","crates/image",+ "crates/photos","e2e",- "photos",]diff --git a/rust/README.md b/rust/README.mdindex 5a32b80d0b..b8401a5d0b 100644--- a/rust/README.md+++ b/rust/README.md@@ -35,14 +35,14 @@β (ente_photos_rust crate) ββ ββ Thin app-specific #[frb] β-β wrappers for rust/photos β+β wrappers for crates/photos ββββββββββββββββββββββββββββββ```## Contents (this repo)- `rust/crates/core/` (`ente-core`) - shared, pure Rust code used by clients (crypto + auth, plus small HTTP/URL helpers).-- `rust/photos/` (`ente_photos`) - shared Photos Rust logic (motion photo, ML, image processing, vector DB).+- `rust/crates/photos/` (`ente_photos`) - shared Photos Rust logic (motion photo, ML, image processing, vector DB).- `rust/apps/cli/` (`ente-rs`) - Rust CLI.- `rust/bindings/frb/ente-rust/` (`ente_rust`) - shared Flutter Rust Bridge bindings for mobile.- `rust/bindings/frb/photos/` (`ente_photos_rust`) - Photos app-specific Flutter Rust Bridge bindings.@@ -69,7 +69,8 @@ rust/β βββ contacts/ # Shared contacts logicβ βββ core/ # Pure Rust shared logic (ente-core)β βββ ensu/ # LLM chat stack-β βββ image/ # Shared image crate+β βββ image/ # Shared image crate+β βββ photos/ # Shared Photos Rust logicββββ e2e/ # Rust e2e tests requiring live Museumβ βββ src/@@ -77,14 +78,6 @@ rust/β βββ tests/β βββ Cargo.tomlβ-βββ photos/ # Shared Photos Rust logic-β βββ src/-β β βββ lib.rs-β β βββ image/-β β βββ ml/-β β βββ vector_db.rs-β βββ Cargo.toml-ββββ Cargo.toml # Rust workspace manifestrust/bindings/uniffi/ # UniFFI bindings for core crypto/auth + ensu@@ -98,7 +91,7 @@ rust/bindings/frb/ # Flutter Rust Bridge binding cratesβ βββ Cargo.toml # crate name: ente_rustβββ photos/βββ src/- β βββ api/ # #[frb] thin wrappers over rust/photos+ β βββ api/ # #[frb] thin wrappers over rust/crates/photosβββ Cargo.toml # crate name: ente_photos_rustrust/bindings/wasm/ente-wasm/ # WASM bindings Rust crate@@ -151,7 +144,7 @@ wasm-pack is installed via npm as a devDependency, so `yarn install` handles it.Used for Flutter integration. FRB is used on two crates:- **`ente_rust`** (`rust/bindings/frb/ente-rust/`) - Shared wrappers around `ente-core`, used by multiple mobile apps (Photos, Auth, etc.)-- **`ente_photos_rust`** (`rust/bindings/frb/photos/`) - Thin Photos-specific wrappers around `rust/photos`+- **`ente_photos_rust`** (`rust/bindings/frb/photos/`) - Thin Photos-specific wrappers around `rust/crates/photos`Both depend on `ente-core` and use `#[frb]` annotations to generate Dart bindings.diff --git a/rust/bindings/frb/photos/Cargo.toml b/rust/bindings/frb/photos/Cargo.tomlindex 7da7191869..6fac7d5433 100644--- a/rust/bindings/frb/photos/Cargo.toml+++ b/rust/bindings/frb/photos/Cargo.toml@@ -8,7 +8,7 @@ crate-type = ["cdylib", "staticlib"][dependencies]flutter_rust_bridge = "=2.12.0"-ente_photos = { path = "../../../photos" }+ente_photos = { path = "../../../crates/photos" }ente_image = { path = "../../../crates/image" }[lints.rust]diff --git a/rust/photos/Cargo.toml b/rust/crates/photos/Cargo.tomlsimilarity index 97%rename from rust/photos/Cargo.tomlrename to rust/crates/photos/Cargo.tomlindex 2f67e06b36..7241a6ddc5 100644--- a/rust/photos/Cargo.toml+++ b/rust/crates/photos/Cargo.toml@@ -4,7 +4,7 @@ version = "0.1.0"edition = "2024"[dependencies]-ente_image = { path = "../crates/image" }+ente_image = { path = "../image" }quick-xml = "0.37"# The FRB photos bridge calls the SimSIMD symbol exported by usearch 2.21.x.# Newer usearch releases switched that implementation to numkong symbols.diff --git a/rust/photos/src/lib.rs b/rust/crates/photos/src/lib.rssimilarity index 100%rename from rust/photos/src/lib.rsrename to rust/crates/photos/src/lib.rsdiff --git a/rust/photos/src/ml/clip/image.rs b/rust/crates/photos/src/ml/clip/image.rssimilarity index 100%rename from rust/photos/src/ml/clip/image.rsrename to rust/crates/photos/src/ml/clip/image.rsdiff --git a/rust/photos/src/ml/clip/mod.rs b/rust/crates/photos/src/ml/clip/mod.rssimilarity index 100%rename from rust/photos/src/ml/clip/mod.rsrename to rust/crates/photos/src/ml/clip/mod.rsdiff --git a/rust/photos/src/ml/clip/text.rs b/rust/crates/photos/src/ml/clip/text.rssimilarity index 100%rename from rust/photos/src/ml/clip/text.rsrename to rust/crates/photos/src/ml/clip/text.rsdiff --git a/rust/photos/src/ml/clip/tokenizer.rs b/rust/crates/photos/src/ml/clip/tokenizer.rssimilarity index 100%rename from rust/photos/src/ml/clip/tokenizer.rsrename to rust/crates/photos/src/ml/clip/tokenizer.rsdiff --git a/rust/photos/src/ml/error.rs b/rust/crates/photos/src/ml/error.rssimilarity index 100%rename from rust/photos/src/ml/error.rsrename to rust/crates/photos/src/ml/error.rsdiff --git a/rust/photos/src/ml/face/align.rs b/rust/crates/photos/src/ml/face/align.rssimilarity index 100%rename from rust/photos/src/ml/face/align.rsrename to rust/crates/photos/src/ml/face/align.rsdiff --git a/rust/photos/src/ml/face/detect.rs b/rust/crates/photos/src/ml/face/detect.rssimilarity index 100%rename from rust/photos/src/ml/face/detect.rsrename to rust/crates/photos/src/ml/face/detect.rsdiff --git a/rust/photos/src/ml/face/embed.rs b/rust/crates/photos/src/ml/face/embed.rssimilarity index 100%rename from rust/photos/src/ml/face/embed.rsrename to rust/crates/photos/src/ml/face/embed.rsdiff --git a/rust/photos/src/ml/face/mod.rs b/rust/crates/photos/src/ml/face/mod.rssimilarity index 100%rename from rust/photos/src/ml/face/mod.rsrename to rust/crates/photos/src/ml/face/mod.rsdiff --git a/rust/photos/src/ml/face/thumbnail.rs b/rust/crates/photos/src/ml/face/thumbnail.rssimilarity index 100%rename from rust/photos/src/ml/face/thumbnail.rsrename to rust/crates/photos/src/ml/face/thumbnail.rsdiff --git a/rust/photos/src/ml/indexing.rs b/rust/crates/photos/src/ml/indexing.rssimilarity index 100%rename from rust/photos/src/ml/indexing.rsrename to rust/crates/photos/src/ml/indexing.rsdiff --git a/rust/photos/src/ml/mod.rs b/rust/crates/photos/src/ml/mod.rssimilarity index 100%rename from rust/photos/src/ml/mod.rsrename to rust/crates/photos/src/ml/mod.rsdiff --git a/rust/photos/src/ml/onnx.rs b/rust/crates/photos/src/ml/onnx.rssimilarity index 100%rename from rust/photos/src/ml/onnx.rsrename to rust/crates/photos/src/ml/onnx.rsdiff --git a/rust/photos/src/ml/pet/align.rs b/rust/crates/photos/src/ml/pet/align.rssimilarity index 100%rename from rust/photos/src/ml/pet/align.rsrename to rust/crates/photos/src/ml/pet/align.rsdiff --git a/rust/photos/src/ml/pet/detect.rs b/rust/crates/photos/src/ml/pet/detect.rssimilarity index 100%rename from rust/photos/src/ml/pet/detect.rsrename to rust/crates/photos/src/ml/pet/detect.rsdiff --git a/rust/photos/src/ml/pet/embed.rs b/rust/crates/photos/src/ml/pet/embed.rssimilarity index 100%rename from rust/photos/src/ml/pet/embed.rsrename to rust/crates/photos/src/ml/pet/embed.rsdiff --git a/rust/photos/src/ml/pet/mod.rs b/rust/crates/photos/src/ml/pet/mod.rssimilarity index 100%rename from rust/photos/src/ml/pet/mod.rsrename to rust/crates/photos/src/ml/pet/mod.rsdiff --git a/rust/photos/src/ml/pet/preprocess.rs b/rust/crates/photos/src/ml/pet/preprocess.rssimilarity index 100%rename from rust/photos/src/ml/pet/preprocess.rsrename to rust/crates/photos/src/ml/pet/preprocess.rsdiff --git a/rust/photos/src/ml/preprocess.rs b/rust/crates/photos/src/ml/preprocess.rssimilarity index 100%rename from rust/photos/src/ml/preprocess.rsrename to rust/crates/photos/src/ml/preprocess.rsdiff --git a/rust/photos/src/ml/runtime.rs b/rust/crates/photos/src/ml/runtime.rssimilarity index 100%rename from rust/photos/src/ml/runtime.rsrename to rust/crates/photos/src/ml/runtime.rsdiff --git a/rust/photos/src/ml/types.rs b/rust/crates/photos/src/ml/types.rssimilarity index 100%rename from rust/photos/src/ml/types.rsrename to rust/crates/photos/src/ml/types.rsdiff --git a/rust/photos/src/ml/vector_db.rs b/rust/crates/photos/src/ml/vector_db.rssimilarity index 100%rename from rust/photos/src/ml/vector_db.rsrename to rust/crates/photos/src/ml/vector_db.rsdiff --git a/rust/photos/src/motion_photo/ftyp.rs b/rust/crates/photos/src/motion_photo/ftyp.rssimilarity index 100%rename from rust/photos/src/motion_photo/ftyp.rsrename to rust/crates/photos/src/motion_photo/ftyp.rsdiff --git a/rust/photos/src/motion_photo/mod.rs b/rust/crates/photos/src/motion_photo/mod.rssimilarity index 100%rename from rust/photos/src/motion_photo/mod.rsrename to rust/crates/photos/src/motion_photo/mod.rsdiff --git a/rust/photos/src/motion_photo/xmp.rs b/rust/crates/photos/src/motion_photo/xmp.rssimilarity index 100%rename from rust/photos/src/motion_photo/xmp.rsrename to rust/crates/photos/src/motion_photo/xmp.rsdiff --git a/rust/photos/tests/motion_photos_assets_test.rs b/rust/crates/photos/tests/motion_photos_assets_test.rssimilarity index 96%rename from rust/photos/tests/motion_photos_assets_test.rsrename to rust/crates/photos/tests/motion_photos_assets_test.rsindex 10812d716f..a5fe4f47a0 100644--- a/rust/photos/tests/motion_photos_assets_test.rs+++ b/rust/crates/photos/tests/motion_photos_assets_test.rs@@ -7,11 +7,11 @@ fn fixture_dir() -> Option<PathBuf> {return Some(PathBuf::from(path).join("media/motion-photos/v1/files"));}- // CARGO_MANIFEST_DIR points to `<repo>/rust/photos`.+ // CARGO_MANIFEST_DIR points to `<repo>/rust/crates/photos`.// We resolve `<repo>/..../test-fixtures/media/motion-photos/v1/files`,// where `test-fixtures` is expected to be a sibling of the main repo root.let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));- let repo_root = manifest_dir.parent()?.parent()?; // rust/photos -> rust -> <repo root>+ let repo_root = manifest_dir.parent()?.parent()?.parent()?; // photos -> crates -> rust -> <repo root>let parent_of_repo = repo_root.parent()?;Some(parent_of_repo