mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 11:45:53 +00:00
chore: Don't hardcode gcc version in ci/Dockerfile (#2337)
This commit is contained in:
1
.github/workflows/update_docker_ci.yml
vendored
1
.github/workflows/update_docker_ci.yml
vendored
@@ -326,6 +326,7 @@ jobs:
|
|||||||
build_args: |
|
build_args: |
|
||||||
GHCR_REPO=${{ needs.repo.outputs.GHCR_REPO }}
|
GHCR_REPO=${{ needs.repo.outputs.GHCR_REPO }}
|
||||||
CLANG_MAJOR_VERSION=${{ env.CLANG_MAJOR_VERSION }}
|
CLANG_MAJOR_VERSION=${{ env.CLANG_MAJOR_VERSION }}
|
||||||
|
GCC_MAJOR_VERSION=${{ env.GCC_MAJOR_VERSION }}
|
||||||
GCC_VERSION=${{ env.GCC_VERSION }}
|
GCC_VERSION=${{ env.GCC_VERSION }}
|
||||||
dockerhub_repo: rippleci/clio_ci
|
dockerhub_repo: rippleci/clio_ci
|
||||||
dockerhub_description: CI image for XRPLF/clio.
|
dockerhub_description: CI image for XRPLF/clio.
|
||||||
|
|||||||
@@ -60,27 +60,29 @@ RUN apt-get update \
|
|||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install gcc-12 and make ldconfig aware of the new libstdc++ location (for gcc)
|
ARG GCC_MAJOR_VERSION=invalid
|
||||||
|
|
||||||
|
# Install custom-built gcc and make ldconfig aware of the new libstdc++ location (for gcc)
|
||||||
# Note: Clang is using libc++ instead
|
# Note: Clang is using libc++ instead
|
||||||
COPY --from=clio-gcc /gcc12.deb /
|
COPY --from=clio-gcc /gcc${GCC_MAJOR_VERSION}.deb /
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
binutils \
|
binutils \
|
||||||
libc6-dev \
|
libc6-dev \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& dpkg -i /gcc12.deb \
|
&& dpkg -i /gcc${GCC_MAJOR_VERSION}.deb \
|
||||||
&& rm -rf /gcc12.deb \
|
&& rm -rf /gcc${GCC_MAJOR_VERSION}.deb \
|
||||||
&& ldconfig
|
&& ldconfig
|
||||||
|
|
||||||
# Rewire to use gcc-12 as default compiler
|
# Rewire to use our custom-built gcc as default compiler
|
||||||
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100 \
|
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_MAJOR_VERSION} 100 \
|
||||||
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-12 100 \
|
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${GCC_MAJOR_VERSION} 100 \
|
||||||
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 \
|
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_MAJOR_VERSION} 100 \
|
||||||
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-12 100 \
|
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${GCC_MAJOR_VERSION} 100 \
|
||||||
&& update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-12 100 \
|
&& update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-${GCC_MAJOR_VERSION} 100 \
|
||||||
&& update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-12 100 \
|
&& update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-${GCC_MAJOR_VERSION} 100 \
|
||||||
&& update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-12 100
|
&& update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-${GCC_MAJOR_VERSION} 100
|
||||||
|
|
||||||
COPY --from=clio-tools \
|
COPY --from=clio-tools \
|
||||||
/usr/local/bin/mold \
|
/usr/local/bin/mold \
|
||||||
|
|||||||
Reference in New Issue
Block a user