summaryrefslogtreecommitdiff
path: root/src/cmd/dist
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-08 00:06:45 -0400
committerRuss Cox <rsc@golang.org>2014-09-08 00:06:45 -0400
commit73bcb69f272cbf34ddcc9daa56427a8683b5a95d (patch)
treed20bfa495b84f48f23d9a976c038b70427eef2e8 /src/cmd/dist
parent45fcda1dc8d9b4d4a9b642faf8e78941873f508d (diff)
downloadgo-73bcb69f272cbf34ddcc9daa56427a8683b5a95d.tar.gz
build: adjustments for move from src/pkg to src
This CL adjusts code referring to src/pkg to refer to src. Immediately after submitting this CL, I will submit a change doing 'hg mv src/pkg/* src'. That change will be too large to review with Rietveld but will contain only the 'hg mv'. This CL will break the build. The followup 'hg mv' will fix it. For more about the move, see golang.org/s/go14nopkg. LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/134570043
Diffstat (limited to 'src/cmd/dist')
-rw-r--r--src/cmd/dist/build.c208
-rw-r--r--src/cmd/dist/buildruntime.c2
-rw-r--r--src/cmd/dist/windows.c2
3 files changed, 112 insertions, 100 deletions
diff --git a/src/cmd/dist/build.c b/src/cmd/dist/build.c
index 1c18c5932..e4dc9ba56 100644
--- a/src/cmd/dist/build.c
+++ b/src/cmd/dist/build.c
@@ -366,8 +366,8 @@ static char *oldtool[] = {
// not be in release branches.
static char *unreleased[] = {
"src/cmd/link",
- "src/pkg/debug/goobj",
- "src/pkg/old",
+ "src/debug/goobj",
+ "src/old",
};
// setup sets up the tree for the initial build.
@@ -590,7 +590,7 @@ static struct {
"$GOROOT/pkg/obj/$GOHOSTOS_$GOHOSTARCH/libbio.a",
"$GOROOT/pkg/obj/$GOHOSTOS_$GOHOSTARCH/lib9.a",
}},
- {"pkg/runtime", {
+ {"runtime", {
"zaexperiment.h", // must sort above zasm
"zasm_$GOOS_$GOARCH.h",
"zsys_$GOOS_$GOARCH.s",
@@ -706,7 +706,7 @@ install(char *dir)
}
islib = hasprefix(dir, "lib") || streq(dir, "cmd/cc") || streq(dir, "cmd/gc");
- ispkg = hasprefix(dir, "pkg");
+ ispkg = !islib && !hasprefix(dir, "cmd/");
isgo = ispkg || streq(dir, "cmd/go") || streq(dir, "cmd/cgo");
exe = "";
@@ -732,11 +732,11 @@ install(char *dir)
// Go library (package).
ispackcmd = 1;
vadd(&link, "pack"); // program name - unused here, but all the other cases record one
- p = bprintf(&b, "%s/pkg/%s_%s/%s", goroot, goos, goarch, dir+4);
+ p = bprintf(&b, "%s/pkg/%s_%s/%s", goroot, goos, goarch, dir);
*xstrrchr(p, '/') = '\0';
xmkdirall(p);
targ = link.len;
- vadd(&link, bpathf(&b, "%s/pkg/%s_%s/%s.a", goroot, goos, goarch, dir+4));
+ vadd(&link, bpathf(&b, "%s/pkg/%s_%s/%s.a", goroot, goos, goarch, dir));
} else if(streq(dir, "cmd/go") || streq(dir, "cmd/cgo")) {
// Go command.
vadd(&link, bpathf(&b, "%s/%sl", tooldir, gochar));
@@ -883,7 +883,7 @@ install(char *dir)
goto out;
// For package runtime, copy some files into the work space.
- if(streq(dir, "pkg/runtime")) {
+ if(streq(dir, "runtime")) {
copyfile(bpathf(&b, "%s/arch_GOARCH.h", workdir),
bpathf(&b1, "%s/arch_%s.h", bstr(&path), goarch), 0);
copyfile(bpathf(&b, "%s/defs_GOOS_GOARCH.h", workdir),
@@ -911,7 +911,7 @@ install(char *dir)
errprintf("generate %s\n", p);
gentab[j].gen(bstr(&path), p);
// Do not add generated file to clean list.
- // In pkg/runtime, we want to be able to
+ // In runtime, we want to be able to
// build the package with the go tool,
// and it assumes these generated files already
// exist (it does not know how to build them).
@@ -929,7 +929,7 @@ install(char *dir)
// One more copy for package runtime.
// The last batch was required for the generators.
// This one is generated.
- if(streq(dir, "pkg/runtime")) {
+ if(streq(dir, "runtime")) {
copyfile(bpathf(&b, "%s/zasm_GOOS_GOARCH.h", workdir),
bpathf(&b1, "%s/zasm_%s_%s.h", bstr(&path), goos, goarch), 0);
}
@@ -1074,7 +1074,7 @@ install(char *dir)
else
vadd(&compile, "main");
- if(streq(dir, "pkg/runtime"))
+ if(streq(dir, "runtime"))
vadd(&compile, "-+");
vcopy(&compile, go.p, go.len);
@@ -1103,11 +1103,11 @@ install(char *dir)
nobuild:
// In package runtime, we install runtime.h and cgocall.h too,
// for use by cgo compilation.
- if(streq(dir, "pkg/runtime")) {
+ if(streq(dir, "runtime")) {
copyfile(bpathf(&b, "%s/pkg/%s_%s/cgocall.h", goroot, goos, goarch),
- bpathf(&b1, "%s/src/pkg/runtime/cgocall.h", goroot), 0);
+ bpathf(&b1, "%s/src/runtime/cgocall.h", goroot), 0);
copyfile(bpathf(&b, "%s/pkg/%s_%s/runtime.h", goroot, goos, goarch),
- bpathf(&b1, "%s/src/pkg/runtime/runtime.h", goroot), 0);
+ bpathf(&b1, "%s/src/runtime/runtime.h", goroot), 0);
}
@@ -1304,47 +1304,47 @@ static char *buildorder[] = {
// back when there were build scripts. Will have to
// be maintained by hand, but shouldn't change very
// often.
- "pkg/runtime",
- "pkg/errors",
- "pkg/sync/atomic",
- "pkg/sync",
- "pkg/io",
- "pkg/unicode",
- "pkg/unicode/utf8",
- "pkg/unicode/utf16",
- "pkg/bytes",
- "pkg/math",
- "pkg/strings",
- "pkg/strconv",
- "pkg/bufio",
- "pkg/sort",
- "pkg/container/heap",
- "pkg/encoding/base64",
- "pkg/syscall",
- "pkg/time",
- "pkg/os",
- "pkg/reflect",
- "pkg/fmt",
- "pkg/encoding",
- "pkg/encoding/json",
- "pkg/flag",
- "pkg/path/filepath",
- "pkg/path",
- "pkg/io/ioutil",
- "pkg/log",
- "pkg/regexp/syntax",
- "pkg/regexp",
- "pkg/go/token",
- "pkg/go/scanner",
- "pkg/go/ast",
- "pkg/go/parser",
- "pkg/os/exec",
- "pkg/os/signal",
- "pkg/net/url",
- "pkg/text/template/parse",
- "pkg/text/template",
- "pkg/go/doc",
- "pkg/go/build",
+ "runtime",
+ "errors",
+ "sync/atomic",
+ "sync",
+ "io",
+ "unicode",
+ "unicode/utf8",
+ "unicode/utf16",
+ "bytes",
+ "math",
+ "strings",
+ "strconv",
+ "bufio",
+ "sort",
+ "container/heap",
+ "encoding/base64",
+ "syscall",
+ "time",
+ "os",
+ "reflect",
+ "fmt",
+ "encoding",
+ "encoding/json",
+ "flag",
+ "path/filepath",
+ "path",
+ "io/ioutil",
+ "log",
+ "regexp/syntax",
+ "regexp",
+ "go/token",
+ "go/scanner",
+ "go/ast",
+ "go/parser",
+ "os/exec",
+ "os/signal",
+ "net/url",
+ "text/template/parse",
+ "text/template",
+ "go/doc",
+ "go/build",
"cmd/go",
};
@@ -1352,6 +1352,7 @@ static char *buildorder[] = {
// It is bigger than the buildorder because we clean all the
// compilers but build only the $GOARCH ones.
static char *cleantab[] = {
+ // Commands and C libraries.
"cmd/5a",
"cmd/5c",
"cmd/5g",
@@ -1370,46 +1371,48 @@ static char *cleantab[] = {
"lib9",
"libbio",
"liblink",
- "pkg/bufio",
- "pkg/bytes",
- "pkg/container/heap",
- "pkg/encoding",
- "pkg/encoding/base64",
- "pkg/encoding/json",
- "pkg/errors",
- "pkg/flag",
- "pkg/fmt",
- "pkg/go/ast",
- "pkg/go/build",
- "pkg/go/doc",
- "pkg/go/parser",
- "pkg/go/scanner",
- "pkg/go/token",
- "pkg/io",
- "pkg/io/ioutil",
- "pkg/log",
- "pkg/math",
- "pkg/net/url",
- "pkg/os",
- "pkg/os/exec",
- "pkg/path",
- "pkg/path/filepath",
- "pkg/reflect",
- "pkg/regexp",
- "pkg/regexp/syntax",
- "pkg/runtime",
- "pkg/sort",
- "pkg/strconv",
- "pkg/strings",
- "pkg/sync",
- "pkg/sync/atomic",
- "pkg/syscall",
- "pkg/text/template",
- "pkg/text/template/parse",
- "pkg/time",
- "pkg/unicode",
- "pkg/unicode/utf16",
- "pkg/unicode/utf8",
+
+ // Go packages.
+ "bufio",
+ "bytes",
+ "container/heap",
+ "encoding",
+ "encoding/base64",
+ "encoding/json",
+ "errors",
+ "flag",
+ "fmt",
+ "go/ast",
+ "go/build",
+ "go/doc",
+ "go/parser",
+ "go/scanner",
+ "go/token",
+ "io",
+ "io/ioutil",
+ "log",
+ "math",
+ "net/url",
+ "os",
+ "os/exec",
+ "path",
+ "path/filepath",
+ "reflect",
+ "regexp",
+ "regexp/syntax",
+ "runtime",
+ "sort",
+ "strconv",
+ "strings",
+ "sync",
+ "sync/atomic",
+ "syscall",
+ "text/template",
+ "text/template/parse",
+ "time",
+ "unicode",
+ "unicode/utf16",
+ "unicode/utf8",
};
static void
@@ -1438,9 +1441,9 @@ clean(void)
xremove(bpathf(&b, "%s/%s", bstr(&path), cleantab[i]+4));
}
- // remove src/pkg/runtime/z* unconditionally
+ // remove src/runtime/z* unconditionally
vreset(&dir);
- bpathf(&path, "%s/src/pkg/runtime", goroot);
+ bpathf(&path, "%s/src/runtime", goroot);
xreaddir(&dir, bstr(&path));
for(j=0; j<dir.len; j++) {
if(hasprefix(dir.p[j], "z"))
@@ -1577,6 +1580,15 @@ cmdbootstrap(int argc, char **argv)
if(argc > 0)
usage();
+ if(isdir(bpathf(&b, "%s/src/pkg", goroot))) {
+ fatal("\n\n"
+ "The Go package sources have moved to $GOROOT/src.\n"
+ "*** %s still exists. ***\n"
+ "It probably contains stale files that may confuse the build.\n"
+ "Please (check what's there and) remove it and try again.\n"
+ "See http://golang.org/s/go14nopkg\n", bpathf(&b, "%s/src/pkg", goroot));
+ }
+
if(rebuildall)
clean();
goversion = findgoversion();
@@ -1607,9 +1619,9 @@ cmdbootstrap(int argc, char **argv)
xsetenv("GOARCH", goarch);
xsetenv("GOOS", goos);
- // Build pkg/runtime for actual goos/goarch too.
+ // Build runtime for actual goos/goarch too.
if(!streq(goos, gohostos) || !streq(goarch, gohostarch))
- install("pkg/runtime");
+ install("runtime");
bfree(&b);
}
diff --git a/src/cmd/dist/buildruntime.c b/src/cmd/dist/buildruntime.c
index 246bd2710..6e87029e7 100644
--- a/src/cmd/dist/buildruntime.c
+++ b/src/cmd/dist/buildruntime.c
@@ -5,7 +5,7 @@
#include "a.h"
/*
- * Helpers for building pkg/runtime.
+ * Helpers for building runtime.
*/
// mkzversion writes zversion.go:
diff --git a/src/cmd/dist/windows.c b/src/cmd/dist/windows.c
index 1102adff5..ff1a27351 100644
--- a/src/cmd/dist/windows.c
+++ b/src/cmd/dist/windows.c
@@ -929,7 +929,7 @@ xsamefile(char *f1, char *f2)
return 1;
torune(&ru, f1);
- // refer to ../../pkg/os/stat_windows.go:/sameFile
+ // refer to ../../os/stat_windows.go:/sameFile
fd1 = CreateFileW(ru, 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
xfree(ru);
if(fd1 == INVALID_HANDLE_VALUE)