From 500f7a1c7200c2ec58c52878f00c2da8b28b3f27 Mon Sep 17 00:00:00 2001 From: hanabi1224 Date: Wed, 15 May 2024 22:11:37 +0800 Subject: [PATCH] fix(ci): rust build issues in lotus devnet dockerfile (#4327) --- scripts/devnet/lotus.dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/devnet/lotus.dockerfile b/scripts/devnet/lotus.dockerfile index e8ebfb84e382..c2edf960e4eb 100644 --- a/scripts/devnet/lotus.dockerfile +++ b/scripts/devnet/lotus.dockerfile @@ -1,14 +1,22 @@ # Lotus binaries image, to be used in the local devnet with Forest. FROM golang:1.21-bullseye AS lotus-builder -RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev +RUN apt-get update && apt-get install -y curl ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev WORKDIR /lotus +# Install rust toolchain for rebuilding `filecoin-ffi` +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --profile minimal + +ENV PATH="/root/.cargo/bin:${PATH}" + RUN git clone --depth 1 --branch v1.26.1 https://github.com/filecoin-project/lotus.git . +# https://github.com/Filecoin-project/filecoin-ffi?tab=readme-ov-file#building-from-source RUN CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" \ CGO_CFLAGS="-D__BLST_PORTABLE__" \ + FFI_USE_BLST_PORTABLE="1" \ + FFI_USE_GPU="0" \ make 2k && strip lotus* FROM ubuntu:22.04