> ## Documentation Index
> Fetch the complete documentation index at: https://boutiquedb.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-Architecture Packaging

> Build and package BoutiqueDB's engine binaries for Apple device and simulator architectures.

# Multi-arch packaging

Public and Swift Package Index (SPI) releases of BoutiqueDB must include a universal, multi-arch `TursoSDK.xcframework`. Single-slice builds are only for local debugging.

## Required slices

| Slice | Architectures | Use |
| - | - | - |
| macOS | arm64 + x86\_64 (universal) | Mac App Store and direct distribution |
| iOS device | arm64 | Physical iPhones and iPads |
| iOS Simulator | arm64 + x86\_64 (universal) | Simulator testing, including Rosetta |

## Build the framework

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Default: full multi-arch
./Scripts/build-turso-sdk-xcframework.sh

# Debug single slice only — never ship this
SLICES=macos-arm64 ./Scripts/build-turso-sdk-xcframework.sh
```

The script produces `Vendor/TursoSDK.xcframework` and `Vendor/TursoSDK.xcframework.zip`.

## Validate slices

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
lipo -info Vendor/TursoSDK.xcframework/macos-*/*.a
lipo -info Vendor/TursoSDK.xcframework/ios-arm64*/*.a
```

Every `.a` must contain the expected architectures before the build is shipped.

## Update Package.swift

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
swift package compute-checksum Vendor/TursoSDK.xcframework.zip
```

Copy the checksum into `Package.swift` as `tursoSDKChecksum`. If you are releasing a new binary, also bump `tursoSDKVersion` and upload the zip to GitHub Releases with a matching tag.

## Security

* Do not commit `Vendor/TursoSDK.xcframework` or `.a` files to git (they are gitignored).
* Do not use `unsafeFlags` in `Package.swift`; SPI and App Store submission reject them.
* Store release signing identities and checksums in a safe location.

## CI validation

Before tagging, validate a clean clone:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
rm -rf Vendor/TursoSDK.xcframework
swift build
xcodebuild -scheme BoutiqueDB-Package \
  -destination 'platform=iOS Simulator,name=iPhone 16' \
  build
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.