You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CakeExecuteScript/CakeExecuteExpression silently ignore several CakeSettings when running via Cake.ToolΒ #4985
CakeRunner.ExecuteScript has two execution paths, and they don't honour the same set of CakeSettings (i.e. ToolSettings) members:
when the resolved tool path is notCake.dll (cake, Cake.exe, homebrew), it calls Tool<CakeSettings>.Run(settings, args), which honours every ToolSettings member;
when the resolved tool path isCake.dll β which is the default whenever the outer build
runs on Cake.Tool, since GetAlternativeToolPaths points at the executing assembly's Cake.dll β it hand-copies a subset of the settings onto a DotNetExecuteSettings and runs
them through DotNetExecutor.
The hand-copied subset is missing four members, so they are silently dropped:
CakeExecuteExpression delegates to ExecuteScript, so it is affected identically.
Repro
varoutput=newList<string>();CakeExecuteExpression("Information(\"hello from the nested script\");",newCakeSettings{HandleExitCode= exitCode =>true,SetupProcessSettings= process =>{process.RedirectStandardOutput=true;process.RedirectedStandardOutputHandler= line =>{output.Add(line);returnline;};}});Information("Captured {0} lines",output.Count);
Expected: the nested script's stdout is redirected and captured, and a non-zero exit code is
handled by the delegate.
Actual: when the outer build runs on Cake.Tool, output is empty (the nested output goes
straight to the console) and a non-zero exit code throws, because neither delegate reaches the
process. Running the same script with ToolPath pointing at cake/Cake.exe behaves as
documented, which makes this look like an environment-dependent bug rather than a missing feature.
This blocks any scenario that needs to inspect a nested Cake run β capturing its output, asserting
on its warnings, or tolerating a deliberate non-zero exit β which is exactly what integration tests
around nested script execution need.
Activity
(cake-buildGH-4985) Honour CakeSettings CakeExecuteScript
github-actions commentedon Sep 14, 2026
π This issue has been resolved in version v6.3.0 π
The release is available on:
Your GitReleaseManager bot π¦π
Bump cake.tool from 4.0.0 to 6.3.0 (#39809)