From 063e1bb97abb88fe1cbd27b745009ade75db7a84 Mon Sep 17 00:00:00 2001 From: Ron <45816308+rjaegers@users.noreply.github.com> Date: Sat, 28 Sep 2024 20:54:02 +0200 Subject: [PATCH] feat: add bash completion support to amp-devcontainer (#581) * feat: add bash completion support to amp-devcontainer * fix: patch root's .bashrc file to include completion --- .devcontainer/cpp/Dockerfile | 4 +++- .devcontainer/cpp/apt-requirements-base.json | 1 + .devcontainer/rust/Dockerfile | 4 +++- .devcontainer/rust/apt-requirements-base.json | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.devcontainer/cpp/Dockerfile b/.devcontainer/cpp/Dockerfile index 077288d7..baa819b7 100644 --- a/.devcontainer/cpp/Dockerfile +++ b/.devcontainer/cpp/Dockerfile @@ -95,10 +95,12 @@ RUN --mount=type=cache,target=/root/.ccache,sharing=locked \ && rm -rf /var/lib/apt/lists/* # Update all tool alternatives to the correct version +# and patch root's bashrc to include bash-completion RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-13 20 \ && update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-13 20 \ && update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-13 10 \ && update-alternatives --install /usr/bin/iwyu iwyu /usr/local/bin/include-what-you-use 10 \ && update-alternatives --install /usr/bin/mull-runner mull-runner /usr/local/bin/mull-runner-${CLANG_VERSION} 10 \ && update-alternatives --install /usr/lib/mull-ir-frontend mull-ir-frontend /usr/local/lib/mull-ir-frontend-${CLANG_VERSION} 10 \ - && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 + && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \ + && cp /etc/skel/.bashrc /root/.bashrc diff --git a/.devcontainer/cpp/apt-requirements-base.json b/.devcontainer/cpp/apt-requirements-base.json index d9bf491a..1aebf925 100644 --- a/.devcontainer/cpp/apt-requirements-base.json +++ b/.devcontainer/cpp/apt-requirements-base.json @@ -1,4 +1,5 @@ { + "bash-completion": "1:2.11-8", "ca-certificates": "20240203", "g++-13": "13.2.0-23ubuntu4", "gdb-multiarch": "15.0.50.20240403-0ubuntu1", diff --git a/.devcontainer/rust/Dockerfile b/.devcontainer/rust/Dockerfile index 90b7dc07..6dc5fa7f 100644 --- a/.devcontainer/rust/Dockerfile +++ b/.devcontainer/rust/Dockerfile @@ -39,7 +39,9 @@ RUN batstmp="$(mktemp -d /tmp/bats-core-${BATS_VERSION}.XXXX)" \ && git -C /usr/local clone -b v2.1.0 https://github.com/bats-core/bats-assert.git # Update all tool alternatives to the correct version -RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-13 20 +# and patch root's bashrc to include bash-completion +RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-13 20 \ + && cp /etc/skel/.bashrc /root/.bashrc # Install additional rust tools RUN wget -qO - "https://github.com/cargo-bins/cargo-binstall/releases/download/v${CARGO_BINSTALL_VERSION}/cargo-binstall-$(uname -m)-unknown-linux-gnu.tgz" | tar xz -C "/usr/bin" \ diff --git a/.devcontainer/rust/apt-requirements-base.json b/.devcontainer/rust/apt-requirements-base.json index c6abb64d..bfebe232 100644 --- a/.devcontainer/rust/apt-requirements-base.json +++ b/.devcontainer/rust/apt-requirements-base.json @@ -1,4 +1,5 @@ { + "bash-completion": "1:2.11-8", "ca-certificates": "20240203", "g++-13": "13.2.0-23ubuntu4", "git": "1:2.43.0-1ubuntu7.1",