feat(backend): migrate production backend to Rust

Replace the Go backend with the Rust workspace and route Android/iOS through
UniFFI bindings. Include the migrated extension runtime, network, providers,
media metadata, downloads and library operations, with version 5.0.0+147.

Remove Go sources, adapters, native build selection and CI dependencies.
Build Rust unconditionally and lock the iOS Rust pod using a relative path.
Retain legacy source and migration evidence in a local ignored archive.

Validation: Android Kotlin compile and 53 native tests; Swift Rust-branch
equivalence and syntax; CocoaPods install; workflow, shell, Ruby, plist and
diff checks. Reuse the preceding 100 Rust tests, fmt/Clippy and five-ABI
build checkpoint; no new APK or iOS application build for this cleanup.

Known follow-up: URL/URLSearchParams globals are missing from the Rust JS
runtime. A controlled extension replay confirms a URL-resolution regression;
this commit does not fix that runtime gap.
This commit is contained in:
zarzet committed 2026-09-14 22:58:27 +07:00
1 parent 1da0da18a6
commit aa99726439
452 files changed
+64417 -65088

No files matched your search

+2 -40
View File
@@ -1,45 +1,7 @@
#!/usr/bin/env bash
# Build the Go backend XCFramework used by SpotiFLAC Mobile on iOS.
# Build the Rust backend XCFramework used by SpotiFLAC Mobile on iOS.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
GO_BACKEND_DIR="$PROJECT_DIR/go_backend"
OUTPUT_DIR="$PROJECT_DIR/ios/Frameworks"
echo "SpotiFLAC Mobile iOS backend build"
echo "Project: $PROJECT_DIR"
echo "Output: $OUTPUT_DIR"
if [[ "$(uname)" != "Darwin" ]]; then
echo "Error: this script must run on macOS with Xcode installed." >&2
exit 1
fi
if ! command -v go >/dev/null 2>&1; then
echo "Error: Go is not installed." >&2
exit 1
fi
cd "$GO_BACKEND_DIR"
go mod download
# Running inside the module installs the x/mobile revision pinned by go.mod.
go install golang.org/x/mobile/cmd/gomobile
export PATH="$(go env GOPATH)/bin:$PATH"
gomobile init
mkdir -p "$OUTPUT_DIR"
gomobile bind \
-target=ios \
-tags ios \
-o "$OUTPUT_DIR/Gobackend.xcframework" \
.
if [[ ! -d "$OUTPUT_DIR/Gobackend.xcframework" ]]; then
echo "Error: Gobackend.xcframework was not created." >&2
exit 1
fi
echo "Built $OUTPUT_DIR/Gobackend.xcframework"
exec bash "$SCRIPT_DIR/build_rust_backend.sh" ios