• Stars
    star
    408
  • Rank 105,946 (Top 3 %)
  • Language
    Shell
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rust toolchain for Xcode-compatible iOS bitcode

Deprecation notice (Sep 2022)

Apple has deprecated the use of bitcode.

Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.

We have confirmed that libraries produced by the standard Rust iOS toolchain can be included in apps using Xcode 14, which pass App Store validation.

This custom toolchain is no longer needed and will not be maintained going forward. πŸŽ‰

The old readme is preserved below for future reference.

Rust toolchain for Xcode-compatible iOS bitcode

In standard releases of Rust, the bitcode in ARM64 iOS targets is often incompatible with Xcode because they use different versions of LLVM. This is a known issue with no clear long-term solution yet.

This repository contains scripts for building and installing a custom Rust nightly toolchain where the Rust compiler's version of LLVM matches Xcode. Software built using this toolchain can be included in bitcode-enabled apps that will install on real iOS devices.

Binary releases of the toolchain will be created periodically and attached to this repository, at least until there is a better upstream solution.

This repository is maintained by Ditto. We use it ourselves and want to share it for the benefit of the Rust iOS community! Please create an issue if you notice any problems.

These scripts work for 64-bit iOS only. watchOS and tvOS are not fully supported by Rust yet.

Pre-compiled releases

Visit the releases page and download a zip file. It will have a name of the form rust-ios-arm64-xxx.zip.

Unzip the file and open a terminal to the extracted directory. Remove the quarantine flag so the binaries will be trusted, then run the installation script:

xattr -r -d com.apple.quarantine .
./install.sh

This will install the toolchain in ~/.rustup/toolchains/ios-arm64-xxx.

Build from source

  1. Ensure required build tools are installed. If you are using homebrew: brew install ninja cmake openssl
  2. Clone this repository.
  3. Review config.sh to make sure the the Rust and LLVM versions are suitable.
  4. In a terminal, run ./build.sh. This will clone the Rust and LLVM repositories under build/ and compile them. The toolchain will end up at build/rust-build/build/x86_64-apple-darwin/stage2.
  5. Run ./install.sh. This will install the toolchain in ~/.rustup/toolchains/ios-arm64-1.60.0, making it available in rustup.

Using the toolchain

Build your library like this:

cargo +ios-arm64-1.60.0 build --target aarch64-apple-ios --release --lib

License

The shell scripts in this repository are made available under the permissive Apache 2.0 licence. Refer to the LICENSE file.

Binary releases contain LLVM and Rust. See LICENSE-LLVM and LICENSE-RUST for their respective licenses. These licenses are included in the binary releases.

More Repositories

1

safer_ffi

Write safer FFI code in Rust without polluting it with unsafe code
Rust
903
star
2

docs

Ditto Documentation
TypeScript
34
star
3

react-ditto

React wrappers for Ditto for easy integration using both components or hooks
TypeScript
29
star
4

bluetooth-blog-tutorial

A tutorial using Core Bluetooth and Android Bluetooth from Scratch
Swift
18
star
5

samples

Sample Codes using Ditto
Kotlin
14
star
6

wifi-aware-checker

A test android app for version 8.0 or higher that checks if WiFi Aware is available on the device
Kotlin
12
star
7

moodlight

Demo project to sync color changes to an Raspberry Pi Mood Light via iOS/Android
Swift
11
star
8

DittoSwiftPackage

Swift package for the DittoSwift framework.
Swift
10
star
9

DittoSwiftTools

Diagnostic and Debugging Tools for DittoSwift
Swift
10
star
10

demoapp-chat

Chat demo for Android and iOS
Kotlin
9
star
11

react-in-mobile

Bundle and run a React web app inside of iOS and Android
Kotlin
9
star
12

rn-jsi-rust-bridging

Sample app for the Bridging React Native and Rust via JSI blog post.
Ruby
8
star
13

demoapp-kmp

Example of using the Ditto iOS & Android SDKs in a Kotlin Multiplatform app.
Kotlin
6
star
14

mobile-microservices

Running HTTP Servers on iOS and Android Devices
Swift
6
star
15

DittoAndroidTools

Diagnostic and Debugging Tools for Ditto Android SDK
Kotlin
6
star
16

cross-platform-rust-js-boilerplate

A boilerplate for cross platform js repo for web browsers, node and react native with a rust code
Rust
5
star
17

starfish

An experimental react native implementation for Ditto using OnlinePlayground
TypeScript
5
star
18

CombineDitto

DittoSwift extension methods for Apple's Combine Framework
Swift
5
star
19

vaxx

Swift
4
star
20

demoapp-flutter

Dart
4
star
21

authtool

Generate authentication for devices in a Ditto mesh
Rust
3
star
22

sample-authentication-permissions

Ditto permissions examples
Swift
3
star
23

dijkstra-calculator

A simple JS calculator for finding the shortest path in a graph of nodes.
TypeScript
3
star
24

react-native-sample-app

A React Native app that lets you create tasks and sync them with Ditto.
TypeScript
3
star
25

demoapp-pos-kds

Swift
3
star
26

DittoObjC

Swift package for the DittoObjC framework.
Swift
3
star
27

template-heartbeat

Monitor the full health of ditto end-to-end
TypeScript
2
star
28

sample-cdc

Ditto Big Peer Syncing with an External Database
TypeScript
2
star
29

rxjs-ditto

RxJS Wrapper for Ditto
TypeScript
2
star
30

CoreDataDitto

Experimental Sync with Core Data
Swift
2
star
31

demoapp-skyservice

SkyService Demo App (iOS and Android)
Swift
2
star
32

template-app-jetpack-compose-kotlin-todo

Kotlin
2
star
33

template-app-nodejs-todo

TypeScript
2
star
34

example-swift-bridge-to-objectivec

[Public] Example iOS app that shows how to use DittoSwift codes in an Objective-C app.
Objective-C
2
star
35

network-graph-addon

A blender addon to make curves between selected objects
Python
1
star
36

social-proximity

Swift
1
star
37

CrashReporterFreeze

Demonstrates freeze issues with PLCrashReporter and Ditto build with Rust 1.65+
Objective-C
1
star
38

DittoDotnetTools

C#
1
star
39

cod-polaris-m1

Common Operational Database services and prototypes.
TypeScript
1
star
40

RxSwiftDitto

RxSwift extension methods for DittoSwift
Swift
1
star
41

dex-k8s-authenticator

A Kubernetes Dex Client Authenticator
Go
1
star
42

rxjavaditto

RxJava 3 extension methods for Kotlin with a Jetpack Compose Example
Kotlin
1
star
43

DittoChatPackage

A swift package of a chat feature
Swift
1
star
44

template-app-swift-todo

Swift
1
star
45

DittoSwiftLog

An example of how to connect DittoLogger's custom callback to an external logging system. This example connects it to Apple's swift-log.
Swift
1
star
46

template-rust

A sample app showing how to sync offline with Ditto using Rust
Rust
1
star
47

convert-html-to-pug

A Visual Studio Code extension that allows you to right click selected HTML and convert it to Pug
TypeScript
1
star
48

moodlight-Bus

Demo project to sync color changes over the Ditto Bus on IOS/Android
Swift
1
star