From a50a9c16b6a3b2522bea3b6562d023a7b87dbd49 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Fri, 16 Aug 2019 11:47:00 -0700 Subject: Forward os.Stdin to child processes. BUG=chromium:773875 TEST=unit tests, build glibc with compiler wrapper Change-Id: I0b5c1f5adaee18499b72747cd6042b00a9d52c1d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1760973 Reviewed-by: George Burgess Tested-by: Tobias Bosch --- compiler_wrapper/clang_tidy_flag.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler_wrapper/clang_tidy_flag.go') diff --git a/compiler_wrapper/clang_tidy_flag.go b/compiler_wrapper/clang_tidy_flag.go index 5bd67064..616ff47c 100644 --- a/compiler_wrapper/clang_tidy_flag.go +++ b/compiler_wrapper/clang_tidy_flag.go @@ -77,8 +77,10 @@ func runClangTidy(env env, clangCmd *command, cSrcFile string) error { EnvUpdates: clangCmd.EnvUpdates, } + // Note: We pass nil as stdin as we checked before that the compiler + // was invoked with a source file argument. exitCode, err := wrapSubprocessErrorWithSourceLoc(clangTidyCmd, - env.run(clangTidyCmd, env.stdout(), env.stderr())) + env.run(clangTidyCmd, nil, env.stdout(), env.stderr())) if err == nil && exitCode != 0 { // Note: We continue on purpose when clang-tidy fails // to maintain compatibility with the previous wrapper. -- cgit v1.2.3