What existing functionality needs improvement?
Every non-LOCALLY RUN gets the interactive debugger's plumbing attached,
whether or not --interactive/-i is set. In earthfile2llb/converter.go,
inside the if !opts.Locally block (~2707), guarded by nothing else:
llb.SocketTarget("earthly_interactive", ...) and earthly_save_file (~2721)
llb.AddSecret("/run/secrets/earthly_debugger_settings", ...) (~2791)
pllb.AddMount(..., llb.HostBind(), ...) for /usr/bin/earth_debugger (~2792)
c.opt.InteractiveDebuggerEnabled already exists and is consulted twice
nearby (~2712, ~2769), but only to decide whether a missing
CapExecMountSock is fatal and to set Enabled inside the settings payload.
The mounts themselves are attached either way.
The cost is that every exec depends on the client's session — for the
secret, for two sockets, and for a path on the client's host — which makes
the LLB unsolvable off-box. A RUN that nobody is debugging cannot be built
by any daemon other than the one holding that session.
Expected Behavior
Attach them only when a debugger is actually wanted:
if c.opt.InteractiveDebuggerEnabled || isInteractive {
runOpts = append(runOpts, debuggerSecretMount, debuggerMount)
}
and the same condition around the two llb.SocketTarget calls. Behaviour with
-i, EARTHLY_INTERACTIVE or RUN --interactive is unchanged.
Note: this changes exec digests, so it invalidates build cache once on upgrade.
Done when:
Inspected at 36fa573 (main).
What existing functionality needs improvement?
Every non-
LOCALLYRUNgets the interactive debugger's plumbing attached,whether or not
--interactive/-iis set. Inearthfile2llb/converter.go,inside the
if !opts.Locallyblock (~2707), guarded by nothing else:llb.SocketTarget("earthly_interactive", ...)andearthly_save_file(~2721)llb.AddSecret("/run/secrets/earthly_debugger_settings", ...)(~2791)pllb.AddMount(..., llb.HostBind(), ...)for/usr/bin/earth_debugger(~2792)c.opt.InteractiveDebuggerEnabledalready exists and is consulted twicenearby (~2712, ~2769), but only to decide whether a missing
CapExecMountSockis fatal and to setEnabledinside the settings payload.The mounts themselves are attached either way.
The cost is that every exec depends on the client's session — for the
secret, for two sockets, and for a path on the client's host — which makes
the LLB unsolvable off-box. A
RUNthat nobody is debugging cannot be builtby any daemon other than the one holding that session.
Expected Behavior
Attach them only when a debugger is actually wanted:
and the same condition around the two
llb.SocketTargetcalls. Behaviour with-i,EARTHLY_INTERACTIVEorRUN --interactiveis unchanged.Note: this changes exec digests, so it invalidates build cache once on upgrade.
Done when:
RUNbuilt without-icarries noearthly_debugger_settingssecret,no
earthly_interactive/earthly_save_filesockets and noearth_debuggerhost bind-i,EARTHLY_INTERACTIVE=1andRUN --interactivebehave as todayInspected at
36fa573(main).