Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not build nighthawk #833

Closed
bryanwux opened this issue Apr 17, 2022 · 9 comments
Closed

Can not build nighthawk #833

bryanwux opened this issue Apr 17, 2022 · 9 comments
Assignees
Labels
question Further information is requested

Comments

@bryanwux
Copy link

bryanwux commented Apr 17, 2022

Title: One line description
Can't build the project in Ubuntu 20.04 with latest commit
Description:

What issue is being seen? Describe what should be happening instead of
the bug, for example: Nighthawk should not crash, the expected value isn't
returned, etc.

Reproduction steps:

Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.

I simply installed all the prerequisites by:

apt-get update \
    && apt-get install -y --no-install-recommends \
	apt-utils build-essential \
	g++ \
    autoconf \
    automake \
    cmake \
    curl \
    libtool \
    make \
    ninja-build \
    patch \
    python3-pip \
    unzip \
    virtualenv \
	wget \
	git \
    vim \
    && rm -rf /var/lib/apt/lists/* \
    && wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \
    && chmod +x /usr/local/bin/bazel

Then, bazel build -c opt //:nighthawk

Note: If there are privacy concerns, sanitize the data prior to
sharing.

Logs:

Include the Nighthawk logs.

INFO: From Generating Descriptor Set proto_library //api/adaptive_load:adaptive_load_proto:
api/adaptive_load/benchmark_result.proto:10:1: warning: Import google/rpc/status.proto is unused.
api/adaptive_load/adaptive_load.proto:12:1: warning: Import google/rpc/status.proto is unused.
INFO: From Compiling src/core/ext/xds/xds_api.cc:
In file included from external/com_github_grpc_grpc/src/core/ext/xds/xds_api.h:28,
                 from external/com_github_grpc_grpc/src/core/ext/xds/xds_api.cc:92:
external/com_google_absl/absl/container/inlined_vector.h: In function 'grpc_error* grpc_core::{anonymous}::EdsResponseParse(const grpc_core::{anonymous}::EncodingContext&, const envoy_service_discovery_v3_DiscoveryResponse*, const std::set<absl::string_view>&, grpc_core::XdsApi::EdsUpdateMap*, std::set<std::__cxx11::basic_string<char> >*)':
external/com_google_absl/absl/container/inlined_vector.h:322:18: warning: 'priority' may be used uninitialized in this function [-Wmaybe-uninitialized]
  322 |     return data()[i];
      |            ~~~~~~^
external/com_github_grpc_grpc/src/core/ext/xds/xds_api.cc:3287:14: note: 'priority' was declared here
 3287 |       size_t priority;
      |              ^~~~~~~~
[2,592 / 3,451] Compiling external/envoy_api/envoy/api/v2/route/route_components.pb.cc; 26s processwrapper-sandbox ... (112 actions, 111 running)
[2,844 / 3,451] Compiling source/common/json/json_internal.cc; 42s processwrapper-sandbox ... (112 actions, 111 running)
[3,060 / 3,451] Compiling quiche/quic/core/quic_sent_packet_manager.cc; 25s processwrapper-sandbox ... (112 actions, 111 running)
[3,215 / 3,451] Compiling source/common/http/match_wrapper/config.cc; 51s processwrapper-sandbox ... (112 actions, 111 running)
ERROR: /root/.cache/bazel/_bazel_root/57978571fc50b6c6f1a3a582dfeef4da/external/envoy/source/common/config/BUILD:414:17: Compiling source/common/config/watch_map.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 150 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
external/envoy/source/common/config/watch_map.cc: In member function 'virtual void Envoy::Config::WatchMap::onConfigUpdate(const google::protobuf::RepeatedPtrField<envoy::service::discovery::v3::Resource>&, const google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char> >&, const string&)':
external/envoy/source/common/config/watch_map.cc:215:69: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  215 |       type_url_, reinterpret_cast<std::vector<DecodedResourcePtr>&>(decoded_resources),
      |                                                                     ^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
Target //:nighthawk failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 392.058s, Critical Path: 85.67s
INFO: 3339 processes: 226 internal, 3113 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

Note: If there are privacy concerns, sanitize the data prior to
sharing.

Call Stack:

If the Envoy binary is crashing, a call stack is required.
Please refer to the Bazel Stack trace documentation.

@bryanwux bryanwux added the bug Something isn't working label Apr 17, 2022
@bryanwux
Copy link
Author

bryanwux commented Apr 18, 2022

Update: I build nighthawk successfully with commit ba3b5d0

@k0eff
Copy link

k0eff commented Apr 18, 2022

Would you post how exactly did you set up your environment?

@bryanwux
Copy link
Author

bryanwux commented Apr 18, 2022

Would you post how exactly did you set up your environment?

I followed this instruction https://getnighthawk.dev/docs/building-nighthawk/. Then git clone nighthawk repo, checkout to ba3b5d0 and build.
Make sure you install bazelisk instead of bazel, otherwise you will have some version issues I think.

@k0eff
Copy link

k0eff commented Apr 18, 2022

It's exactly what I'm following however the build still fails with either of these:

@mum4k mum4k self-assigned this Apr 18, 2022
@mum4k
Copy link
Collaborator

mum4k commented Apr 18, 2022

@bryanwux has this problem been resolved, or is there anything outstanding here?

@mum4k
Copy link
Collaborator

mum4k commented Apr 19, 2022

For context, the latest commit on the main branch (2256da1) built successfully in the CI.

@mum4k mum4k added question Further information is requested and removed bug Something isn't working labels Apr 19, 2022
@mum4k
Copy link
Collaborator

mum4k commented Apr 21, 2022

Closing with the assumption that the problem has been resolved. Also please take a look at #832 which contains some additional advice in relation to the version of Clang / LLVM to use when building Nighthawk.

@bryanwux
Copy link
Author

bryanwux commented Apr 21, 2022

@bryanwux has this problem been resolved, or is there anything outstanding here?

Sorry, I forgot to comment that my problem has been resolved. Thank you for your detailed instruction! @mum4k

@mum4k
Copy link
Collaborator

mum4k commented Apr 21, 2022

Thank you for confirming @bryanwux.

mum4k added a commit that referenced this issue Apr 22, 2022
Addresses concerns raised in #832 and #833.

Signed-off-by: Jakub Sobon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants