Commit 82568c5c authored by Russ Cox's avatar Russ Cox

cmd/dist: exclude cov and prof from releases

Also check for old and exp.

Fixes #2764.
Fixes #2765.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5654068
parent dcf5ca70
...@@ -283,6 +283,15 @@ static char *oldtool[] = { ...@@ -283,6 +283,15 @@ static char *oldtool[] = {
"quietgcc", "quietgcc",
}; };
// Unreleased directories (relative to $GOROOT) that should
// not be in release branches.
static char *unreleased[] = {
"src/cmd/cov",
"src/cmd/prof",
"src/pkg/old",
"src/pkg/exp",
};
// setup sets up the tree for the initial build. // setup sets up the tree for the initial build.
static void static void
setup(void) setup(void)
...@@ -347,6 +356,13 @@ setup(void) ...@@ -347,6 +356,13 @@ setup(void)
} }
} }
// For release, make sure excluded things are excluded.
if(hasprefix(goversion, "release.") || hasprefix(goversion, "go.")) {
for(i=0; i<nelem(unreleased); i++)
if(isdir(bpathf(&b, "%s/%s", goroot, unreleased[i])))
fatal("%s should not exist in release build", bstr(&b));
}
bfree(&b); bfree(&b);
} }
...@@ -539,6 +555,24 @@ install(char *dir) ...@@ -539,6 +555,24 @@ install(char *dir)
vinit(&lib); vinit(&lib);
vinit(&extra); vinit(&extra);
// path = full path to dir.
bpathf(&path, "%s/src/%s", goroot, dir);
name = lastelem(dir);
// For misc/prof, copy into the tool directory and we're done.
if(hasprefix(dir, "misc/")) {
copy(bpathf(&b, "%s/%s", tooldir, name),
bpathf(&b1, "%s/misc/%s", goroot, name));
goto out;
}
// For release, cmd/prof and cmd/cov are not included.
if((streq(dir, "cmd/cov") || streq(dir, "cmd/prof")) && !isdir(bstr(&path))) {
if(vflag > 1)
xprintf("skipping %s - does not exist\n", dir);
goto out;
}
// set up gcc command line on first run. // set up gcc command line on first run.
if(gccargs.len == 0) { if(gccargs.len == 0) {
xgetenv(&b, "CC"); xgetenv(&b, "CC");
...@@ -549,10 +583,6 @@ install(char *dir) ...@@ -549,10 +583,6 @@ install(char *dir)
vadd(&gccargs, proto_gccargs[i]); vadd(&gccargs, proto_gccargs[i]);
} }
// path = full path to dir.
bpathf(&path, "%s/src/%s", goroot, dir);
name = lastelem(dir);
islib = hasprefix(dir, "lib") || streq(dir, "cmd/cc") || streq(dir, "cmd/gc"); islib = hasprefix(dir, "lib") || streq(dir, "cmd/cc") || streq(dir, "cmd/gc");
ispkg = hasprefix(dir, "pkg"); ispkg = hasprefix(dir, "pkg");
isgo = ispkg || streq(dir, "cmd/go") || streq(dir, "cmd/cgo"); isgo = ispkg || streq(dir, "cmd/go") || streq(dir, "cmd/cgo");
...@@ -1031,6 +1061,8 @@ static char *buildorder[] = { ...@@ -1031,6 +1061,8 @@ static char *buildorder[] = {
"libbio", "libbio",
"libmach", "libmach",
"misc/pprof",
"cmd/cov", "cmd/cov",
"cmd/nm", "cmd/nm",
"cmd/pack", "cmd/pack",
......
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