1
0
mirror of https://github.com/golang/go synced 2024-11-22 15:34:53 -07:00

cmd/link: don't skip code sign even if dsymutil didn't generate a file

Even if dsymutil didn't generate a file (which should not happen
with the Apple toolchain with the correct setup), we should not
skip next steps, e.g. code sign. A return statement makes it exit
too early.

Updates #68088.

Change-Id: Ic1271ed1b7fe5bdee5a25cc5d669a105173b389e
Reviewed-on: https://go-review.googlesource.com/c/go/+/593660
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Mui 2024-06-21 12:20:38 -04:00
parent 5f319b7507
commit 5a18e79687

View File

@ -2050,15 +2050,14 @@ func (ctxt *Link) hostlink() {
Exitf("%s: running strip failed: %v\n%s\n%s", os.Args[0], err, cmd, out) Exitf("%s: running strip failed: %v\n%s\n%s", os.Args[0], err, cmd, out)
} }
// Skip combining if `dsymutil` didn't generate a file. See #11994. // Skip combining if `dsymutil` didn't generate a file. See #11994.
if _, err := os.Stat(dsym); os.IsNotExist(err) { if _, err := os.Stat(dsym); err == nil {
return
}
updateMachoOutFile("combining dwarf", updateMachoOutFile("combining dwarf",
func(ctxt *Link, exef *os.File, exem *macho.File, outexe string) error { func(ctxt *Link, exef *os.File, exem *macho.File, outexe string) error {
return machoCombineDwarf(ctxt, exef, exem, dsym, outexe) return machoCombineDwarf(ctxt, exef, exem, dsym, outexe)
}) })
uuidUpdated = true uuidUpdated = true
} }
}
if ctxt.IsDarwin() && !uuidUpdated && *flagBuildid != "" { if ctxt.IsDarwin() && !uuidUpdated && *flagBuildid != "" {
updateMachoOutFile("rewriting uuid", updateMachoOutFile("rewriting uuid",
func(ctxt *Link, exef *os.File, exem *macho.File, outexe string) error { func(ctxt *Link, exef *os.File, exem *macho.File, outexe string) error {