Skip to main content

max / synckit

1.5 KB · 40 lines History Blame Raw
1 #!/bin/bash
2 # check-mobile-targets: cross-check synckit-client for the Apple targets.
3 #
4 # Why this exists: synckit-client compiled cleanly on every host we build on
5 # while being entirely unbuildable for iOS, because nothing ever pointed a
6 # compiler at an iOS target. Two separate breaks hid behind that (the Apple
7 # store crate hard-errors on iOS without its `protected` feature, and keyring's
8 # store installer is cfg'd out on iOS), and both were found by reading, not by
9 # building. Run this after touching keystore.rs, the `keychain` feature, or any
10 # keyring-family dependency.
11 #
12 # Runs anywhere with rustup, Linux included: `cargo check` does not link, and
13 # these feature sets pull in no C code.
14 #
15 # Not covered here, and still mbp-only:
16 # - the `store` feature, whose bundled SQLite needs the Apple SDK (xcrun)
17 # - linking, code signing, and anything on-device
18 set -euo pipefail
19
20 cd "$(dirname "$0")/.."
21
22 TARGETS=(aarch64-apple-ios aarch64-apple-darwin)
23 # `store` is excluded deliberately: bundled libsqlite3-sys shells out to xcrun.
24 FEATURES="keychain"
25
26 for target in "${TARGETS[@]}"; do
27 if ! rustup target list --installed | grep -qx "$target"; then
28 echo "==> installing target $target"
29 rustup target add "$target"
30 fi
31 echo "==> cargo check --target $target --features $FEATURES"
32 cargo check \
33 --manifest-path synckit-client/Cargo.toml \
34 --target "$target" \
35 --no-default-features \
36 --features "$FEATURES"
37 done
38
39 echo "==> Apple targets check clean."
40