Skip to content

build: add mobile-dev profile, fix metro watcher and NDK config#3012

Merged
jamiepine merged 1 commit into
spacedriveapp:mainfrom
StarbirdTech:build/mobile-build-improvements
Feb 6, 2026
Merged

build: add mobile-dev profile, fix metro watcher and NDK config#3012
jamiepine merged 1 commit into
spacedriveapp:mainfrom
StarbirdTech:build/mobile-build-improvements

Conversation

@StarbirdTech
Copy link
Copy Markdown
Contributor

@StarbirdTech StarbirdTech commented Feb 6, 2026

Improves mobile build times and fixes configuration issues in xtask and Metro. Extracted from #2988 to keep the Android PR focused on platform-specific changes.

These are all general mobile DX improvements — the mobile-dev profile and Metro fixes benefit both iOS and Android development, and the NDK host_tag fix corrects a silent bug on Apple Silicon Macs.

What this improves

  • ~15-20 min faster per-architecture Rust builds with mobile-dev profile
  • Incremental iOS builds work — no more forced full recompiles
  • Metro stops watching 4.5GB+ of Rust build artifacts during hot reload
  • NDK config no longer silently breaks on Apple Silicon Macs
  • React resolution matches bun's actual hoisting behavior

Changes

  • Added [profile.mobile-dev] Cargo profile — parallel codegen, no LTO, opt-level 2. Opt-in via cargo build --profile mobile-dev; production builds still use --release
  • Fixed NDK host_tag in xtask to always use darwin-x86_64 on macOS — Google ships universal binaries under that path for backwards compatibility
  • Made aws-lc-sys cache cleaning opt-in via CLEAN_AWS_LC=1 in the iOS build script
  • Scoped Metro watchFolders to src/ and packages/ instead of the entire monorepo root
  • React/React Native resolution now uses require.resolve to dynamically find packages instead of hardcoding workspace root paths (tembo review feedback)
  • Applied tembo review feedback from chore: fix package exports, hoist types, remove stale lockfiles #3011: fix SVG type declarations to avoid DOM dependency, add sound asset type flexibility, and add public subpath exports to ts-client

Verification

  • cargo check — passes
  • cargo build — full build completes clean
  • bun install — no errors
  • require.resolve("react/package.json") and require.resolve("react-native/package.json") both resolve correctly to workspace root node_modules/
  • Metro config loads successfully with correct watchFolders, extraNodeModules, and blockList paths
  • Pre-existing frontend typecheck/build failures on main are unchanged (Radix UI type compat, missing @sd/interface/platform export)

Comment thread apps/mobile/metro.config.js
Comment thread apps/mobile/modules/sd-mobile-core/ios/build-rust.sh Outdated
Add a mobile-dev Cargo profile for faster mobile development builds
(parallel codegen, no LTO, opt-level 2) — available opt-in via
`cargo build --profile mobile-dev`. Production builds use --release.

Fix NDK host_tag to always use darwin-x86_64 on macOS since Google
ships universal binaries under that path. Make aws-lc-sys cache
cleaning opt-in via CLEAN_AWS_LC=1 to enable incremental iOS builds.

Scope Metro file watcher to src/ and packages/ instead of the entire
monorepo (avoids watching 4.5GB+ Rust target/ dirs) and fix React
resolution to use workspace root where bun hoists packages.

Apply tembo review feedback from spacedriveapp#3011: fix SVG type declarations to
avoid DOM dependency, add sound asset type flexibility, and add public
subpath exports to ts-client.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@StarbirdTech StarbirdTech force-pushed the build/mobile-build-improvements branch from 9bffd12 to 5c4b000 Compare February 6, 2026 08:34
@jamiepine jamiepine merged commit 77ff1d7 into spacedriveapp:main Feb 6, 2026
@StarbirdTech StarbirdTech deleted the build/mobile-build-improvements branch February 7, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants