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
4 changes: 2 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ What differs lies in `shared/`: the names of the volumes, the Jinja extension fo
of its own. And the Ubuntu packages a project names in `.devcontainer/apt-packages.txt`, which
the repository has only as a template: `shared/install.sh` installs gcc-avr and avr-libc, which
`tests/check.sh --no-arduino` and `--firmware` build with, as the template's CI does. The first `tests/check.sh` installs the Arduino core into the volume
`embedded-cpp-template-arduino15`, where it stays; uv's cache, the Codex, Claude Code and gh logins
and the shell history have volumes of their own as well.
`embedded-cpp-template-arduino15`, where it stays; uv's cache, ccache's, the Codex, Claude Code and
gh logins and the shell history have volumes of their own as well.

## Site-specific variants

Expand Down
5 changes: 5 additions & 0 deletions .devcontainer/shared/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
"target": "/home/vscode/.cache/uv",
"type": "volume"
},
{
"source": "embedded-cpp-template-ccache",
"target": "/home/vscode/.cache/ccache",
"type": "volume"
},
{
"source": "embedded-cpp-template-codex",
"target": "/home/vscode/.codex",
Expand Down
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ brings it.
includes, and include-cleaner asked a file that wrote `SREG` for that header, though
`<avr/io.h>` is the one to include. Found in MaxMatrix, which saves and restores `SREG` around
a write to a port.

On the update: nothing to do. A project that added `avr/common.h` to `IgnoreHeaders` itself, or
included it, can drop that.
- **ccache keeps its cache across a rebuild of the dev container:** it lay in
`~/.cache/ccache` on the container's own file system, which a rebuild throws away, so the first
`make check` after one compiled every host build again. The volume `<namespace>-ccache` keeps
it, as `<namespace>-uv-cache` keeps uv's.

On the update: rebuild the dev container; the volume of ccache starts empty and fills with the
first build. A project that added `avr/common.h` to `IgnoreHeaders` itself, or included it, can
drop that.

## v0.12.0

Expand Down
8 changes: 5 additions & 3 deletions template/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,17 @@ COPY llvm-headers.sh /tmp/llvm-headers.sh
RUN /tmp/llvm-headers.sh "${LLVM_MAJOR}" "/opt/llvm-${LLVM_MAJOR}/include" && \
rm /tmp/llvm-headers.sh

# The Arduino data directory and uv's cache are named volumes: the AVR core and its
# The Arduino data directory, uv's cache and ccache's are named volumes: the AVR core and its
# toolchain, and the checkers from PyPI, are downloaded on first use, and the volumes are
# what keep a rebuild from fetching them again. An empty named volume takes its ownership
# what keep a rebuild from fetching them again; ccache's keeps what the host builds compiled,
# which a rebuild would otherwise throw away. An empty named volume takes its ownership
# from the path it covers, so the path has to exist and belong to the remote user first,
# or nothing can write into it. `install -d` gives only the last component to the owner and
# creates missing parents as root, so ~/.cache is named on its own: a base image without it
# would otherwise leave it to root, and arduino-cli could not put its build cache there.
RUN install -d -o vscode -g vscode -m 0755 /home/vscode/.arduino15 && \
install -d -o vscode -g vscode -m 0755 /home/vscode/.cache /home/vscode/.cache/uv
install -d -o vscode -g vscode -m 0755 /home/vscode/.cache /home/vscode/.cache/uv \
/home/vscode/.cache/ccache

# The same arrangement for the logins a rebuild would otherwise throw away: Codex and Claude
# Code, whose extensions the shared feature installs, and gh, which every push and every pull request
Expand Down
3 changes: 2 additions & 1 deletion template/.devcontainer/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ home; `/usr/local/bin/clangd` links to the binary itself.

The Arduino core and its toolchain, and the checkers uv fetches, are not part of the image. They live
in the named volumes `{{ namespace }}-arduino15` and `{{ namespace }}-uv-cache`, so that a rebuild does not download them
again. Three more carry a login across a rebuild: `{{ namespace }}-codex` at `/home/vscode/.codex`,
again. What ccache compiled for the host builds lives in `{{ namespace }}-ccache` at `/home/vscode/.cache/ccache`, so
that the first build after a rebuild takes it from there rather than compiling everything again. Three more carry a login across a rebuild: `{{ namespace }}-codex` at `/home/vscode/.codex`,
`{{ namespace }}-claude` at `/home/vscode/.claude` (with `CLAUDE_CONFIG_DIR` pointing there, so that
Claude Code's `.claude.json` lands in it too) and `{{ namespace }}-gh` at `/home/vscode/.config/gh`, all at
mode 0700, as `gh` refuses a config directory others can enter. Those three hold credentials: do not share, export or remove one unless the login should go.
Expand Down
5 changes: 5 additions & 0 deletions template/.devcontainer/shared/devcontainer-feature.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
"target": "/home/vscode/.cache/uv",
"type": "volume"
},
{
"source": "{{ namespace }}-ccache",
"target": "/home/vscode/.cache/ccache",
"type": "volume"
},
{
"source": "{{ namespace }}-codex",
"target": "/home/vscode/.codex",
Expand Down
Loading