Skip to content

Commit

Permalink
feat: add bash completion support to amp-devcontainer (#581)
Browse files Browse the repository at this point in the history
* feat: add bash completion support to amp-devcontainer

* fix: patch root's .bashrc file to include completion
  • Loading branch information
rjaegers authored Sep 28, 2024
1 parent cc9380c commit 063e1bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/cpp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .devcontainer/cpp/apt-requirements-base.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/rust/apt-requirements-base.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 063e1bb

Please sign in to comment.