Skip to content
Open
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
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,15 @@ else
DOCKER_RELEASE_USER_ARGS = --user $(shell id -u):$(shell id -g)
endif

# Keep the Go caches inside the release container. The release script clears
# the build cache between platforms, so mounting the host cache would delete
# host entries and race with Go commands running outside the container.
# Trust only the checkout's fixed container path without changing host config.
DOCKER_RELEASE_ARGS = --rm $(DOCKER_RELEASE_USER_ARGS) \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 F1 (Minor) — Release CI may still cache now-unused Go cache paths · Makefile:191

Dropping the two mounts means every release run starts from an empty module cache and a cold build cache, so the container re-downloads the full module graph each time. docs/release.md states that .github/workflows/release.yaml runs make docker-release; that workflow is not in the provided context, so if it carries an actions/cache step keyed on the host GOCACHE/GOMODCACHE paths those mounts used to expose, that cache is now dead weight on every release and should be removed alongside this change.

-v $(shell bash -c "$(GOCC) env GOCACHE || (mkdir -p /tmp/go-cache; echo /tmp/go-cache)"):/tmp/build/.cache \
-v $(shell bash -c "$(GOCC) env GOMODCACHE || (mkdir -p /tmp/go-modcache; echo /tmp/go-modcache)"):/tmp/build/.modcache \
-e SKIP_VERSION_CHECK
-e SKIP_VERSION_CHECK \
-e GIT_CONFIG_COUNT=1 \
-e GIT_CONFIG_KEY_0=safe.directory \
-e GIT_CONFIG_VALUE_0=/tmp/build/wavelength

# ============
# DEPENDENCIES
Expand Down
9 changes: 9 additions & 0 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ $ make docker-release tag=<TAG>
Where `<TAG>` is the name of the next release of `wavelength`, e.g.
`v0.1.0-rc2`.

The release container only mounts the source checkout, which lets it write the
finished archives back to the host. Its Go build and module caches stay inside
the container and are discarded with it. The release build never reads,
writes, or clears the host's Go caches.

Allow at least 5 GB of free space in Docker's storage for these temporary

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 F2 (Minor) — 5 GB guidance unverified by a full-platform release · docs/release.md:38

The new disk-space figure and the "clears its build cache between target platforms" behavior only get exercised on a multi-platform run, but the PR's test notes cover sys=linux-amd64 only. One full make docker-release across all six BUILD_SYSTEM targets would confirm the container-local caches actually stay inside the documented budget before that number ships as guidance.

caches. The release clears its build cache between target platforms, and
Docker removes the remaining cache data when the container exits.

### Linux/Windows (WSL)

No prior set up beyond a pinned `go` toolchain (see `GO_VERSION` in the
Expand Down
6 changes: 2 additions & 4 deletions make/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ LABEL maintainer="Olaoluwa Osuntokun <laolu32@gmail.com>"
ENV GODEBUG=netdns=cgo
ENV CGO_ENABLED=0

# Set up cache directories. Those will be mounted from the host system to
# speed up builds. If go isn't installed on the host system, those will fall
# back to temp directories during the build (see the docker-release target in
# the Makefile).
# Keep Go caches in the container so release cache cleanup cannot modify or
# race with the host's Go caches.
ENV GOCACHE=/tmp/build/.cache
ENV GOMODCACHE=/tmp/build/.modcache

Expand Down
Loading