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
32 changes: 22 additions & 10 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
# Everything else comes from features. This exists only because fish does not
# need a feature: Debian trixie ships fish 4.0.2, so installing it is one apt
# call, and doing it here bakes it into a cached image layer.
# Everything else comes from features. This exists only for packages that do
# not need one: Debian trixie ships both fish (the default shell, per
# devcontainer.json) and ripgrep, so installing them is one apt call, and
# doing it here bakes them into a cached image layer.
#
# ripgrep is here for the Todo Tree extension, which shells out to an `rg`
# binary. It used to find one inside VS Code itself, but it only ever probes
# four hardcoded paths under vscode.env.appRoot -- node_modules and
# node_modules.asar.unpacked, each joined with vscode-ripgrep/bin/rg or
# @vscode/ripgrep/bin/rg -- and VS Code now ships
# @vscode/ripgrep-universal/bin/<arch>/rg, which matches none of them. Every
# probe is a bare fs.existsSync, so the extension never consults PATH;
# installing the binary is necessary but not sufficient, and
# devcontainer.json has to point todo-tree.ripgrep at it explicitly.
#
# The alternative considered was ghcr.io/devcontainers-extra/features/fish-apt-get,
# which downloads the 20 MB nanolayer binary and runs it as root to invoke a
# second feature that runs exactly the apt call below -- more than twice the
# size of the package it installs, for a package the distribution already has.
FROM mcr.microsoft.com/devcontainers/typescript-node:5-24-trixie@sha256:b55b444f6658dd2370d430c12d4bc9540c8ed0d3d5b05e4c247161173666954f

# DL3008 wants `fish=4.0.2-1`. Pinning an apt package is not the same bargain
# as pinning an npm one: Debian drops superseded versions from the archive, so
# the first security update to fish would leave this asking for a version that
# no longer exists and fail the build outright. Nothing tracks apt pins to
# raise a PR the way renovate does for everything else here. The previous
# Dockerfile suppressed this same rule for the same reason.
# DL3008 wants these pinned, as in `fish=4.0.2-1`. Pinning an apt package is
# not the same bargain as pinning an npm one: Debian drops superseded versions
# from the archive, so the first security update to either package would leave
# this asking for a version that no longer exists and fail the build outright.
# Nothing tracks apt pins to raise a PR the way renovate does for everything
# else here. The previous Dockerfile suppressed this same rule for the same
# reason.
# skipcq: DOK-DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends fish \
&& apt-get install -y --no-install-recommends fish ripgrep \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
15 changes: 14 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,20 @@
"path": "fish"
}
},
"terminal.integrated.defaultProfile.linux": "fish"
"terminal.integrated.defaultProfile.linux": "fish",

// Where the Dockerfile's apt install puts ripgrep. Todo Tree probes
// only four hardcoded paths inside VS Code itself and never looks at
// PATH, so installing the binary does not on its own make the
// extension find it -- see the Dockerfile for the full reasoning.
//
// This lives here rather than in .vscode/settings.json because it is
// an absolute container path. That file is shared with anyone opening
// the repo outside this container, where /usr/bin/rg is usually wrong
// (Homebrew puts it in /opt/homebrew/bin). Being wrong there is
// harmless -- the extension falls through on a failed existsSync --
// but it would be stating something untrue of that environment.
"todo-tree.ripgrep.ripgrep": "/usr/bin/rg"
},
"extensions": [
// https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
Expand Down