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
ToolFs copy_file silently turns an unreadable source into an empty successful output #1164
ToolFs.copy_file reports success and overwrites the destination with zero bytes when its source cannot be read. Both the native std.build implementation and the comptime evaluator call the legacy with_fs_read_file, which discards the I/O status. read_binary has the same unchecked read; read_text was already corrected by #953.
Minimal build action:
use std.build
fn copy(ctx: ActionCtx) -> i32:
ctx.fs().copy_file("missing.dll", "out/copied.dll")
pub fn build(ctx: BuildCtx) -> Build:
var out = ctx.new_build()
var target = target_new(.Action, "copy", "").output("out/copied.dll")
target.action = copy
out = out.add_target(target)
out.default("copy")
Run with build --strict-effects in an initialized project. Expected: a nonzero read/copy failure, naming the missing source, without replacing a destination. Actual: survey: all targets green and an empty output. An existing readable empty source must still succeed.
Native proof on the actual release compiler: LLDB in with_fs_read_file receives /Users/eric/with/out/with-get-investigation/dll-copy-probe/missing.dll from ComptimeEvaluator.eval_toolfs_capability_method; stepping out returns a str with x1 = 0. Source branch: src/ComptimeEval.w copy_file path calls with_fs_write_file(resolved_dst, with_fs_read_file(resolved_src)). The native counterpart is lib/std/build.w:ToolFs.copy_file. Evidence: out/with-get-investigation/dll-copy-missing-read-correct-lldb.log and dll-copy-current-missing.log.
The pinned Darwin seed additionally treats D:/... as project-relative: LLDB observes capability_resolve_project_path return <project>/D:/a/_temp/mesa/opengl32.dll. That legacy path failure combined with the unchecked read can explain a zero-byte Mesa copy. Native and interpreted relative copies of the actual Mesa DLL are byte-identical on Darwin and both Windows seeds (diagnostic run 35202112398); the exact external absolute Windows path remains under investigation. No product workaround is applied yet.
The build contract and repository's No Silent Fallbacks rule require reporting the failed operation, not manufacturing a successful empty output. Cover missing, unreadable/directory, readable empty, binary contents, and preservation of an existing destination across native and interpreted actions.
Triage 2026-10-25, with v0.15.3.0 (main a261b65): does not reproduce; ToolFs.copy_file now fails loudly.
# build.w action: ctx.fs().copy_file("missing.dll", "out/copied.dll")
$ with build :copy
error: copy_file: …/missing.dll: No such file or directory (os error 2)
error: build.w target 'copy' failed with exit code 254
$ ls out/copied.dll
ls: out/copied.dll: No such file or directory
Activity
Reproduce the UAT external DLL path in Windows copy diagnostics
Reproduce the UAT external DLL path in Windows copy diagnostics
Reproduce the UAT external DLL path in Windows copy diagnostics
with get: c_import, Conan, ToolFs, linking and ownership fixes; darwi…
ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): does not reproduce;ToolFs.copy_filenow fails loudly.