Skip to content

Commit

Permalink
ci: remove windows aarch64 target + use clang
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffijoe committed Jun 13, 2023
1 parent 49406be commit 1ca27de
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ linker = "arm-linux-gnueabihf-gcc"
[target.x86_64-unknown-linux-musl]
linker = "rust-lld"

[target.i686-unknown-linux-musl]
linker = "rust-lld"

# Use the sparse registry protocol for Cargo.
[registries.crates-io]
protocol = "sparse"
14 changes: 10 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ jobs:
os: windows-latest
artifact_name: deltio.exe
asset_name: deltio-${{ needs.tag.outputs.tag }}-windows-x86_64
- target: aarch64-pc-windows-msvc
os: windows-latest
artifact_name: deltio.exe
asset_name: deltio-${{ needs.tag.outputs.tag }}-windows-aarch64

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -180,6 +177,15 @@ jobs:
sudo apt-get install -y ${{ matrix.install_linker }}
fi
# We need to use clang because `ring` (used by `rustls`) won't compile with gcc.
- name: Configure clang as C and C++ compiler (Linux)
# Don't use clang for aarch64 musl Linux, as we're installing a special cross-compiler
# for that target.
if: ${{ matrix.os == 'ubuntu-latest' && matrix.target != 'aarch64-unknown-linux-musl' }}
run: |
echo "CC=clang" >> "$GITHUB_ENV"
echo "CXX=clang++" >> "$GITHUB_ENV"
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
Expand Down
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM --platform=$BUILDPLATFORM rust:1.69 as build

# Install Protocol Buffers.
RUN apt-get update && apt-get install -y protobuf-compiler musl-tools musl-dev
RUN apt-get update && apt-get install -y protobuf-compiler clang musl-tools musl-dev

# Create a new empty project.
RUN cargo new --bin deltio
Expand Down Expand Up @@ -60,6 +60,12 @@ RUN <<EOF
# If the build platform is the same as the target platform, we don't
# need to use any target.
TARGET=$(cat .target)
# Use clang except for aarch64 musl
if [ "$TARGET" != "aarch64-unknown-linux-musl" ]; then
export CC="clang"
export CXX="clang++"
fi

if [ -z "$TARGET" ]; then
cargo build --release
rm ./target/release/deps/deltio*
Expand All @@ -83,6 +89,13 @@ RUN <<EOF
# If the build platform is the same as the target platform, we don't
# need to use any target.
TARGET=$(cat .target)

# Use clang except for aarch64 musl
if [ "$TARGET" != "aarch64-unknown-linux-musl" ]; then
export CC="clang"
export CXX="clang++"
fi

if [ -z "$TARGET" ]; then
cargo build --release
exit 0
Expand Down

0 comments on commit 1ca27de

Please sign in to comment.