diff options
author | Ryan Beltran <ryanbeltran@chromium.org> | 2020-12-15 23:17:01 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-16 03:56:26 +0000 |
commit | 2d837f0b382ae9fbec64607392942aac68437a4d (patch) | |
tree | ff11e181d898dec61b52b30a620a578d4718cc7d /compiler_wrapper | |
parent | 914431e4196e3e38033293771ececf78db95e63d (diff) | |
download | toolchain-utils-2d837f0b382ae9fbec64607392942aac68437a4d.tar.gz |
compiler_wrapper: rename GETRUSAGE flag
GETRUSAGE has been renamed TOOLCHAIN_RUSAGE_OUTPUT for clarity.
BUG=chromium:1156314
TEST=Reran unit tests for package main
Change-Id: I4588b4138f0dd4e4938762250e5caa6b4026e3f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2594261
Reviewed-by: George Burgess <gbiv@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
Diffstat (limited to 'compiler_wrapper')
-rw-r--r-- | compiler_wrapper/compiler_wrapper.go | 6 | ||||
-rw-r--r-- | compiler_wrapper/compiler_wrapper_test.go | 8 | ||||
-rw-r--r-- | compiler_wrapper/rusage_flag.go | 4 | ||||
-rw-r--r-- | compiler_wrapper/rusage_flag_test.go | 8 |
4 files changed, 13 insertions, 13 deletions
diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index 2b9459e4..aca5aa7e 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -145,7 +145,7 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int bisectStage := getBisectStage(env) if shouldForceDisableWerror(env, cfg) { if rusageLogfileName != "" { - return 0, newUserErrorf("GETRUSAGE is meaningless with FORCE_DISABLE_WERROR") + return 0, newUserErrorf("TOOLCHAIN_RUSAGE_OUTPUT is meaningless with FORCE_DISABLE_WERROR") } if bisectStage != "" { return 0, newUserErrorf("BISECT_STAGE is meaningless with FORCE_DISABLE_WERROR") @@ -154,7 +154,7 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int } if shouldCompileWithFallback(env) { if rusageLogfileName != "" { - return 0, newUserErrorf("GETRUSAGE is meaningless with FORCE_DISABLE_WERROR") + return 0, newUserErrorf("TOOLCHAIN_RUSAGE_OUTPUT is meaningless with FORCE_DISABLE_WERROR") } if bisectStage != "" { return 0, newUserErrorf("BISECT_STAGE is meaningless with FORCE_DISABLE_WERROR") @@ -163,7 +163,7 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int } if rusageLogfileName != "" { if bisectStage != "" { - return 0, newUserErrorf("BISECT_STAGE is meaningless with GETRUSAGE") + return 0, newUserErrorf("BISECT_STAGE is meaningless with TOOLCHAIN_RUSAGE_OUTPUT") } return logRusage(env, rusageLogfileName, compilerCmd) } diff --git a/compiler_wrapper/compiler_wrapper_test.go b/compiler_wrapper/compiler_wrapper_test.go index 52b92f56..3584f6ed 100644 --- a/compiler_wrapper/compiler_wrapper_test.go +++ b/compiler_wrapper/compiler_wrapper_test.go @@ -98,10 +98,10 @@ func TestErrorOnLogRusageAndForceDisableWError(t *testing.T) { withTestContext(t, func(ctx *testContext) { ctx.env = []string{ "FORCE_DISABLE_WERROR=1", - "GETRUSAGE=rusage.log", + "TOOLCHAIN_RUSAGE_OUTPUT=rusage.log", } stderr := ctx.mustFail(callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, mainCc))) - if err := verifyNonInternalError(stderr, "GETRUSAGE is meaningless with FORCE_DISABLE_WERROR"); err != nil { + if err := verifyNonInternalError(stderr, "TOOLCHAIN_RUSAGE_OUTPUT is meaningless with FORCE_DISABLE_WERROR"); err != nil { t.Error(err) } }) @@ -111,10 +111,10 @@ func TestErrorOnLogRusageAndBisect(t *testing.T) { withTestContext(t, func(ctx *testContext) { ctx.env = []string{ "BISECT_STAGE=xyz", - "GETRUSAGE=rusage.log", + "TOOLCHAIN_RUSAGE_OUTPUT=rusage.log", } stderr := ctx.mustFail(callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, mainCc))) - if err := verifyNonInternalError(stderr, "BISECT_STAGE is meaningless with GETRUSAGE"); err != nil { + if err := verifyNonInternalError(stderr, "BISECT_STAGE is meaningless with TOOLCHAIN_RUSAGE_OUTPUT"); err != nil { t.Error(err) } }) diff --git a/compiler_wrapper/rusage_flag.go b/compiler_wrapper/rusage_flag.go index e8eb79a7..f43d3515 100644 --- a/compiler_wrapper/rusage_flag.go +++ b/compiler_wrapper/rusage_flag.go @@ -14,7 +14,7 @@ import ( ) func getRusageLogFilename(env env) string { - value, _ := env.getenv("GETRUSAGE") + value, _ := env.getenv("TOOLCHAIN_RUSAGE_OUTPUT") return value } @@ -56,7 +56,7 @@ func logRusage(env env, logFileName string, compilerCmd *command) (exitCode int, compilerCmdWithoutRusage := &command{ Path: compilerCmd.Path, Args: compilerCmd.Args, - EnvUpdates: append(compilerCmd.EnvUpdates, "GETRUSAGE="), + EnvUpdates: append(compilerCmd.EnvUpdates, "TOOLCHAIN_RUSAGE_OUTPUT="), } startTime := time.Now() exitCode, err = wrapSubprocessErrorWithSourceLoc(compilerCmdWithoutRusage, diff --git a/compiler_wrapper/rusage_flag_test.go b/compiler_wrapper/rusage_flag_test.go index 408bdb6c..0736c757 100644 --- a/compiler_wrapper/rusage_flag_test.go +++ b/compiler_wrapper/rusage_flag_test.go @@ -73,7 +73,7 @@ func TestReportGeneralErrorsFromLogRusage(t *testing.T) { func TestCreateDirAndFileForLogRusage(t *testing.T) { withLogRusageTestContext(t, func(ctx *testContext) { logFileName := filepath.Join(ctx.tempDir, "somedir", "rusage.log") - ctx.env = []string{"GETRUSAGE=" + logFileName} + ctx.env = []string{"TOOLCHAIN_RUSAGE_OUTPUT=" + logFileName} ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, mainCc))) if _, err := os.Stat(logFileName); err != nil { @@ -85,7 +85,7 @@ func TestCreateDirAndFileForLogRusage(t *testing.T) { func TestLogRusageFileContent(t *testing.T) { withLogRusageTestContext(t, func(ctx *testContext) { logFileName := filepath.Join(ctx.tempDir, "rusage.log") - ctx.env = []string{"GETRUSAGE=" + logFileName} + ctx.env = []string{"TOOLCHAIN_RUSAGE_OUTPUT=" + logFileName} ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, mainCc))) data, err := ioutil.ReadFile(logFileName) @@ -111,7 +111,7 @@ func TestLogRusageFileContent(t *testing.T) { func TestLogRusageAppendsToFile(t *testing.T) { withLogRusageTestContext(t, func(ctx *testContext) { logFileName := filepath.Join(ctx.tempDir, "rusage.log") - ctx.env = []string{"GETRUSAGE=" + logFileName} + ctx.env = []string{"TOOLCHAIN_RUSAGE_OUTPUT=" + logFileName} ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, mainCc))) data, err := ioutil.ReadFile(logFileName) @@ -152,7 +152,7 @@ func TestLogRusageAppendsToFile(t *testing.T) { func withLogRusageTestContext(t *testing.T, work func(ctx *testContext)) { withTestContext(t, func(ctx *testContext) { - ctx.env = []string{"GETRUSAGE=" + filepath.Join(ctx.tempDir, "rusage.log")} + ctx.env = []string{"TOOLCHAIN_RUSAGE_OUTPUT=" + filepath.Join(ctx.tempDir, "rusage.log")} work(ctx) }) } |