Commit 9c1f54c9 authored by Shenghou Ma's avatar Shenghou Ma Committed by Russ Cox

cmd/go: go test -i correctly handle cgo packages

Previous CL (5674043) omit the case where runtime/cgo itself is out-of-date.
Fixes #2936 (again).

R=rsc
CC=golang-dev
https://golang.org/cl/5674048
parent 2506fd43
...@@ -15,6 +15,7 @@ import ( ...@@ -15,6 +15,7 @@ import (
"os/exec" "os/exec"
"path" "path"
"path/filepath" "path/filepath"
"runtime"
"sort" "sort"
"strings" "strings"
"text/template" "text/template"
...@@ -273,8 +274,15 @@ func runTest(cmd *Command, args []string) { ...@@ -273,8 +274,15 @@ func runTest(cmd *Command, args []string) {
} }
} }
// translate C to runtime/cgo
if deps["C"] {
delete(deps, "C")
deps["runtime/cgo"] = true
if buildContext.GOOS == runtime.GOOS && buildContext.GOARCH == runtime.GOARCH {
deps["cmd/cgo"] = true
}
}
// Ignore pseudo-packages. // Ignore pseudo-packages.
delete(deps, "C")
delete(deps, "unsafe") delete(deps, "unsafe")
all := []string{} all := []string{}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment