Skip to content

R1: the R9 build path (scripts/bootstrap-charly.sh) has an undocumented writable-$HOME/.cache precondition and fails opaquely without it #881

Open

Description

@aitrawog

What happened. Building the worktree-local binary — the build charly/AGENTS.md R9 mandates — fails with raw third-party errors when $HOME/.cache is read-only, which is the normal state of an agent file sandbox. Two runs, verbatim:

$ ./charly/scripts/bootstrap-charly.sh
bootstrap-charly: regenerating compiled-in plugin wiring
open /home/atrawog/.cache/go-build/a2/a2f398da36b8acb840b7444c2a3a8c45ce98cce46511233d94af411adef2574d-d: read-only file system

$ GOCACHE=<a workspace-local dir> ./charly/scripts/bootstrap-charly.sh
bootstrap-charly: regenerating compiled-in plugin wiring
pluginsgen: index plugin github.com/opencharly/plugin-addr: acquiring repo cache lock
/home/atrawog/.cache/charly/repos/github.com/opencharly/[email protected]: read-only file system
exit status 1

The second command shows the first remedy applied: redirecting GOCACHE gets past the Go half and then fails on the next unwritable root, so the failure arrives one cache at a time.

Mechanism. The build writes two roots outside the project tree, and neither is pre-flighted nor named anywhere:

  • Go's build cache — GOCACHE, default ~/.cache/go-build; Go honours both GOCACHE and XDG_CACHE_HOME.
  • charly's shared roots under os.UserCacheDir() — ~/.cache/charly/repos (the repo cache whose per-ref lock the pluginsgen step takes) and ~/.cache/charly/plugins (pluginBuildCacheDir(), charly/charly/plugin_loader.go:188). os.UserCacheDir() honours XDG_CACHE_HOME on Linux (Go's documented precedence), so both roots move together with that one variable.

Missed control. Nothing pre-flights either root, and no current doc names an override: charly/AGENTS.md:53 ("Build the CalVer-stamped, worktree-local binary with scripts/bootstrap-charly.sh") and the umbrella README.md ("build the binary once per clone with ./charly/scripts/bootstrap-charly.sh") both stop at the instruction. So the failure surfaces as a Go path error and a pluginsgen lock error, and the reader has to derive both the cause (the sandbox) and the remedy (an env var) from them.

Blast radius. Any agent session whose harness makes $HOME read-only cannot run the R9 build at all — measured in a session worktree that Part II #2 of the umbrella rulebook requires, and the only way through was widening the sandbox for one command, i.e. the manual-infrastructure shape R3 forbids. Two caches means two rounds of discovery, and no failure text points at the second.

Root fix (proposed, not implemented here). In scripts/bootstrap-charly.sh, pre-flight the writability of go env GOCACHE's parent and of os.UserCacheDir()'s root, and on failure print the remedy (GOCACHE=<dir> / XDG_CACHE_HOME=<dir>) rather than letting Go and pluginsgen report it; alternatively document the override in charly/AGENTS.md beside the build instruction. Either closes it mechanically; the pre-flight is the one that helps an agent that cannot read the AGENTS.md first.

Stated as source-derived, not yet tested under a read-only $HOME: the mechanism above is read from plugin_loader.go:188 and from Go's documented GOCACHE/XDG_CACHE_HOME precedence. The failure transcripts are verbatim from this session.

Agent: dsh-openclaw-forks
Assisted-by: DSH DeepSeek V4.1 Flash (analysed on a live system)

Activity

  1. added
    category:runtime
    type:fix
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:runtimetype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions