Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c995ee45fb |
+10
-5
@@ -50,10 +50,14 @@ ARG CHECK_EPOCH
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# This cache mount keeps Go's build cache between builds for make test and
|
# Go's build cache is kept between builds in this cache mount, which make test
|
||||||
# make build; -count=1 in script/test keeps test results out of it. Go's cache
|
# and make build both use, so each compiles only what changed since the last
|
||||||
# does not notice C header changes, so the mount has its own id: change the id
|
# build, not the standard library and every dependency from nothing.
|
||||||
# when the C packages installed above change.
|
# script/test passes -count=1, so test results are never taken from it.
|
||||||
|
# The mount has its own id because the default id, its path, is shared with
|
||||||
|
# other repositories' builds, and Go's cache does not notice changes to C
|
||||||
|
# libraries: an entry compiled there against other C headers could be reused
|
||||||
|
# here. It does not notice a change of this image's own C headers either.
|
||||||
RUN --mount=type=cache,id=sneak/secret/go-build,target=/root/.cache/go-build \
|
RUN --mount=type=cache,id=sneak/secret/go-build,target=/root/.cache/go-build \
|
||||||
make test
|
make test
|
||||||
|
|
||||||
@@ -61,7 +65,8 @@ RUN --mount=type=cache,id=sneak/secret/go-build,target=/root/.cache/go-build \
|
|||||||
# is given, otherwise `git describe --tags --always` of the .git the build
|
# is given, otherwise `git describe --tags --always` of the .git the build
|
||||||
# context carries: the tag on a tagged commit, tag-N-gHASH on a commit after
|
# context carries: the tag on a tagged commit, tag-N-gHASH on a commit after
|
||||||
# one, the short commit when no tag is reachable. A context that carries .git
|
# one, the short commit when no tag is reachable. A context that carries .git
|
||||||
# and still yields no version fails the build.
|
# and still yields no version fails the build. make build uses the same Go
|
||||||
|
# build cache mount as make test.
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
RUN --mount=type=cache,id=sneak/secret/go-build,target=/root/.cache/go-build \
|
RUN --mount=type=cache,id=sneak/secret/go-build,target=/root/.cache/go-build \
|
||||||
version="${VERSION:-$(git describe --tags --always)}"; \
|
version="${VERSION:-$(git describe --tags --always)}"; \
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ https://git.eeqj.de/sneak/secret/milestone/12
|
|||||||
library and every dependency from nothing on every build
|
library and every dependency from nothing on every build
|
||||||
(https://git.eeqj.de/sneak/secret/issues/124). The `Dockerfile` runs it and
|
(https://git.eeqj.de/sneak/secret/issues/124). The `Dockerfile` runs it and
|
||||||
`make build` with Go's build cache in a BuildKit cache mount, which docker
|
`make build` with Go's build cache in a BuildKit cache mount, which docker
|
||||||
keeps between builds, so each compiles only what changed since the last build.
|
keeps between builds, locally and on the Gitea runner alike, so each compiles
|
||||||
The mount has an id of its own, so other repositories' builds do not share it.
|
only what changed since the last build. The mount has an id of its own, so
|
||||||
`script/test` passes `-count=1`, so every test runs on every build and no
|
other repositories' builds do not share it. `script/test` passes `-count=1`,
|
||||||
result comes from Go's test cache. A build with an empty cache, such as the
|
so every test runs on every build and no result comes from Go's test cache. A
|
||||||
first after docker's build cache is cleared, compiles everything in
|
build with an empty cache, such as the first after docker's build cache is
|
||||||
`make test` as before.
|
cleared, compiles everything in `make test` as before.
|
||||||
- 2026-10-06: The tests run quickly with the race detector on
|
- 2026-10-06: The tests run quickly with the race detector on
|
||||||
(https://git.eeqj.de/sneak/secret/issues/120). Most of their time went to
|
(https://git.eeqj.de/sneak/secret/issues/120). Most of their time went to
|
||||||
deriving keys from passphrases with scrypt, which is slow on purpose. The new
|
deriving keys from passphrases with scrypt, which is slow on purpose. The new
|
||||||
|
|||||||
Reference in New Issue
Block a user