From 9780ea97662c429f6dcb53fb2ef90e98fe1a5f1b Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Thu, 11 Jul 2019 01:19:42 -0700 Subject: Add support for calling bisect driver Also removes forwarding to old wrapper as we now have all functionality in the new wrapper. BUG=chromium:773875 TEST=unit test, ran command for bisect driver manually in terminal. Change-Id: Icea8a20030bc72e46d6802934acd1d657f62d766 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1697929 Reviewed-by: George Burgess Tested-by: Tobias Bosch --- compiler_wrapper/compiler_wrapper.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'compiler_wrapper/compiler_wrapper.go') diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index 8c5825e8..b0269abe 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -9,11 +9,7 @@ import ( func callCompiler(env env, cfg *config, inputCmd *command) int { exitCode := 0 var compilerErr error - if shouldForwardToOldWrapper(env, inputCmd) { - // TODO: Once this is only checking for bisect, create a command - // that directly calls the bisect driver in calcCompilerCommand. - exitCode, compilerErr = forwardToOldWrapper(env, cfg, inputCmd) - } else if cfg.oldWrapperPath != "" { + if cfg.oldWrapperPath != "" { exitCode, compilerErr = callCompilerWithRunAndCompareToOldWrapper(env, cfg, inputCmd) } else { exitCode, compilerErr = callCompilerInternal(env, cfg, inputCmd) @@ -75,15 +71,25 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int compilerCmd = calcGccCommand(mainBuilder) } rusageLogfileName := getRusageLogFilename(env) + bisectStage := getBisectStage(env) if shouldForceDisableWError(env) { if rusageLogfileName != "" { return 0, newUserErrorf("GETRUSAGE is meaningless with FORCE_DISABLE_WERROR") } + if bisectStage != "" { + return 0, newUserErrorf("BISECT_STAGE is meaningless with FORCE_DISABLE_WERROR") + } return doubleBuildWithWNoError(env, cfg, compilerCmd) } if rusageLogfileName != "" { + if bisectStage != "" { + return 0, newUserErrorf("BISECT_STAGE is meaningless with GETRUSAGE") + } return logRusage(env, rusageLogfileName, compilerCmd) } + if bisectStage != "" { + compilerCmd = calcBisectCommand(env, bisectStage, compilerCmd) + } // Note: We return an exit code only if the underlying env is not // really doing an exec, e.g. commandRecordingEnv. return wrapSubprocessErrorWithSourceLoc(compilerCmd, env.exec(compilerCmd)) -- cgit v1.2.3