]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/{go,cover}: enable response file args for cmd/cover
authorThan McIntosh <thanm@google.com>
Thu, 15 Jun 2023 13:14:03 +0000 (09:14 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 22 Jun 2023 18:36:44 +0000 (18:36 +0000)
Change the cover command to accept arguments via response files, using
the same mechanism employed for the compiler and the assembler. This
is needed now that the cover tool accepts a list of all source files
in a package, as opposed to just a single source file, and as a result
can run into system-dependent command line length limits.

Fixes #60785.

Change-Id: I67dbc96ad9fc5c6f43d5c1e4e903e4b8589b154f
Reviewed-on: https://go-review.googlesource.com/c/go/+/503735
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>

src/cmd/cover/cover.go
src/cmd/go/internal/work/exec.go

index ea6562c9999553e3aff770fe0d73c2c9a93c3197..a4b837c9ad32f27f7c1a78c2b62cc7e504934b65 100644 (file)
@@ -95,7 +95,7 @@ const (
 func main() {
        objabi.AddVersionFlag()
        flag.Usage = usage
-       flag.Parse()
+       objabi.Flagparse(usage)
 
        // Usage information when no arguments.
        if flag.NFlag() == 0 && flag.NArg() == 0 {
index eb05c91f30f8ccd674340c2ef8903790c80bc374..d38a051b2bb016aa1359262b0e9aaf0f4a9da08a 100644 (file)
@@ -3886,7 +3886,7 @@ func useResponseFile(path string, argLen int) bool {
        // TODO: Note that other toolchains like CC are missing here for now.
        prog := strings.TrimSuffix(filepath.Base(path), ".exe")
        switch prog {
-       case "compile", "link", "cgo", "asm":
+       case "compile", "link", "cgo", "asm", "cover":
        default:
                return false
        }