Skip to content

dev: dev doctor can fail due to misconfigured Bazel #73656

@rickystewart

Description

@rickystewart

Here are some logs:

Failed to build pkg/cmd/dev! Got output:
Loading:
Loading: 0 packages loaded
Analyzing: target //pkg/cmd/dev:dev (1 packages loaded, 0 targets configured)
INFO: Analyzed target //pkg/cmd/dev:dev (8 packages loaded, 41 targets configured).
INFO: Found 1 target...
[0 / 2] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[38 / 341] Compiling src/google/protobuf/any.cc; 1s darwin-sandbox ... (16 actions,
15 running)
ERROR: /private/var/tmp/_bazel_marcus/61eb653382e9435773303080c4f9ae5d/external/com_
google_protobuf/BUILD:110:11: Compiling src/google/protobuf/io/coded_stream.cc faile
d: (Exit 1): cc_wrapper.sh failed: error executing command external/local_config_cc/
cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assig
n -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG
 ... (remaining 32 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/com_google_protobuf/src/google/protobuf/io/coded_stre
am.cc:46:
external/com_google_protobuf/src/google/protobuf/io/coded_stream_inl.h:50:31: error:
 out-of-line definition of 'InternalReadStringInline' does not match any declaration
 in 'google::protobuf::io::CodedInputStream'
inline bool CodedInputStream::InternalReadStringInline(std::string* buffer,
                              ^~~~~~~~~~~~~~~~~~~~~~~~
external/com_google_protobuf/src/google/protobuf/io/coded_stream_inl.h:70:31: error:
 out-of-line definition of 'InternalReadRawInline' does not match any declaration in
 'google::protobuf::io::CodedInputStream'
inline bool CodedInputStream::InternalReadRawInline(void* buffer, int size) {
                              ^~~~~~~~~~~~~~~~~~~~~
external/com_google_protobuf/src/google/protobuf/io/coded_stream.cc:87:25: error: re
definition of 'EnableAliasing'
void CodedOutputStream::EnableAliasing(bool enabled) {
                        ^
/usr/local/include/google/protobuf/io/coded_stream.h:1214:8: note: previous definiti
on is here
  void EnableAliasing(bool enabled) { impl_.EnableAliasing(enabled); }

In this case because the user's machine is configured incorrectly for C++ compilation, they can't build any C++ code. But since dev incidentally depends on C++, that means it can't be built to run dev doctor, which would run the checks needed to fix your configuration. We should squash whatever dependency dev has on proto stuff.

Epic CRDB-8036

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-systemC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-dev-inf

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions