Cross v0.2.2 Released
We've just released cross v0.2.2, a tool for cross-compiling and testing of cross-compiled crates. Our last release was 2 years ago, and since then we've patched numerous bugs, added numerous features, and added new targets. This was the work of many people, and I am only one small part of that.
Did we break your workflow? Please file an issue if we did.
To use cross, you need Docker/Podman and a rustup installation of rust.
cargo install cross
cross build --target aarch64-unknown-linux-gnu
cross test --target mips64-unknown-linux-gnuabi64
It's has an identical CLI interface to cross, and makes cross-compiling to different architectures and testing these builds simple. Since the last release we've:
- Added support for more hosts.
- Added numerous targets (see below).
- Improved
pkg-configsupport. - Added
bindgensupport. - Support configuration from
Cargo.tomlmetadata as well asCross.toml. - Added pre-build hooks, simplifying extended pre-built Docker images without maintaining your own images.
- Add support for remote Docker or Podman nodes.
- Added experimental support for running doctests.
- Extensive documentation improvements.
- Update WINE to 7.0.
- Update Qemu to 5.1.0 (6.1.0 on some targets).
- Simplified deleting and listing cross images.
- Better, colorful error reporting.
- Added support for tools like cargo-bisect-rustc.
- Support packages with private SSH dependencies.
- Add binary installs for
cross install.
We've also patched numerous bugs, including:
- Fixed testing on Android with C++ dependencies.
- Fixed mounting some Windows paths.
- And a lot of internal bug fixes.
Some new targets we've added or re-enabled:
x86_64-unknown-dragonflysparc64-unknown-linux-gnupowerpc64-unknown-linux-gnuwasm32-unknown-emscriptenthumbv7neon-unknown-linux-gnueabihfthumbv7neon-linux-androideabithumbv6m-none-eabithumbv7em-none-eabithumbv7em-none-eabihfthumbv7m-none-eabimips64-unknown-linux-muslabi64mips64el-unknown-linux-muslabi64armv7-unknown-linux-gnueabiarmv7-unknown-linux-musleabi
We also fixed the arm-unknown-linux-gnueabihf target to correctly target ARMv6, rather than ARMv7.
Since we can't distribute Apple or MSVC images, we've also made it easy to test for MSVC or macOS with Dockerfiles to easily build your own images. This adds support for:
aarch64-pc-windows-msvci686-apple-darwini686-pc-windows-msvcthumbv7a-pc-windows-msvcx86_64-apple-darwinx86_64-pc-windows-msvc
We wanted to make cross as friendly as possible for those not familiar working with Docker/Podman. Want to list all images cross has locally?
$ cross-util images list
| Targets | Images |
|-------------------------------|-----------------------------------------------------|
| aarch64-linux-android | ghcr.io/cross-rs/aarch64-linux-android:main |
| aarch64-unknown-linux-gnu | ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main |
| arm-unknown-linux-gnueabihf | ghcr.io/cross-rs/arm-unknown-linux-gnueabihf:main |
| armv7-linux-androideabi | ghcr.io/cross-rs/armv7-linux-androideabi:main |
| armv7-unknown-linux-gnueabihf | ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:main |
| asmjs-unknown-emscripten | ghcr.io/cross-rs/asmjs-unknown-emscripten:local |
| wasm32-unknown-emscripten | ghcr.io/cross-rs/wasm32-unknown-emscripten:local |
| x86_64-unknown-linux-gnu | ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main |
$ cross-util images list armv7-linux-androideabi
ghcr.io/cross-rs/armv7-linux-androideabi:main
You can also remove all these images, or those for a specific target.
# remove all images
$ cross-util images remove --execute
# remove only images matching the specific target
$ cross-util images remove armv7-linux-androideabi --execute
What's next? We've got some breaking changes for v0.3.0, including updating the base Ubuntu versions for our images from 16.04 to 20.04. Although using older glibc versions is great for backwards compatibility, many of us are working on newer codebases where binary compatibility with old glibc versions isn't required, so you can install a more modern toolset from the system package manager.