Error compiling with extern crate "tflite"

Hello @sepia! Thanks for bringing up the question and sorry for the late reply.
Secret contracts run inside a constrained WASM sandbox environment, and are compiled to that target. In general, only a limited subset of APIs are available inside this environment (for example, you do not have any notion of a filesystem, and instead we provide the custom secret storage system), but more specifically, threads are not a feature of the WASM runtime itself. If such functionality will be added to the runtime we use in the future, we will certainly consider updating it and adding support for it.

When using crate from crates.io ecosystem, please keep in mind that they are mostly written to target rust’s tier 1 targets, which WASM isn’t one of (we target wasm32-unknown-unknown, which is tier 2). This means that you’re only guaranteed that no_std crates will work flawlessly. each crate that uses the standard library, or attempts to invoke any additional bindings (such as your example) has a chance of encountering such issues. Some can be resolved on a case-by-case basis, but unfortunately some crates will inevitably hit one of the limitations of the secret-contract runtime, and will fail to compile, or run correctly.

3 Likes