Skip to content

Commit

Permalink
Fix cross-compiling with cross-rs (nushell#9972)
Browse files Browse the repository at this point in the history
I cross-compiled Nushell (from x64 to ARM64) for the first time in a
while and noticed that our [`cross-rs`](https://github.com/cross-rs)
setup was no longer working. I've fixed that by following [the latest
`cross-rs`
docs](https://github.com/cross-rs/cross/wiki/Recipes#openssl).
  • Loading branch information
rgwood committed Aug 10, 2023
1 parent 6f5bd62 commit f94df58
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
15 changes: 12 additions & 3 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Configuration for cross-rs: https://github.com/cross-rs/cross
# Run cross-rs like this:
# cross build --target aarch64-unknown-linux-musl --release
# cross build --target aarch64-unknown-linux-gnu --release
# or
# cross build --target aarch64-unknown-linux-musl --release --features=static-link-openssl

[target.aarch64-unknown-linux-gnu]
dockerfile = "./docker/cross-rs/aarch64-unknown-linux-gnu.dockerfile"
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH clang"
]

# NOTE: for musl you will need to build with --features=static-link-openssl
[target.aarch64-unknown-linux-musl]
dockerfile = "./docker/cross-rs/aarch64-unknown-linux-musl.dockerfile"
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes clang"
]
5 changes: 0 additions & 5 deletions docker/cross-rs/aarch64-unknown-linux-gnu.dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions docker/cross-rs/aarch64-unknown-linux-musl.dockerfile

This file was deleted.

0 comments on commit f94df58

Please sign in to comment.