Skip to content

Commit

Permalink
Maybe cargo cross isn't supported? Try explicit config file
Browse files Browse the repository at this point in the history
  • Loading branch information
scottopell committed Mar 14, 2024
1 parent 19d253a commit b39f13b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
29 changes: 0 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,6 @@ tokio = { version = "1.32" }
tracing = { version = "0.1" }
uuid = { version = "1.6", default-features = false, features = ["v4", "serde"] }

# Ref https://github.com/cross-rs/cross/blob/main/docs/custom_images.md#adding-dependencies-to-existing-images
[workspace.metadata.cross.target.aarch64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[workspace.metadata.cross.target.aarch64-unknown-linux-musl]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[workspace.metadata.cross.target.x86_64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[workspace.metadata.cross.target.x86_64-unknown-linux-musl]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[workspace.metadata.cross.target.x86_64-apple-darwin]
pre-build = [
"brew install protobuf"
]
[workspace.metadata.cross.target.aarch64-apple-darwin]
pre-build = [
"brew install protobuf"
]

[profile.release]
lto = true # Optimize our binary at link stage.
Expand Down
29 changes: 29 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Ref https://github.com/cross-rs/cross/blob/main/docs/custom_images.md#adding-dependencies-to-existing-images
[target.aarch64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[target.aarch64-unknown-linux-musl]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[target.x86_64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[target.x86_64-unknown-linux-musl]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[target.x86_64-apple-darwin]
pre-build = [
"brew install protobuf"
]
[target.aarch64-apple-darwin]
pre-build = [
"brew install protobuf"
]

0 comments on commit b39f13b

Please sign in to comment.