Now we’re getting to the interesting part: Native iOS development on an M1. It’s usable enough for some testing, but for that part I most often switch back to my Linux Desktop (that has the additional CPU power on top). It’s as easy as: arch -x86_64 $SHELLĪt least if you have Java set up correctly… The default Android emulator isn’t usable on M1 hardware yet, but Google is working on a compatible one: Android M1 emulator preview. But for Glean development we simply recommend relying on Rosetta 2 (the x86_64 compatibility layer) for now. A friend managed to compile and run that library on an M1. Some of our transitive dependencies are based on years-old pre-built binaries of SQLite and of course there’s not much support behind updating those Java libraries. Glean Android is not that straight forward. So it’s both possible to develop & test Glean Python, as well as use it as a dependency without having a full Rust development environment around. My colleague glandium later contributed support code so we build release wheels for that target too. It gained aarch64 2 macOS support in v14.4.1. We use cffi to load the native library into Python. Developers on Intel MacBooks can cross-compile just as easily: rustup target add aarch64-apple-darwinĬargo build -target aarch64-apple-darwin Glean Python & Kotlin on an M1 This landed in August and was promoted to Tier 2 1 with the December release of Rust 1.49.0.īy the time I got my MacBook compiling Rust code on it was as easy as on an Intel MacBook. First and foremost this required a new target: aarch64-apple-darwin. See Rust issue 73908 for all the work and details. Work on getting Rust compiled on M1 hardware started last year in June already, with the availability of the first developer kits. Stretch goal: Get iOS projects using Glean running as well.Build & test the Swift language bindings natively and in the iPhone simulator on an M1 machine.Build & test the Kotlin & Swift language bindings on an M1 machine, even if non-native (e.g. Rosetta 2 emulation for x86_64).Compile the Rust portions of Glean natively on an M1 machine.Eventually these iOS developers will also have M1-based machines and want to test their code, thus Glean needs to work. We maintain a Swift language binding, targeting iOS, and that one is used in Firefox iOS. I got it with the explicit task to ensure that we are able to develop and build Glean on it. They could be release notes, documentation, hopes, dreams, or whatever: so long as it is inspired by Glean.) All “This Week in Glean” blog posts are listed in the TWiG index (and on the Mozilla Data blog).īack in February I got an M1 MacBook. (“This Week in Glean” is a series of blog posts that the Glean Team at Mozilla is using to try to communicate better about our work. I've also tried using setuptools-rust to similar effect, both calling setup.py directly and also using pip install. Info: The currently active `rustc` version is `rustc 1.58.1 (db9d1b20b )` Info: This is the version for the rustup toolchain manager, not the rustc compiler. KMMMMMMMMMMMMMMMMMMMMMMd Memory: 1975MiB / 16384MiB XMMMMMMMMMMMMMMMMMMMMMMMMMMk CPU: Apple M1 MMMMMMMMMMMMMMMMMMMMMMMM: Resolution: 1920x1080 Is it something weird with my M1 setup, my homebrew setup, my rust setup, my python setup, or something else I missed?ĬKMMMMMMMMMMNWMMMMMMMMMM0: Uptime: 1 day, 2 hours, 12 mins Cargo build also runs fine on the maturin-generated string_sum rust code: > cargo buildĬompiling string_sum v0.1.0 (/Users/tweedle/projects/string_sum)įinished dev target(s) in 9.73s (Added to PATH again just to make sure.) I've also tried the x86 toolchain, same results. > export PATH="$PATH:~/.rustup/toolchains/stable-aarch64-apple-darwin/bin:~/.cargo/bin" Users/tweedle/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc But I have rustup installed and on path: ❯ rustc -version I see this error come up a lot in the PyO3 issues, but it's generally solved by installing rustup. Install it through the system's package manager or via. This package requires Rust and Cargo to compile extensions. ✨ Done! Initialized project /Users/tweedle/projects/string_sumĬaused by: rustc, the rust compiler, is not installed or not in PATH. I get "rustc.is not installed or not in PATH": > maturin init If I follow the steps to get started with PyO3: $ mkdir string_sum I'm trying to get PyO3 working on my Mac M1 mini.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |