cairo_native icon indicating copy to clipboard operation
cairo_native copied to clipboard

Issue with Dockerfile

Open varex83 opened this issue 1 year ago • 3 comments
trafficstars

I was trying run Juno node with blockifier + cairo native, and got stuck on building the Dockerfile, after that I checked Dockerfile in the cairo native repo from main branch (rev. e9bc96aaa408e388f079c1f95ef8427e1fa52abe), and got strange error:

image
Dockerfile
FROM debian:12

# Install dependencies
RUN apt update -y && apt install -y lsb-release \
    wget \
    curl \
    git \
    build-essential \
    libclang-dev \
    libz-dev \
    libzstd-dev

# Install LLVM 17
RUN echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-17 main" > /etc/apt/sources.list.d/llvm-17.list
RUN echo "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-17 main" >> /etc/apt/sources.list.d/llvm-17.list
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt update -y && apt install -y llvm-17 \
    libmlir-17-dev \
    mlir-17-tools \
    libpolly-17-dev

# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Copy cairo_native code
COPY . /cairo_native/

# Compile cairo_native
WORKDIR /cairo_native/
ENV MLIR_SYS_170_PREFIX=/usr/lib/llvm-17
ENV LLVM_SYS_170_PREFIX=/usr/lib/llvm-17
ENV TABLEGEN_170_PREFIX=/usr/lib/llvm-17
RUN make deps
RUN make build

I'm building it with docker build .. Let me know if you need more details! 🙏

varex83 avatar May 09 '24 12:05 varex83

Looks like the error only happens if the host is macOS. I have no control over tblgen-rs but with melior 0.18.0+ it uses my updated fork, which i can fix, i think right now the only thing you can do is run the dockerfile from a linux host or wait for the llvm 18 pr to land, which will take a bit.

edg-l avatar May 09 '24 13:05 edg-l

thanks for the response a lot!

varex83 avatar May 09 '24 13:05 varex83

had the same error and @tcoratger gave me a workaround: docker build --platform linux/amd64 -t image_tag .

greged93 avatar May 13 '24 11:05 greged93