Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/dev gcc #67

Merged
merged 2 commits into from
Jul 4, 2023
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
6 changes: 6 additions & 0 deletions ports/dev-gcc/.gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
python
import sys
sys.path.insert(0, '/usr/share/gcc/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
59 changes: 38 additions & 21 deletions ports/dev-gcc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# syntax=docker/dockerfile:1
ARG BASE
FROM ${BASE}

RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update \
&& apt-get install --no-install-recommends --yes \
apt-utils \
openssh-client \
gnupg2 \
Expand Down Expand Up @@ -49,20 +54,25 @@ RUN apt-get update \
zsh \
python3 \
pip \
&& apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/* \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen


RUN curl -s https://apt.llvm.org/llvm.sh | bash -s all \
&& apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install --yes --no-install-recommends \
nodejs \
&& apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/*
# Install LLVM.
# https://github.com/llvm/llvm-project/issues/62475
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
wget https://apt.llvm.org/llvm.sh \
&& chmod +x llvm.sh \
&& ./llvm.sh all || ./llvm.sh all

# Install Node.js.
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install --no-install-recommends --yes \
nodejs



Expand All @@ -78,27 +88,26 @@ WORKDIR /home/${USERNAME}



RUN apt-get update \
# Install GCC related tools.
COPY [".gdbinit", "/root"]
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update \
&& apt-get install --no-install-recommends --yes \
gdb \
pkg-config \
ninja-build \
doxygen \
graphviz \
gcovr \
&& apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/*
&& cp "/root/.gdbinit" "/home/${USERNAME}/.gdbinit" \
&& chown ${USER_UID}:${USER_UID} "/home/${USERNAME}/.gdbinit"



# Install CMake
ARG CMAKE_VERSION
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x86_64';; \
arm64) ARCH='aarch64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
RUN ARCH=$(dpkg-architecture --query DEB_HOST_GNU_CPU) \
&& TMP_DIR=$(mktemp -d -t cmake-${CMAKE_VERSION}-XXXX) \
&& echo "${TMP_DIR}" \
&& cd "${TMP_DIR}" \
Expand Down Expand Up @@ -135,3 +144,11 @@ RUN mkdir -p "${VCPKG_ROOT}" "${VCPKG_DOWNLOADS}" \
"${VCPKG_ROOT}/buildtrees" \
"${VCPKG_ROOT}/packages" \
"${VCPKG_DOWNLOADS}"/*

RUN sudo -u "${USERNAME}" VCPKG_FORCE_SYSTEM_BINARIES=1 vcpkg install \
catch2 \
&& rm -rf \
"${VCPKG_ROOT}/buildtrees" \
"${VCPKG_ROOT}/packages" \
"${VCPKG_DOWNLOADS}"/*

1 change: 0 additions & 1 deletion ports/dev-gcc/port.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: ghcr.io/lesomnus/dev-gcc
skip: true

args:
CMAKE_VERSION: "3.26.3"
Expand Down