Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(katana): cairo native #3067

Draft
wants to merge 3 commits into
base: katana/sn_0.13.4
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM rust:slim as chef
ARG CAIRO_NATIVE=false

# Install libclang and other necessary tools
RUN apt-get update && \
apt-get install -y clang llvm-dev libclang-dev git libtool automake autoconf make curl protobuf-compiler && \
rm -rf /var/lib/apt/lists/*
apt-get install -y clang llvm-dev libclang-dev git libtool automake autoconf make curl protobuf-compiler && \
rm -rf /var/lib/apt/lists/*

# Verify and set LIBCLANG_PATH environment variable
RUN find /usr -name "libclang.so*" && \
export LIBCLANG_PATH=$(find /usr -name "libclang.so*" | head -n 1 | xargs dirname)
export LIBCLANG_PATH=$(find /usr -name "libclang.so*" | head -n 1 | xargs dirname)

COPY rust-toolchain.toml .
RUN rustup install $(cat rust-toolchain.toml | grep channel | cut -d' ' -f3 | tr -d '"')
Expand All @@ -33,7 +34,13 @@ RUN cargo build --release --bins # pre-cache some stuff
COPY . .
ENV PATH="/root/.cargo/bin:${PATH}"

RUN cargo build --release --bins
RUN if [ "$CAIRO_NATIVE" = "true" ]; then \
# Install cairo-native dependencies
sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools; \
cargo build --release --bins --features cairo-native; \
else \
cargo build --release --bins; \
fi

FROM rust:1-alpine

Expand Down
Loading
Loading