$ show bazel-ios/rules_ios
rules_ios is a Bazel rule set for building Apple platform applications (iOS, macOS, tvOS, watchOS). It provides rules for creating apps, frameworks, extensions, app clips, tests, and handling Apple-specific complexities like code signing, resource bundling, and multi-architecture support. The repository integrates with rules_apple and rules_swift, offering a Bazel-native alternative to Xcode builds. Key features include automatic handling of Apple Silicon compatibility via import_middleman, VFS overlays for faster builds, and comprehensive test generation. The tooling directory contains utilities like arm64-to-sim for running arm64 binaries in x86_64 simulators and SSH password helpers for VM-based testing.
The LLM identified 3 files worth highlighting for reuse:
Directory containing the arm64-to-sim tool and supporting scripts. Solves the problem of running arm64 binaries in x86_64 iOS simulators by patching Mach-O files (e.g., updating load commands, install names). Self-contained, depends only on standard macOS command-line tools (otool, install_name_tool, codesign). Demonstrates deep understanding of Mach-O format and Apple's simulator requirements.
Small C program facilitating non-interactive SSH password authentication for automated testing. Handles password prompts by interacting with SSH's pseudo-terminal. Used by the VM test runner (vmd.sh) to automate logins in test environments. Highly portable, minimal dependencies (only libc), and easily extractable for any SSH automation scenario.
Bazel rule that provides automatic Apple Silicon simulator compatibility. Patches binaries to run in x86_64 simulators by modifying load codes and setting appropriate minimum OS versions. Integrates seamlessly with apple_framework and other Apple rules via transitive dependencies. Solves a universal problem in cross-platform Apple builds with minimal configuration, showcasing advanced Bazel transition and patching techniques.