Skip to content

Commit 714af77

Browse files
authored
Merge pull request #49 from tidewave-ai/sd-fix-build
cross compile with zig for linux
2 parents a8da08f + 848d047 commit 714af77

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ jobs:
7979
- name: Setup Rust
8080
uses: dtolnay/rust-toolchain@stable
8181

82+
- name: Install Zig
83+
if: startsWith(matrix.platform, 'ubuntu')
84+
shell: bash
85+
run: |
86+
wget -q https://ziglang.org/download/0.15.2/zig-x86_64-linux-0.15.2.tar.xz
87+
tar -xf zig-x86_64-linux-0.15.2.tar.xz
88+
sudo mv zig-x86_64-linux-0.15.2 /usr/local/zig
89+
echo "/usr/local/zig" >> $GITHUB_PATH
90+
91+
- name: Install zigbuild
92+
run: cargo install --locked cargo-zigbuild
93+
8294
- name: Rust cache
8395
uses: Swatinem/rust-cache@v2
8496
with:
@@ -92,8 +104,6 @@ jobs:
92104
run: |
93105
sudo apt-get update
94106
sudo apt-get install -y \
95-
gcc-aarch64-linux-gnu \
96-
musl-tools \
97107
libwebkit2gtk-4.1-dev \
98108
libgtk-3-dev \
99109
libayatana-appindicator3-dev \
@@ -173,14 +183,11 @@ jobs:
173183
echo "Building CLI for $target"
174184
rustup target add "$target"
175185
176-
# Set linker for aarch64 cross-compilation
177-
if [[ "$target" == "aarch64-unknown-linux-gnu" ]]; then
178-
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
179-
elif [[ "$target" == "aarch64-unknown-linux-musl" ]]; then
180-
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc
186+
if [[ "$target" == "aarch64-unknown-linux-gnu" || "$target" == "aarch64-unknown-linux-musl" || "$target" == "x86_64-unknown-linux-musl" ]]; then
187+
cargo zigbuild -p tidewave-cli --release --target $target
188+
else
189+
cargo build -p tidewave-cli --release --target $target
181190
fi
182-
183-
cargo build -p tidewave-cli --release --target $target
184191
done
185192
186193
- name: Sign CLI binaries (macos)

tidewave-core/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pub async fn serve_http_server_with_shutdown(
145145
listener: TcpListener,
146146
shutdown_signal: impl std::future::Future<Output = ()> + Send + 'static,
147147
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
148-
let _ = rustls::crypto::ring::default_provider().install_default();
148+
let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
149149
let client = Client::builder()
150150
.use_preconfigured_tls(ClientConfig::with_platform_verifier())
151151
.build()?;

0 commit comments

Comments
 (0)