[iwyu] Better error checking in script (#31957)

* fff

* fff

* fff

* better error checking

* x

* fix

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
reviewable/pr31958/r1
Craig Tiller 2 years ago committed by GitHub
parent 25b0aff1e7
commit feb43c589f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/core/BUILD
  2. 5
      src/core/lib/event_engine/posix.h
  3. 4
      test/core/client_channel/lb_policy/round_robin_test.cc
  4. 14
      tools/dockerfile/grpc_iwyu/iwyu.sh

@ -1390,6 +1390,7 @@ grpc_cc_library(
external_deps = [
"absl/functional:any_invocable",
"absl/status",
"absl/status:statusor",
],
deps = [
"//:event_engine_base_hdrs",

@ -16,16 +16,15 @@
#include <grpc/support/port_platform.h>
#include <functional>
#include <vector>
#include <memory>
#include "absl/functional/any_invocable.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include <grpc/event_engine/endpoint_config.h>
#include <grpc/event_engine/event_engine.h>
#include <grpc/event_engine/memory_allocator.h>
#include <grpc/event_engine/port.h>
#include <grpc/event_engine/slice_buffer.h>
namespace grpc_event_engine {

@ -16,13 +16,15 @@
#include <stddef.h>
#include <array>
#include "absl/status/status.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "gtest/gtest.h"
#include <grpc/grpc.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/load_balancing/lb_policy.h"

@ -42,10 +42,22 @@ git clone https://github.com/include-what-you-use/include-what-you-use.git iwyu
# latest commit on the clang 15 branch
cd ${IWYU_ROOT}/iwyu
git checkout 7f0b6c304acf69c42bb7f6e03c63f836924cb7e0
if [ $? -ne 0 ]; then
echo "Failed to checkout iwyu commit"
exit 1
fi
mkdir -p ${IWYU_ROOT}/iwyu_build
cd ${IWYU_ROOT}/iwyu_build
cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ROOT_DIR=/usr/lib/llvm-15 ${IWYU_ROOT}/iwyu
if [ $? -ne 0 ]; then
echo "Failed to cmake iwyu"
exit 1
fi
make -j $CPU_COUNT
if [ $? -ne 0 ]; then
echo "Failed to make iwyu"
exit 1
fi
cd ${IWYU_ROOT}
# patch python shebang for our environment (we need python3, not python)
@ -53,7 +65,7 @@ sed -i 's,^#!/usr/bin/env python,#!/usr/bin/env python3,g' ${IWYU_ROOT}/iwyu/iwy
sed -i 's,^#!/usr/bin/env python,#!/usr/bin/env python3,g' ${IWYU_ROOT}/iwyu/fix_includes.py
cat compile_commands.json \
| sed "s/ -DNDEBUG//g" \
| sed "s/ -DNDEBUG//g" \
| sed "s,\"file\": \",\"file\": \"${IWYU_ROOT}/,g" \
> compile_commands_for_iwyu.json

Loading…
Cancel
Save