Document iOS TDLib linking blocker

This commit is contained in:
Mikhail Kilin
2026-05-20 23:04:03 +03:00
parent 99ae5106ae
commit f6b4b34ed4
5 changed files with 62 additions and 0 deletions

View File

@@ -43,10 +43,16 @@ struct TeleTuiIOSSmokeTests {
let viewModel = ChatListViewModel(bridge: bridge)
await viewModel.load()
precondition(viewModel.folders.map(\.name) == ["All", "Work"])
precondition(viewModel.chats.map(\.title) == ["Saved Messages", "iOS Team"])
viewModel.searchText = "team"
precondition(viewModel.filteredChats.map(\.title) == ["iOS Team"])
viewModel.searchText = ""
viewModel.selectedFolderId = 2
await viewModel.load()
precondition(viewModel.chats.map(\.title) == ["iOS Team"])
}
@MainActor
@@ -126,6 +132,10 @@ struct TeleTuiIOSSmokeTests {
let player = RecordingVoicePlayer()
let mediaViewModel = MediaViewModel(cache: cache, voicePlayer: player)
mediaViewModel.showPhoto(path: "/tmp/photo.jpg")
mediaViewModel.showVoice(path: "/tmp/voice.ogg")
precondition(mediaViewModel.activePhotoPath == "/tmp/photo.jpg")
precondition(mediaViewModel.activeVoicePath == "/tmp/voice.ogg")
let voiceURL = cache.voicePath(fileId: 20)
await mediaViewModel.playVoice(url: voiceURL)
precondition(mediaViewModel.isVoicePlaying)

View File

@@ -23,3 +23,4 @@ Current linking status:
- Xcode is installed at `/Applications/Xcode.app`, and `DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -version` reports Xcode 26.5.
- The iOS 26.5 simulator runtime is installed and `scripts/check-ios-prereqs.sh` passes with available iPhone/iPad simulators.
- The current app shell uses the fake Swift bridge. Real TDLib iOS simulator/device linking is still pending until TDLib is built for `iphonesimulator` and `iphoneos` and wired into the UniFFI target.
- Run `scripts/check-ios-tdlib-linking.sh` to reproduce the current TDLib iOS blocker documented in `docs/ios/tdlib-linking.md`.

View File

@@ -32,6 +32,9 @@
- `swift build --product TeleTuiIOSApp`
- `swift run TeleTuiIOSSmokeTests`
- `DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer scripts/build-ios-simulator-app.sh`
- `DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer scripts/check-ios-tdlib-linking.sh` once TDLib iOS artifacts are available
`swift test` is not currently a CI gate on this host because the CLI Swift toolchain available to the package does not expose `XCTest` or `Testing`. The deterministic view-model coverage lives in the executable `TeleTuiIOSSmokeTests` target until an Xcode test target is introduced.
## Rollback

34
docs/ios/tdlib-linking.md Normal file
View File

@@ -0,0 +1,34 @@
# TDLib iOS Linking Status
Local toolchain status:
- Xcode 26.5 is installed at `/Applications/Xcode.app`.
- iOS 26.5 simulator runtime is installed.
- `scripts/check-ios-prereqs.sh` passes.
- `scripts/run-ios-simulator-app.sh` launches the fake-backed SwiftUI shell in iOS Simulator.
Current real TDLib blocker:
```bash
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer cargo build -p tele-ios-ffi --target aarch64-apple-ios-sim --release
```
Observed failure:
```text
[Your OS or architecture may be unsupported.] Failed to download file: Please try using the `pkg-config` or `local-tdlib` features.
404 Not Found
https://github.com/FedericoBruzzone/tdlib-rs/releases/download/v1.2.0/tdlib-1.8.29-ios-aarch64.zip
```
Interpretation:
- Rust, Swift, Xcode, and the iOS simulator runtime are working.
- The fake-backed iOS app shell can be built, installed, launched, and rendered.
- Real TDLib iOS linking is blocked because `tdlib-rs` 1.2.0 does not publish the iOS static library artifact requested by its `download-tdlib` build script.
Next viable paths:
1. Build TDLib for `iphoneos` and `iphonesimulator` locally and switch the Rust dependency path to `local-tdlib` or `pkg-config`.
2. Add a fake-only `tele-ios-ffi` build feature that avoids linking TDLib for simulator UI work, while keeping real TDLib behind a separate feature.
3. Replace the `tdlib-rs` packaging path for iOS with a lower-level C ABI/XCFramework if UniFFI plus `tdlib-rs` cannot link cleanly on device.

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ -z "${DEVELOPER_DIR:-}" && -d /Applications/Xcode.app/Contents/Developer ]]; then
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
fi
target="${IOS_RUST_TARGET:-aarch64-apple-ios-sim}"
if ! rustup target list --installed | grep -qx "${target}"; then
rustup target add "${target}"
fi
cargo build -p tele-ios-ffi --target "${target}" --release