From: Russ Cox Date: Fri, 1 Feb 2013 06:02:20 +0000 (-0800) Subject: cmd/dist: redirect acid output to file to separate from errors X-Git-Tag: go1.1rc2~1203 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7fc64a2a1da272361fc78453c7ffea17def3bcb0;p=gostls13.git cmd/dist: redirect acid output to file to separate from errors If runtime's proc.c does not compile, cmd/dist used to show the compile errors in a sea of acid output, making them impossible to find. Change the command invocation to write the acid output to a file, so that the errors are the only thing shown on failure. R=golang-dev, iant CC=golang-dev https://golang.org/cl/7221082 --- diff --git a/src/cmd/dist/buildruntime.c b/src/cmd/dist/buildruntime.c index 6c07e2a487..f46f72d4b9 100644 --- a/src/cmd/dist/buildruntime.c +++ b/src/cmd/dist/buildruntime.c @@ -205,7 +205,7 @@ mkzasm(char *dir, char *file) fatal("unknown $GOOS/$GOARCH in mkzasm"); ok: - // Run 6c -D GOOS_goos -D GOARCH_goarch -I workdir -a proc.c + // Run 6c -D GOOS_goos -D GOARCH_goarch -I workdir -a -n -o workdir/proc.acid proc.c // to get acid [sic] output. vreset(&argv); vadd(&argv, bpathf(&b, "%s/%sc", tooldir, gochar)); @@ -216,8 +216,12 @@ ok: vadd(&argv, "-I"); vadd(&argv, bprintf(&b, "%s", workdir)); vadd(&argv, "-a"); + vadd(&argv, "-n"); + vadd(&argv, "-o"); + vadd(&argv, bpathf(&b, "%s/proc.acid", workdir)); vadd(&argv, "proc.c"); - runv(&in, dir, CheckExit, &argv); + runv(nil, dir, CheckExit, &argv); + readfile(&in, bpathf(&b, "%s/proc.acid", workdir)); // Convert input like // aggr G @@ -288,11 +292,12 @@ mkzruntimedefs(char *dir, char *file) { int i, skip; char *p; - Buf in, b, out; + Buf in, b, b1, out; Vec argv, lines, fields, seen; binit(&in); binit(&b); + binit(&b1); binit(&out); vinit(&argv); vinit(&lines); @@ -308,7 +313,7 @@ mkzruntimedefs(char *dir, char *file) ); - // Run 6c -D GOOS_goos -D GOARCH_goarch -I workdir -q + // Run 6c -D GOOS_goos -D GOARCH_goarch -I workdir -q -n -o workdir/runtimedefs // on each of the runtimedefs C files. vadd(&argv, bpathf(&b, "%s/%sc", tooldir, gochar)); vadd(&argv, "-D"); @@ -318,11 +323,15 @@ mkzruntimedefs(char *dir, char *file) vadd(&argv, "-I"); vadd(&argv, bprintf(&b, "%s", workdir)); vadd(&argv, "-q"); + vadd(&argv, "-n"); + vadd(&argv, "-o"); + vadd(&argv, bpathf(&b, "%s/runtimedefs", workdir)); vadd(&argv, ""); p = argv.p[argv.len-1]; for(i=0; i