Skip to content

Instantly share code, notes, and snippets.

@lazamar
Last active October 1, 2025 08:33
Show Gist options
  • Save lazamar/9dd97c0c7520bcd91f76a4256a71cdc9 to your computer and use it in GitHub Desktop.
Save lazamar/9dd97c0c7520bcd91f76a4256a71cdc9 to your computer and use it in GitHub Desktop.
Build Glean in aarch64
FROM debian:trixie-slim
ENV HOME="/root"
ENV LOCAL_BIN="$HOME/.local/bin"
ENV PATH="$PATH:$LOCAL_BIN:$HOME/.hsthrift/bin:$HOME/.ghcup/bin"
ENV LD_LIBRARY_PATH="$HOME/.hsthrift/lib"
ENV PKG_CONFIG_PATH="$HOME/.hsthrift/lib/pkgconfig"
ENV CABAL_CONFIG_FLAGS="-f-bundled-folly -fclang -f-hack-tests -f-rust-tests -f-python-tests"
ENV CLANG_VER="19"
# System dependencies
RUN apt-get update && apt-get install -y \
build-essential \
clang-$CLANG_VER \
cmake \
curl \
git \
libaio-dev \
libboost-all-dev \
libbz2-dev \
libdouble-conversion-dev \
libdwarf-dev \
libfast-float-dev \
libgmock-dev \
libgmp-dev \
libgoogle-glog-dev \
libgtest-dev \
libiberty-dev \
libjemalloc-dev \
liblz4-dev \
liblzma-dev \
libnuma-dev \
libpcre2-dev \
librocksdb-dev \
libsnappy-dev \
libsodium-dev \
libssl-dev \
libtinfo-dev \
libunwind-dev \
libxxhash-dev \
libzstd-dev \
make \
ninja-build \
pkg-config \
rsync \
wget
# Install libpcre3-dev, which is deprecated in debian trixie, but needed for regex-pcre
RUN sed -i 's/trixie-updates/trixie-updates bullseye/' /etc/apt/sources.list.d/debian.sources
RUN apt-get update && apt-get install -y libpcre3-dev
# Install clang
RUN apt-get remove -y gcc g++
RUN apt-get autoremove -y
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-$CLANG_VER 10
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-$CLANG_VER 10
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-$CLANG_VER 10
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-$CLANG_VER 10
# Install GHC and Cabal
RUN mkdir -p "$LOCAL_BIN"
RUN curl --proto '=https' --tlsv1.2 -sSf "https://downloads.haskell.org/~ghcup/aarch64-linux-ghcup" -o "$LOCAL_BIN/ghcup" && chmod +x "$LOCAL_BIN/ghcup"
RUN chmod +x "$LOCAL_BIN/ghcup"
RUN ghcup install cabal 3.10 --set
RUN ghcup install ghc 9.6.7 --set
RUN git clone https://github.com/facebookincubator/Glean.git
WORKDIR /Glean
# Build deps
RUN ./install_deps.sh --threads $(nproc) --use-system-libs
# Free-up some space
RUN rm -rf /tmp/fbcode_builder_getdeps-Z__wZGleanZGleanZhsthriftZbuildZfbcode_builder-root/
RUN (cd hsthrift && make setup-folly && make setup-folly-version)
# Build Glean
RUN cabal update
RUN make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment