Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move Rust developer commands into tools

Manav Rathicb19ba6d8f9d
diff --git a/.github/workflows/desktop-lint.yml b/.github/workflows/desktop-lint.yml
index 39c77e9e30..3447e6bbe4 100644
--- a/.github/workflows/desktop-lint.yml
+++ b/.github/workflows/desktop-lint.yml
@@ -8,7 +8,7 @@ on:
- "rust/bindings/napi/**"
- "rust/crates/image/**"
- "rust/crates/ml/**"
- - "rust/apps/codegen/**"
+ - "rust/tools/codegen/**"
- "rust/Cargo.toml"
- "rust/Cargo.lock"
diff --git a/.github/workflows/ensu-android-build.yml b/.github/workflows/ensu-android-build.yml
index f7a6746e28..88928a7d33 100644
--- a/.github/workflows/ensu-android-build.yml
+++ b/.github/workflows/ensu-android-build.yml
@@ -5,7 +5,7 @@ on:
paths:
- "android/apps/ensu/**"
- "android/apps/ensu/rust/**"
- - "rust/apps/codegen/**"
+ - "rust/tools/codegen/**"
- "rust/crates/core/**"
- "rust/crates/ensu/**"
- "rust/bindings/uniffi/**"
diff --git a/.github/workflows/ensu-ios-build.yml b/.github/workflows/ensu-ios-build.yml
index 127f5a36ca..77c1d00daf 100644
--- a/.github/workflows/ensu-ios-build.yml
+++ b/.github/workflows/ensu-ios-build.yml
@@ -5,7 +5,7 @@ on:
paths:
- "apple/apps/ensu/**"
- "apple/packages/EnteOnnxRuntime/**"
- - "rust/apps/codegen/**"
+ - "rust/tools/codegen/**"
- "rust/crates/core/**"
- "rust/crates/ensu/**"
- "rust/bindings/uniffi/**"
diff --git a/.github/workflows/mobile-lint.yml b/.github/workflows/mobile-lint.yml
index 26e2c6cccb..60a7a032f7 100644
--- a/.github/workflows/mobile-lint.yml
+++ b/.github/workflows/mobile-lint.yml
@@ -5,7 +5,7 @@ on:
paths:
- ".github/workflows/mobile-lint.yml"
- "mobile/**"
- - "rust/apps/codegen/**"
+ - "rust/tools/codegen/**"
- "rust/bindings/frb/**"
- "rust/Cargo.lock"
- "rust/Cargo.toml"
diff --git a/mobile/apps/photos/README.md b/mobile/apps/photos/README.md
index 9ecbbcc21b..4b626f516d 100644
--- a/mobile/apps/photos/README.md
+++ b/mobile/apps/photos/README.md
@@ -61,10 +61,6 @@ To build a release APK, [setup your keystore](https://docs.flutter.dev/deploymen
After updating Flutter dependencies, run `pod install` from `ios/` on macOS and commit `ios/Podfile.lock` if it changes.
-## πŸ™οΈ Attributions
-
-See the [location dataset attribution](../../../rust/crates/location-dataset/README.md).
-
## 🌍 Translate
[![Crowdin](https://badges.crowdin.net/ente-photos-app/localized.svg)](https://crowdin.com/project/ente-photos-app)
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 9d83c3ac6e..4d804ccd31 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -2,7 +2,6 @@
resolver = "2"
members = [
"apps/cli",
- "apps/codegen",
"apps/ensu/src-tauri",
"bindings/frb/lib",
"bindings/frb/locker",
@@ -33,13 +32,14 @@ members = [
"crates/image",
"crates/legacy",
"crates/location",
- "crates/location-dataset",
"crates/locker",
"crates/ml",
"crates/paste",
"crates/photos",
"crates/space",
"crates/test-support",
+ "tools/codegen",
+ "tools/location-dataset",
]
[workspace.package]
diff --git a/rust/checks/dependency-boundaries/check.mjs b/rust/checks/dependency-boundaries/check.mjs
index 679cc01414..4be8472c89 100644
--- a/rust/checks/dependency-boundaries/check.mjs
+++ b/rust/checks/dependency-boundaries/check.mjs
@@ -28,7 +28,7 @@ const domain = metadata.packages.filter((pkg) =>
const httpOwners = new Set([
"rust/crates/core/Cargo.toml",
"rust/crates/assets/Cargo.toml",
- "rust/crates/location-dataset/Cargo.toml",
+ "rust/tools/location-dataset/Cargo.toml",
]);
for (const pkg of metadata.packages) {
diff --git a/rust/checks/dependency-boundaries/test.mjs b/rust/checks/dependency-boundaries/test.mjs
index 6a7c399e03..0cbb7500fd 100644
--- a/rust/checks/dependency-boundaries/test.mjs
+++ b/rust/checks/dependency-boundaries/test.mjs
@@ -65,7 +65,7 @@ result = run({ framework: "reqwest", bindingDependencyKind: "dependencies" });
assert.equal(result.status, 1, result.stderr);
assert.match(result.stderr, /rust\/bindings\/wasm\/lib\/Cargo\.toml: use ente-core::http/);
-for (const domainName of ["core", "assets", "location-dataset"]) {
+for (const domainName of ["core", "assets"]) {
result = run({ framework: "reqwest", dependencyKind: "dependencies", domainName });
assert.equal(result.status, 0, result.stderr);
}
diff --git a/rust/apps/codegen/Cargo.toml b/rust/tools/codegen/Cargo.toml
similarity index 100%
rename from rust/apps/codegen/Cargo.toml
rename to rust/tools/codegen/Cargo.toml
diff --git a/rust/apps/codegen/src/main.rs b/rust/tools/codegen/src/main.rs
similarity index 99%
rename from rust/apps/codegen/src/main.rs
rename to rust/tools/codegen/src/main.rs
index 2cbf5c97ce..7be6837655 100644
--- a/rust/apps/codegen/src/main.rs
+++ b/rust/tools/codegen/src/main.rs
@@ -163,7 +163,7 @@ fn generate_frb(target: FrbTarget) -> Result<(), DynError> {
let rust_root = rust_root()?;
let repo_root = rust_root
.parent()
- .ok_or("failed to resolve repo root from rust/apps/codegen")?;
+ .ok_or("failed to resolve repo root from rust/tools/codegen")?;
let apps: &[&str] = match target {
FrbTarget::All => &["photos", "locker"],
@@ -370,7 +370,7 @@ fn rust_root() -> Result<PathBuf, DynError> {
fn repo_root() -> Result<PathBuf, DynError> {
Ok(rust_root()?
.parent()
- .ok_or("failed to resolve repo root from rust/apps/codegen")?
+ .ok_or("failed to resolve repo root from rust/tools/codegen")?
.to_path_buf())
}
diff --git a/rust/crates/location-dataset/Cargo.toml b/rust/tools/location-dataset/Cargo.toml
similarity index 100%
rename from rust/crates/location-dataset/Cargo.toml
rename to rust/tools/location-dataset/Cargo.toml
diff --git a/rust/crates/location-dataset/README.md b/rust/tools/location-dataset/README.md
similarity index 100%
rename from rust/crates/location-dataset/README.md
rename to rust/tools/location-dataset/README.md
diff --git a/rust/crates/location-dataset/src/catalog.rs b/rust/tools/location-dataset/src/catalog.rs
similarity index 100%
rename from rust/crates/location-dataset/src/catalog.rs
rename to rust/tools/location-dataset/src/catalog.rs
diff --git a/rust/crates/location-dataset/src/city.rs b/rust/tools/location-dataset/src/city.rs
similarity index 100%
rename from rust/crates/location-dataset/src/city.rs
rename to rust/tools/location-dataset/src/city.rs
diff --git a/rust/crates/location-dataset/src/country.rs b/rust/tools/location-dataset/src/country.rs
similarity index 100%
rename from rust/crates/location-dataset/src/country.rs
rename to rust/tools/location-dataset/src/country.rs
diff --git a/rust/crates/location-dataset/src/dispute.rs b/rust/tools/location-dataset/src/dispute.rs
similarity index 100%
rename from rust/crates/location-dataset/src/dispute.rs
rename to rust/tools/location-dataset/src/dispute.rs
diff --git a/rust/crates/location-dataset/src/download.rs b/rust/tools/location-dataset/src/download.rs
similarity index 100%
rename from rust/crates/location-dataset/src/download.rs
rename to rust/tools/location-dataset/src/download.rs
diff --git a/rust/crates/location-dataset/src/lib.rs b/rust/tools/location-dataset/src/lib.rs
similarity index 100%
rename from rust/crates/location-dataset/src/lib.rs
rename to rust/tools/location-dataset/src/lib.rs
diff --git a/rust/crates/location-dataset/src/main.rs b/rust/tools/location-dataset/src/main.rs
similarity index 100%
rename from rust/crates/location-dataset/src/main.rs
rename to rust/tools/location-dataset/src/main.rs
diff --git a/rust/crates/location-dataset/src/sources.rs b/rust/tools/location-dataset/src/sources.rs
similarity index 100%
rename from rust/crates/location-dataset/src/sources.rs
rename to rust/tools/location-dataset/src/sources.rs
diff --git a/rust/crates/location-dataset/src/urban.rs b/rust/tools/location-dataset/src/urban.rs
similarity index 100%
rename from rust/crates/location-dataset/src/urban.rs
rename to rust/tools/location-dataset/src/urban.rs