Compatibility Maps
Rust
compatibility points when talking about compatibility for the ditto rust sdk, there are a few properties that we need to check in order to ensure that we can deploy a ditto powered app to a device these properties are the target triple of the device where the app will be deployed, the ditto sdk version the app depends on, and the rust toolchain version used to compile the app supported targets compilers use terms known as “ target triples ” to describe the architecture, operating system, and additional details about a system to compile programs for the following targets are officially supported by the ditto rust sdk architecture operating system target triples intel core (x86 64) macos (11+) x86 64 apple darwin linux x86 64 unknown linux gnu arm 64 bit (aarch64) macos aarch64 apple darwin linux aarch64 unknown linux gnu raspberry pi (arm) raspbian (linux) armv7 unknown linux gnueabihf checking the target triple before getting started with development, it’s nice to check for certain that the device you’re working with actually has the target triple you think it should fortunately, rust provides an easy way to check what the exact target triple for a device is this easy method requires https //rustup rs (the one where the app will be deployed), then running the command rustc vv to check the compiler version information for example, from an m1 macbook pro, we see an output like this shell ❯ rustc vv rustc 1 74 1 (a28077b28 2023 12 04) binary rustc commit hash a28077b28a02b92985b3a3faecf92813155f1ea1 commit date 2023 12 04 host aarch64 apple darwin release 1 74 1 llvm version 17 0 4 here, the field labeled "host" describes the target triple of the machine where we ran this command, in this case our target triple is aarch64 apple darwin matching the sdk and rust toolchain versions the ditto rust sdk is slightly different from most rust libraries because it has strict requirements on the rust toolchain version that must be used to compile it we’re working to relax this requirement, but for now what you need to know is that when you import a given ditto sdk version, you must use the exact matching rust toolchain version as shown below ditto sdk version rust toolchain version "=4 7 x" 1 74 1 "=4 6 x" 1 74 1 "=4 0 x" "=4 5 x" 1 66 1 "=3 x y" 1 64 0 here, we recommend using the "=x y z" notation for semantic versions of the sdk so that cargo doesn’t try to automatically upgrade your minor version since each version of the sdk must be matched exactly to the toolchain it was compiled with, auto upgrades of minor versions could actually break your build additionally, we recommend specifying the versions of both the dittolive ditto and dittolive ditto sys packages, like this cargo toml \[dependencies] dittolive ditto = "=4 7 1" dittolive ditto sys = "=4 7 1" selecting a toolchain for your project the easiest way to choose a specific toolchain version for a project is to create a file called rust toolchain in your project directory (next to the cargo toml ) for example, when using the 4 7 1 sdk, set the 1 74 1 toolchain like this /rust toolchain 1 74 1 you can confirm that this works by running rustup show in your project directory, which should show details about your active toolchain, like this shell ❯ rustup show \# active toolchain \ 1 74 1 aarch64 apple darwin (overridden by '/path/to/your/project/rust toolchain') rustc 1 74 1 (a28077b28 2023 12 04) transports transport support and quality depends heavily on the hardware ditto is being deployed on ensure to test with your specific hardware to verify compatability platform ble 5 0+ awdl wi fi aware lan websockets linux (x64) ✓ ✓ ✓ linux (aarch64) ✓ ✓ ✓ macos ✓ ✓ windows ✓ ✓