Skip to content

charly box build --no-cache is a dead flag: accepted, plumbed, read by nothing #483

Closed
opencharly/plugin-build
#24

Description

@atrawog

charly box build --no-cache is accepted, documented, plumbed into spec.BuildRequest.NoCache — and read by nothing. The build uses the layer cache exactly as if the flag were absent, and exits 0, so the operator gets a silently-cached build while believing they forced a cold one.

Why it matters

This is the flag you reach for precisely when you do not trust the cache: proving a candy's build steps actually emit what its checks assert, reproducing a build failure someone else saw, or — the case that found this — producing gate output that shows a layer's real warnings rather than the silence of a cache hit.

A dead --no-cache fails in the worst direction. It does not error; it hands back a cached build wearing the label of a cold one. Any PR body that pastes "built with --no-cache" as evidence is then making a claim the tooling did not support, and neither the author nor a reviewer can tell from the output.

Evidence

NoCache has exactly two non-test occurrences in the whole tree outside the generated spec struct:

$ grep -rn --include='*.go' 'NoCache' charly/ sdk/ spec/spec/ | grep -v _test
charly/.build/_candy/plugin-box.2026.194.0000/box.go:233:	NoCache bool `name:"no-cache" help:"Disable build cache entirely"`
charly/.build/_candy/plugin-box.2026.194.0000/box.go:279:		NoCache:         g.NoCache,
spec/spec/cue_types_gen.go:1663:	NoCache bool `yaml:"no_cache,omitempty" json:"no_cache,omitempty"`
spec/spec/cue_types_gen.go:2921:	NoCache bool `yaml:"no_cache,omitempty" json:"no_cache,omitempty"`

The declaration and the assignment into the request. No read.

The podman flag string it would have to become appears in no non-test Go file at all:

$ grep -rn --include='*.go' -- '--no-cache' charly/ sdk/ | grep -v _test
(no matches)

Only two test files mention it, both asserting the flag parses — never that it reaches the engine:

charly/.build/_candy/plugin-box.2026.194.0000/box_test.go:179:	if !g.NoCache {
charly/.build/_candy/plugin-box.2026.194.0000/box_test.go:180:		t.Error("NoCache = false, want true")

That is why this survived: the flag has test coverage, and the coverage stops one layer above the defect.

Reproduction

$ charly box build omarchy-cstream --no-cache
...
STEP 2/18: RUN --mount=type=cache,id=charly-var-cache-pacman-pkg,...
--> Using cache 058a8e9508c12b3b5910b1eec0e3368575abb40cc50d697e901939b53c2f6eb4
--> 058a8e9508c1
...
exit=0

126 Using cache lines in a build that was asked not to use the cache. The subsequent charly check run on the same box reported [image-build] PASS after 30.203s [allowlisted=1 cache=126/136] — 126 of 136 layers served from cache.

CHARLY_BUILD_CACHE=none is not the workaround it looks like: --cache selects the export cache type (registry / image / gha / none), which is a different mechanism from the local layer cache, and it makes no difference here either.

Two ways to fix, and they are not equivalent

  1. Wire it. BuildRequest.NoCache reaches the engine and becomes podman's --no-cache. Note this alone still would not give a fully cold build: the pacman package cache is a --mount=type=cache volume that survives --no-cache, so a candy's pacman -S still resolves from cached packages. If the flag is meant to mean "cold", that mount has to be part of the answer, and the help text should say which of the two it means.

  2. Delete it. If nothing should force a cold build, the flag, the request field and the two tests that assert it parses all go (R5). A flag that does nothing is worse than no flag.

I have no standing to pick between these — that is a build-engine ownership call. Filing rather than fixing, with the evidence, so it is routed rather than parked.

Found while building distro-omarchy's GUI box, where I needed a cold build to show a layer's real pacman diagnostics in gate output and got a cached one that reported success.

Activity

  1. aitrawog commented on Oct 7, 2026

    @aitrawog
    Contributor

    CLAIM — taking this. Re-derivation first: the flag IS read (the author's grep covered charly/, sdk/, spec/spec/ but not the plugin repos) — candy/plugin-build/podman.go's cacheArgs reads driveConfig.NoCache (drive.go:73 copies req.NoCache) and returns nil, so it skips --cache-from. That matches the repro (126 Using cache lines): the flag is read, but it only skips the EXPORT cache — the LOCAL layer cache still serves. Fix: pass the engine's own --no-cache so the local layer cache is bypassed too. PR to opencharly/plugin-build.

    Agent: issue-recheck · session 01a11333-b8e3-778e-b58d-c5e348543fde
    Assisted-by: pi ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

  2. self-assigned this
    on Oct 7, 2026
  3. aitrawog commented on Oct 7, 2026

    @aitrawog
    Contributor

    RESOLVED — charly box build --no-cache now bypasses the local layer cache.

    Producer: opencharly/plugin-build#24 — MERGED (0f3a935, tag v2026.280.0647). cacheArgs now returns the engine's own --no-cache for a no-cache build (--no-cache / --cache none), instead of returning nil.

    Consumer: #820 — MERGED (24d3927) — bumps plugin-build to v0.2026280.647, shipping the fix to charly.

    Re-derivation (the issue's "read by nothing" premise was wrong). The grep covered charly/, sdk/, spec/spec/ but not the plugin repos: candy/plugin-build/drive.go:73 copies req.NoCache into driveConfig.NoCache, and podman.go's cacheArgs read it — returning nil. So the flag was read; it just skipped only the --cache-from EXPORT, and the LOCAL layer cache still served (the 126/136 you measured).

    Fresh-rebuild LIVE A/B on the merged plugin code:

    $ ./charly/bin/charly box build charly.arch.arch              # warm
    warm_exit=0  cache_hits=12
    $ ./charly/bin/charly box build charly.arch.arch --no-cache
    nocache_exit=0  cache_hits=0
    

    Scope note, as your body asked: this does not defeat a --mount=type=cache package mount (a pacman/dnf package cache survives --no-cache by design) — the flag now means "cold layer cache", which is what its help says. The package-mount question you named stays open as its own concern, not silently implied.

    Agent: issue-recheck · session 01a11333-b8e3-778e-b58d-c5e348543fde
    Assisted-by: pi ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions