Commit 4d00937c authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

all: rename vendored golang.org/x/net packages to golang_org

Regression from Go 1.6 to Go 1.7rc1: we had broken the ability for
users to vendor "golang.org/x/net/http2" or "golang.org/x/net/route"
because we were vendoring them ourselves and cmd/go and cmd/compile do
not understand multiple vendor directories across multiple GOPATH
workspaces (e.g. user's $GOPATH and default $GOROOT).

As a short-term fix, since fixing cmd/go and cmd/compile is too
invasive at this point in the cycle, just rename "golang.org" to
"golang_org" for the standard library's vendored copy.

Fixes #16333

Change-Id: I9bfaed91e9f7d4ca6bab07befe80d71d437a21af
Reviewed-on: https://go-review.googlesource.com/24902
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 1cb3f716
...@@ -425,7 +425,7 @@ func (w *Walker) Import(name string) (*types.Package, error) { ...@@ -425,7 +425,7 @@ func (w *Walker) Import(name string) (*types.Package, error) {
w.imported[name] = &importing w.imported[name] = &importing
root := w.root root := w.root
if strings.HasPrefix(name, "golang.org/x/") { if strings.HasPrefix(name, "golang_org/x/") {
root = filepath.Join(root, "vendor") root = filepath.Join(root, "vendor")
} }
......
...@@ -303,11 +303,11 @@ func TestImportVendor(t *testing.T) { ...@@ -303,11 +303,11 @@ func TestImportVendor(t *testing.T) {
testenv.MustHaveGoBuild(t) // really must just have source testenv.MustHaveGoBuild(t) // really must just have source
ctxt := Default ctxt := Default
ctxt.GOPATH = "" ctxt.GOPATH = ""
p, err := ctxt.Import("golang.org/x/net/http2/hpack", filepath.Join(ctxt.GOROOT, "src/net/http"), 0) p, err := ctxt.Import("golang_org/x/net/http2/hpack", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
if err != nil { if err != nil {
t.Fatalf("cannot find vendored golang.org/x/net/http2/hpack from net/http directory: %v", err) t.Fatalf("cannot find vendored golang_org/x/net/http2/hpack from net/http directory: %v", err)
} }
want := "vendor/golang.org/x/net/http2/hpack" want := "vendor/golang_org/x/net/http2/hpack"
if p.ImportPath != want { if p.ImportPath != want {
t.Fatalf("Import succeeded but found %q, want %q", p.ImportPath, want) t.Fatalf("Import succeeded but found %q, want %q", p.ImportPath, want)
} }
...@@ -333,7 +333,7 @@ func TestImportVendorParentFailure(t *testing.T) { ...@@ -333,7 +333,7 @@ func TestImportVendorParentFailure(t *testing.T) {
ctxt := Default ctxt := Default
ctxt.GOPATH = "" ctxt.GOPATH = ""
// This import should fail because the vendor/golang.org/x/net/http2 directory has no source code. // This import should fail because the vendor/golang.org/x/net/http2 directory has no source code.
p, err := ctxt.Import("golang.org/x/net/http2", filepath.Join(ctxt.GOROOT, "src/net/http"), 0) p, err := ctxt.Import("golang_org/x/net/http2", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
if err == nil { if err == nil {
t.Fatalf("found empty parent in %s", p.Dir) t.Fatalf("found empty parent in %s", p.Dir)
} }
......
...@@ -297,7 +297,7 @@ var pkgDeps = map[string][]string{ ...@@ -297,7 +297,7 @@ var pkgDeps = map[string][]string{
"context", "math/rand", "os", "sort", "syscall", "time", "context", "math/rand", "os", "sort", "syscall", "time",
"internal/nettrace", "internal/nettrace",
"internal/syscall/windows", "internal/singleflight", "internal/race", "internal/syscall/windows", "internal/singleflight", "internal/race",
"golang.org/x/net/route", "golang_org/x/net/route",
}, },
// NET enables use of basic network-related packages. // NET enables use of basic network-related packages.
...@@ -378,8 +378,8 @@ var pkgDeps = map[string][]string{ ...@@ -378,8 +378,8 @@ var pkgDeps = map[string][]string{
"context", "compress/gzip", "container/list", "crypto/tls", "context", "compress/gzip", "container/list", "crypto/tls",
"mime/multipart", "runtime/debug", "mime/multipart", "runtime/debug",
"net/http/internal", "net/http/internal",
"golang.org/x/net/http2/hpack", "golang_org/x/net/http2/hpack",
"golang.org/x/net/lex/httplex", "golang_org/x/net/lex/httplex",
"internal/nettrace", "internal/nettrace",
"net/http/httptrace", "net/http/httptrace",
}, },
...@@ -443,7 +443,7 @@ func listStdPkgs(goroot string) ([]string, error) { ...@@ -443,7 +443,7 @@ func listStdPkgs(goroot string) ([]string, error) {
} }
name := filepath.ToSlash(path[len(src):]) name := filepath.ToSlash(path[len(src):])
if name == "builtin" || name == "cmd" || strings.Contains(name, ".") { if name == "builtin" || name == "cmd" || strings.Contains(name, "golang_org") {
return filepath.SkipDir return filepath.SkipDir
} }
......
...@@ -41,8 +41,8 @@ import ( ...@@ -41,8 +41,8 @@ import (
"sync" "sync"
"time" "time"
"golang.org/x/net/http2/hpack" "golang_org/x/net/http2/hpack"
"golang.org/x/net/lex/httplex" "golang_org/x/net/lex/httplex"
) )
// ClientConnPool manages a pool of HTTP/2 client connections. // ClientConnPool manages a pool of HTTP/2 client connections.
......
...@@ -7,7 +7,7 @@ package http ...@@ -7,7 +7,7 @@ package http
import ( import (
"strings" "strings"
"golang.org/x/net/lex/httplex" "golang_org/x/net/lex/httplex"
) )
// maxInt64 is the effective "infinite" value for the Server and // maxInt64 is the effective "infinite" value for the Server and
......
...@@ -28,7 +28,7 @@ import ( ...@@ -28,7 +28,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"golang.org/x/net/lex/httplex" "golang_org/x/net/lex/httplex"
) )
// Errors used by the HTTP server. // Errors used by the HTTP server.
......
...@@ -18,7 +18,7 @@ import ( ...@@ -18,7 +18,7 @@ import (
"strings" "strings"
"sync" "sync"
"golang.org/x/net/lex/httplex" "golang_org/x/net/lex/httplex"
) )
// ErrLineTooLong is returned when reading request or response bodies // ErrLineTooLong is returned when reading request or response bodies
......
...@@ -27,7 +27,7 @@ import ( ...@@ -27,7 +27,7 @@ import (
"sync" "sync"
"time" "time"
"golang.org/x/net/lex/httplex" "golang_org/x/net/lex/httplex"
) )
// DefaultTransport is the default implementation of Transport and is // DefaultTransport is the default implementation of Transport and is
......
...@@ -9,7 +9,7 @@ package net ...@@ -9,7 +9,7 @@ package net
import ( import (
"syscall" "syscall"
"golang.org/x/net/route" "golang_org/x/net/route"
) )
// If the ifindex is zero, interfaceTable returns mappings of all // If the ifindex is zero, interfaceTable returns mappings of all
......
...@@ -9,7 +9,7 @@ package net ...@@ -9,7 +9,7 @@ package net
import ( import (
"syscall" "syscall"
"golang.org/x/net/route" "golang_org/x/net/route"
) )
func interfaceMessages(ifindex int) ([]route.Message, error) { func interfaceMessages(ifindex int) ([]route.Message, error) {
......
...@@ -7,7 +7,7 @@ package net ...@@ -7,7 +7,7 @@ package net
import ( import (
"syscall" "syscall"
"golang.org/x/net/route" "golang_org/x/net/route"
) )
func interfaceMessages(ifindex int) ([]route.Message, error) { func interfaceMessages(ifindex int) ([]route.Message, error) {
......
...@@ -7,7 +7,7 @@ package net ...@@ -7,7 +7,7 @@ package net
import ( import (
"syscall" "syscall"
"golang.org/x/net/route" "golang_org/x/net/route"
) )
func interfaceMessages(ifindex int) ([]route.Message, error) { func interfaceMessages(ifindex int) ([]route.Message, error) {
......
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