aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/build.go
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitshur@golang.org>2020-08-18 10:54:11 -0400
committerDmitri Shuralyov <dmitshur@golang.org>2020-08-18 15:45:01 +0000
commitc12d9ed87596688aeeeb61111e408f6a176aa287 (patch)
tree38501e2cde85ed04ad5af741c0ad524264e7611b /src/cmd/go/internal/modload/build.go
parent6e876f19857a8fbd259571080f7f91bc03276559 (diff)
downloadgo-c12d9ed87596688aeeeb61111e408f6a176aa287.tar.gz
go-c12d9ed87596688aeeeb61111e408f6a176aa287.zip
cmd/go: revert 3 CLs affecting par.Work, context propagation, tracing
This reverts the following changes: • cmd/go: add tracing for querying and downloading from the proxy CL 242786, commit 1a3558341860357c2400e37773e5076bb3a51628 • cmd/go: do context propagation for tracing downloads CL 248327, commit c0cf190d226cc3defb71d17c01d0b45bf49a8a85 • cmd/go/internal: remove some users of par.Work CL 248326, commit f30044a03bc7cf107dbec03c02fb6d0072878252 Reason for revert: broke linux 386 and amd64 longtest builders. The problem started with CL 248326, but CL 248327 and CL 242786 are reverted as well due to conflicts. Updates #38714. Fixes #40861. Change-Id: I68496b4e5a27e47a42183553c3a645b288edac83 Reviewed-on: https://go-review.googlesource.com/c/go/+/249017 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/go/internal/modload/build.go')
-rw-r--r--src/cmd/go/internal/modload/build.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/cmd/go/internal/modload/build.go b/src/cmd/go/internal/modload/build.go
index a101681a1f..5f8a2e7e05 100644
--- a/src/cmd/go/internal/modload/build.go
+++ b/src/cmd/go/internal/modload/build.go
@@ -6,7 +6,6 @@ package modload
import (
"bytes"
- "context"
"encoding/hex"
"fmt"
"internal/goroot"
@@ -58,21 +57,21 @@ func PackageModuleInfo(pkgpath string) *modinfo.ModulePublic {
if !ok {
return nil
}
- return moduleInfo(context.TODO(), m, true)
+ return moduleInfo(m, true)
}
-func ModuleInfo(ctx context.Context, path string) *modinfo.ModulePublic {
+func ModuleInfo(path string) *modinfo.ModulePublic {
if !Enabled() {
return nil
}
if i := strings.Index(path, "@"); i >= 0 {
- return moduleInfo(ctx, module.Version{Path: path[:i], Version: path[i+1:]}, false)
+ return moduleInfo(module.Version{Path: path[:i], Version: path[i+1:]}, false)
}
for _, m := range BuildList() {
if m.Path == path {
- return moduleInfo(ctx, m, true)
+ return moduleInfo(m, true)
}
}
@@ -85,12 +84,12 @@ func ModuleInfo(ctx context.Context, path string) *modinfo.ModulePublic {
}
// addUpdate fills in m.Update if an updated version is available.
-func addUpdate(ctx context.Context, m *modinfo.ModulePublic) {
+func addUpdate(m *modinfo.ModulePublic) {
if m.Version == "" {
return
}
- if info, err := Query(ctx, m.Path, "upgrade", m.Version, Allowed); err == nil && semver.Compare(info.Version, m.Version) > 0 {
+ if info, err := Query(m.Path, "upgrade", m.Version, Allowed); err == nil && semver.Compare(info.Version, m.Version) > 0 {
m.Update = &modinfo.ModulePublic{
Path: m.Path,
Version: info.Version,
@@ -104,7 +103,7 @@ func addVersions(m *modinfo.ModulePublic) {
m.Versions, _ = versions(m.Path)
}
-func moduleInfo(ctx context.Context, m module.Version, fromBuildList bool) *modinfo.ModulePublic {
+func moduleInfo(m module.Version, fromBuildList bool) *modinfo.ModulePublic {
if m == Target {
info := &modinfo.ModulePublic{
Path: m.Path,
@@ -133,7 +132,7 @@ func moduleInfo(ctx context.Context, m module.Version, fromBuildList bool) *modi
// completeFromModCache fills in the extra fields in m using the module cache.
completeFromModCache := func(m *modinfo.ModulePublic) {
if m.Version != "" {
- if q, err := Query(ctx, m.Path, m.Version, "", nil); err != nil {
+ if q, err := Query(m.Path, m.Version, "", nil); err != nil {
m.Error = &modinfo.ModuleError{Err: err.Error()}
} else {
m.Version = q.Version