[go] cmd/go: check if build output should overwrite files with renames

0 views
Skip to first unread message

Sean Liao (Gerrit)

unread,
Oct 22, 2025, 4:35:10 PM (17 hours ago) Oct 22
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Ian Alexander, Michael Matloob, Michael Matloob, Go LUCI, Laurent Demailly, golang-co...@googlegroups.com

Sean Liao submitted the change

Change information

Commit message:
cmd/go: check if build output should overwrite files with renames

CopyFile has a check to ensure that only object files are overwritten.
Extend this to moveOrCopyFile, so the check also happens when the source
and destination file are on the same filesystem (when renames are a
valid way of moving files).

Fixes #75970
Change-Id: Ie667301f1c9c00b114cfd91cdf8053ac20fd817b
Reviewed-by: Laurent Demailly <ldem...@gmail.com>
Reviewed-by: Michael Matloob <mat...@google.com>
Reviewed-by: Ian Alexander <ji...@google.com>
Reviewed-by: Michael Matloob <mat...@golang.org>
Files:
  • M src/cmd/go/internal/work/shell.go
  • A src/cmd/go/testdata/script/build_output_overwrite.txt
Change size: M
Delta: 2 files changed, 43 insertions(+), 10 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Ian Alexander, +1 by Laurent Demailly, +2 by Michael Matloob, +1 by Michael Matloob
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie667301f1c9c00b114cfd91cdf8053ac20fd817b
Gerrit-Change-Number: 712960
Gerrit-PatchSet: 5
Gerrit-Owner: Sean Liao <se...@liao.dev>
Gerrit-Reviewer: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Laurent Demailly <ldem...@gmail.com>
Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages