Skip to content

Commit

Permalink
[CI] Reduce set of build dependencies
Browse files Browse the repository at this point in the history
Be more intentional about what dependencies we use. This should make CI
run a bit faster.
  • Loading branch information
fhanau committed May 24, 2024
1 parent d171ae2 commit 18ec565
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ FROM mcr.microsoft.com/devcontainers/base:jammy
# will also install lldb and clangd alongside dependencies.
ARG LLVM_VERSION=15
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install software-properties-common python3 python3-distutils tclsh \
&& apt-get -y install --no-install-recommends --no-install-suggests software-properties-common python3 python3-distutils tclsh \
&& curl -fSsL -o /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && bash /tmp/llvm.sh ${LLVM_VERSION} \
&& apt-get -y install --no-install-recommends libunwind-${LLVM_VERSION} libc++abi1-${LLVM_VERSION} libc++1-${LLVM_VERSION} libc++-${LLVM_VERSION}-dev libclang-rt-${LLVM_VERSION}-dev -o DPkg::options::="--force-overwrite"
&& apt-get -y install --no-install-recommends --no-install-suggests libc++abi-${LLVM_VERSION}-dev libc++-${LLVM_VERSION}-dev -o DPkg::options::="--force-overwrite"
ENV PATH /usr/lib/llvm-${LLVM_VERSION}/bin:$PATH

# Install NodeJS
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ jobs:
- name: Setup Linux
if: runner.os == 'Linux'
run: |
sudo echo "APT::Install-Recommends \"0\";" >> /etc/apt/apt.conf
sudo echo "APT::Install-Suggests \"0\";" >> /etc/apt/apt.conf
export DEBIAN_FRONTEND=noninteractive
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15
sudo apt-get install -y libunwind-15 libc++abi1-15 libc++1-15 libc++-15-dev
sudo apt-get install -y libc++-15-dev
echo "build:linux --action_env=CC=/usr/lib/llvm-15/bin/clang --action_env=CXX=/usr/lib/llvm-15/bin/clang++" >> .bazelrc
echo "build:linux --host_action_env=CC=/usr/lib/llvm-15/bin/clang --host_action_env=CXX=/usr/lib/llvm-15/bin/clang++" >> .bazelrc
- name: Setup macOS
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,23 @@ jobs:
# resulting in a snowballing cache size and cache download/upload times.
- name: Setup Linux
if: matrix.os.name == 'linux'
# Install dependencies, including clang via through LLVM APT repository. Note that this
# Install dependencies, including clang through the LLVM APT repository. Note that this
# will also install lldb and clangd alongside dependencies, which can be removed with
# `sudo apt-get remove -y lldb-15 clangd-15; sudo apt-get autoremove -y` if space is
# limited.
# libunwind, libc++abi1 and libc++1 should be automatically installed as dependencies of
# libc++, but this appears to cause errors so they are also being explicitly installed.
# libunwind and libc++abi will be automatically installed as dependencies of libc++-dev,
# using Install-Recommends false helps us keep the install overhead low.
# Since the GitHub runner image comes with a number of preinstalled packages, we don't need
# to use APT much otherwise.
# TODO(cleanup): Upgrade this to LLVM 16 as soon as it is available on the latest Ubuntu
# LTS release. Debian includes LLVM 16 since the Bookworm 12.4 point release.
run: |
export DEBIAN_FRONTEND=noninteractive
wget https://apt.llvm.org/llvm.sh
sed -i '/apt-get install/d' llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15
sudo apt-get install -y libunwind-15 libc++abi1-15 libc++1-15 libc++-15-dev libclang-rt-15-dev
sudo apt-get install -y --no-install-recommends clang-15 lld-15 libunwind-15 libc++abi1-15 libc++1-15 libc++-15-dev libclang-rt-15-dev
echo "build:linux --action_env=CC=/usr/lib/llvm-15/bin/clang --action_env=CXX=/usr/lib/llvm-15/bin/clang++" >> .bazelrc
echo "build:linux --host_action_env=CC=/usr/lib/llvm-15/bin/clang --host_action_env=CXX=/usr/lib/llvm-15/bin/clang++" >> .bazelrc
sed -i -e "s%llvm-symbolizer%/usr/lib/llvm-15/bin/llvm-symbolizer%" .bazelrc
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ FROM node:bullseye AS builder

WORKDIR /workerd

RUN echo "APT::Install-Recommends \"0\";" >> /etc/apt/apt.conf
RUN echo "APT::Install-Suggests \"0\";" >> /etc/apt/apt.conf
RUN apt-get update
RUN apt-get install -y curl build-essential git lsb-release wget software-properties-common gnupg

RUN wget https://apt.llvm.org/llvm.sh
RUN chmod +x llvm.sh
RUN ./llvm.sh 15 all
RUN ./llvm.sh 15
RUN apt-get install -y libc++-15-dev
COPY . .

RUN echo "build:linux --action_env=CC=/usr/lib/llvm-15/bin/clang --action_env=CXX=/usr/lib/llvm-15/bin/clang++" >> .bazelrc
Expand Down

0 comments on commit 18ec565

Please sign in to comment.