1
0
mirror of https://github.com/nushell/nushell.git synced 2025-07-13 04:46:17 +02:00

Add cross-rs config ()

Cross-compiling Nu can be a little tricky due to dependencies. This PR
makes it easy to use [`cross-rs`](https://github.com/cross-rs/cross), a
popular tool for cross-compiling Rust code using Docker:
```bash
cross build --target aarch64-unknown-linux-musl --release
```

I find this useful for compiling ARM binaries from x64. Easy to add more
target triples later as needed.
This commit is contained in:
Reilly Wood
2022-12-22 06:52:07 -08:00
committed by GitHub
parent ead6fbdf9c
commit 216d7d035f
3 changed files with 19 additions and 0 deletions

9
Cross.toml Normal file

@ -0,0 +1,9 @@
# Configuration for cross-rs: https://github.com/cross-rs/cross
# Run cross-rs like this:
# cross build --target aarch64-unknown-linux-musl --release
[target.aarch64-unknown-linux-gnu]
dockerfile = "./docker/cross-rs/aarch64-unknown-linux-gnu.dockerfile"
[target.aarch64-unknown-linux-musl]
dockerfile = "./docker/cross-rs/aarch64-unknown-linux-musl.dockerfile"

@ -0,0 +1,5 @@
FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:latest
RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install --assume-yes libssl-dev:arm64 clang

@ -0,0 +1,5 @@
FROM ghcr.io/cross-rs/aarch64-unknown-linux-musl:latest
RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install --assume-yes libssl-dev:arm64 clang