Repository navigation
Description
Symptom
On a target: vm deploy, a candy's copy: step does not deliver its file. The
destination directory is created, and every other verb in the SAME candy on the SAME
deploy applies normally — only copy: is missing.
Measured
Candy punktfunk (opencharly/layer-punktfunk), applied to an Arch cloud-image VM via
add_candy: on a disposable bed, charly built from v2026.241.1535+1.
The candy's plan contains, in order:
- run: create the user's local bin directory
mkdir: "${HOME}/.local/bin"
run_as: "${USER}"
- run: install the punktfunk-host launcher wrapper for the container venue
copy: punktfunk-host-wrapper # sits beside charly.yml in the candy dir
to: "${HOME}/.local/bin/punktfunk-host-wrapper"
mode: "0755"
run_as: "${USER}"
- run: write the host.env policy file ...
write: "${HOME}/.config/punktfunk/host.env"
- run: enable systemd user lingering ...
command: |
...In the guest afterwards:
$ ls -la ~/.local/bin/
total 0
drwxr-xr-x 1 arch arch 0 Aug 29 20:13 . <- mkdir: applied
drwxr-xr-x 1 arch arch 6 Aug 29 20:13 ..
<- copy: did NOT deliver
$ ls -l ~/.config/punktfunk/host.env
-rw-r--r-- 1 arch arch 1018 Aug 29 20:13 <- write: applied
$ loginctl show-user arch -p Linger
Linger=yes <- command: applied
So mkdir:, write: and command: from that candy all applied; copy: did not.
The step is absent from the deploy plan entirely, not failing:
$ grep -c 'punktfunk-host-wrapper' .check/check-punktfunk-vm/<calver>/deploy-add.log
0
deploy-add reported PASS, so nothing surfaced as an error.
Not a source-resolution problem
The same candy, same file, same copy: step delivers correctly on the image build
path — the wrapper is present and executable in the built container image, and a
container bed asserts it:
PASS the container-venue launcher wrapper is installed and executable [punktfunk-wrapper-installed]
So the file resolves against the candy dir fine; the divergence is build vs deploy.
Why it matters beyond this candy
copy: is documented as a first-class install verb and is classified deploy-capable —
OpStep.Venue() returns VenueHostNative and RequiresGate() lists
mkdir/copy/write/link/download/setcap together as structured verbs. Other candies rely
on it for host/VM deploys: pod-sway delivers both sway-wrapper and its config via
copy:, so a target: vm deploy of the sway stack would land a compositor with no
launcher.
I have not root-caused which stage drops it (compile vs. lowering to PutFile), so this is
a report of a reproducible measurement rather than a diagnosis.
Reproducer
- Candy with a file beside
charly.ymland acopy:step targeting${HOME}/.... - Apply it to a
kind: vmdeploy viaadd_candy:with
install_opts: {allow_repo_changes: true, allow_root_tasks: true}. charly check run <bed>→ deploy passes; the copied file is absent in the guest while
siblingmkdir:/write:/command:effects are present.
Surfaced while landing punktfunk streaming-host support
(opencharly/layer-punktfunk#2). That PR does not depend on the behaviour — its wrapper
check is venue-scoped on its own merits, because the wrapper is only the launch path
under a container init.
Activity
atrawog commentedon Aug 29, 2026
Root-caused — it is a missing token resolution, not a dropped step
My original report guessed the step was dropped from the plan. It is not: the step
compiles, reaches the venue, and the file is delivered — to the wrong path.
charly fleet add --dry-runshows all three ops present:And on the live guest the file exists, in a directory literally named
{{.Home}}:Why
A home-relative
to:is deliberately tokenized at compile so each emit target canresolve it against the destination home (
install_build.go: "Tokenize a home-relativeto:so each EmitTarget resolves it against the real destination home at emit").The OCI target resolves it —
OCITarget.emitPlancallsspec.ResolveHome(plan, t.Home),whose
case *OpStep:arm doess.To = sub(s.To).The machine-venue walk had no equivalent:
kit.walkOppassedstep.Tostraight intoPutFile.mkdir:,write:andcommand:are unaffected because those legs render shell thatexpands
$HOMEat runtime on the venue. Only thePutFile-staged verbs (copy:, and anyhome-relative
download: to:) hit this.Scope
pod-swaydelivers bothsway-wrapperandconfigviacopy:, so atarget: vmdeployof the sway stack lands a compositor whose launcher is in a junk directory. Any candy using
copy:with a home-relativeto:on a machine venue is affected.Fix
opencharly/sdk#188 —
WalkPlansresolves the token across the same field setspec.ResolveHomecovers, before any step runs; the venue home is probed lazily and theprobe is shared with the env.d finalizer. The regression test fails without it with exactly
the symptom above (
PutFile saw [{{.Home}}/probe/copied.txt]).Landing it end to end needs the sdk tag, then a
plugin-deploy-vmrepin.Minimal reproducer (~2 min on a disposable Arch cloud-image VM bed)
Apply via
add_candy:to akind: vmdeploy withinstall_opts: {allow_repo_changes: true, allow_root_tasks: true}; then in the guest~/copyprobeholds onlywritten.txt.fix: resolve the deferred {{.Home}} token on machine venues (#188)
fix: bump sdk to v0.2026241.2117 for the machine-venue home-token fix (…
fix: bump sdk to v0.2026241.2117 for the machine-venue home-token fix (…
fix: bump sdk to v0.2026241.2117 for the machine-venue home-token fix (…
fix: bump sdk to v0.2026241.2117 for the machine-venue home-token fix (…
atrawog commentedon Aug 29, 2026
Fixed and delivered
Root cause: the deferred
{{.Home}}token was never resolved on a machine venue. TheOCI target resolves it (
OCITarget.emitPlan→spec.ResolveHome, whosecase *OpStep:arm does
s.To = sub(s.To));kit.WalkPlanshad no equivalent, sowalkOphanded theliteral token to
PutFile.mkdir:/write:/command:were unaffected because those legsrender shell that expands
$HOMEon the venue — only thePutFile-staged verbs (copy:,and a home-relative
download: to:) hit it.The fix — opencharly/sdk#188, in
v0.2026241.2117:WalkPlansresolves the tokenacross the same field set
spec.ResolveHomecovers, before any step runs; the venue homeis probed lazily, and that probe is now one helper shared with the env.d finalizer. An
unresolvable home is a no-op rather than an empty substitution.
Delivered to every venue. A plugin is built against its own pinned sdk, so each
plan-walking plugin had to repin — all four merged:
plugin-deploy-vmtarget: vmplugin-deploy-localtarget: localplugin-deploy-podplugin-installstepVerified end to end on a disposable Arch cloud-image VM bed with the reproducer from
this issue — before the bump the copy assertion fails and the file sits at
/home/arch/{{.Home}}/copyprobe/copied.txt; after it, the fullcharly check runincluding the fresh-rebuild leg is green:
A regression test guards the seam (
kit/walk_home_token_test.go); with the resolution callneutralised it fails with exactly the original symptom
(
PutFile saw [{{.Home}}/probe/copied.txt]).Note for anyone hitting this on an older toolchain: the fix only reaches a venue once that
venue's deploy plugin is repinned, so a stale
~/.cache/charly/repos/...checkout can stillreproduce the old behaviour until it refetches.