Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
image-tag: ${{ steps.format-tag.outputs.tag }}

steps:
- name: Free up disk space
run: |
sudo apt-get clean
sudo apt-get autoremove -y
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
df -h

- name: Checkout code
uses: actions/checkout@v4

Expand Down
44 changes: 21 additions & 23 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,25 @@ RUN apt-get update && apt-get install -y \
WORKDIR /gcc-build

RUN git clone --depth 1 --branch "releases/gcc-${GCC_VERSION}" --single-branch \
https://mirrors.tuna.tsinghua.edu.cn/git/gcc.git gcc-source

WORKDIR /gcc-build/gcc-source

RUN mkdir -p /gcc-build/gcc-build
WORKDIR /gcc-build/gcc-build

RUN ../gcc-source/configure \
--disable-multilib \
--enable-languages=c,c++,fortran \
--prefix=/usr/local \
&& make -j$(nproc) \
&& make install
https://mirrors.tuna.tsinghua.edu.cn/git/gcc.git gcc-source && \
mkdir -p gcc-build && \
cd gcc-build && \
../gcc-source/configure \
--disable-multilib \
--enable-languages=c,c++,fortran \
--prefix=/usr/local && \
make -j$(nproc) && \
make install && \
cd / && \
rm -rf /gcc-build

WORKDIR /llvm-build
RUN git clone --depth 1 --branch "llvmorg-${LLVM_VERSION}" --single-branch \
https://mirrors.tuna.tsinghua.edu.cn/git/llvm-project.git llvm-project

RUN mkdir -p /llvm-build/build
WORKDIR /llvm-build/build

RUN cmake -G Ninja \
RUN git clone --depth 1 --branch "llvmorg-${LLVM_VERSION}" --single-branch \
https://mirrors.tuna.tsinghua.edu.cn/git/llvm-project.git llvm-project && \
mkdir -p build && \
cd build && \
cmake -G Ninja \
-DLLVM_ENABLE_PROJECTS="clang;lld;flang" \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_CXX_STD=ON \
Expand All @@ -83,7 +80,11 @@ RUN cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr/local \
../llvm-project/llvm && \
ninja && \
ninja install
ninja install && \
cd / && \
rm -rf /llvm-build

WORKDIR /

ENV PATH="/usr/local/bin:${PATH}"
ENV LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64"
Expand All @@ -104,9 +105,6 @@ RUN echo "=== GCC ===" && \
echo "Clang version: $(clang --version | head -n1)" && \
echo "Flang version: $(flang --version | head -n1)"

WORKDIR /
RUN rm -rf /gcc-build /llvm-build

WORKDIR /workspace

LABEL maintainer="luohaothu"
Expand Down
Loading