envoy: /v8/src/base/logging.h:154:26: error: 'uint16_t' was not declared in this scope

Trying to compile sources using command

bazel build -c opt envoy \
  --subcommands \
  --jobs 1 \
  --verbose_failures \
  --sandbox_debug \
  --copt="-Wno-changes-meaning" \
  --define tcmalloc=gperftools

I got error

external/v8/src/base/logging.h:154:26: error: 'uint16_t' was not declared in this scope

Full error message

SUBCOMMAND: # @v8//:torque [action 'Compiling src/torque/torque.cc [for tool]', configuration: 624de2cbb434667587fa1b4f4b32920a311d1cdaf10a170eb8eb9041d48c0257, execution platform: @local_config_platform//:host, mnemonic: aarch64-opt-exec-ST-13fd9e64b72b]
(cd /home/centos/.cache/bazel/_bazel_centos/221703495c2e97a5482194eda3ea2f8b/execroot/envoy && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
  /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 -fdata-sections '-std=c++14' -MD -MF bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/_objs/torque/torque.d '-frandom-seed=bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/_objs/torque/torque.o' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_ENABLE_WEBASSEMBLY -DGOOGLE3 -DENABLE_DEBUGGER_SUPPORT -DV8_ADVANCED_BIGINT_ALGORITHMS -DV8_CONCURRENT_MARKING -DV8_TARGET_ARCH_ARM64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_LINUX -DV8_SHORT_BUILTIN_CALLS '-DBAZEL_CURRENT_REPOSITORY="v8"' -iquote external/v8 -iquote bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8 -iquote external/bazel_tools -iquote bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/bazel_tools -isystem external/v8/include -isystem bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/include -g0 -g0 '-std=c++17' -fexceptions -fPIC -fno-strict-aliasing -Werror -Wextra -Wno-unknown-warning-option -Wno-bitwise-instead-of-logical -Wno-builtin-assume-aligned-alignment -Wno-unused-parameter -Wno-implicit-int-float-conversion -Wno-deprecated-copy -Wno-non-virtual-dtor -isystem . -Wno-extra -Wno-array-bounds -Wno-class-memaccess -Wno-comments -Wno-deprecated-declarations -Wno-implicit-fallthrough -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-mismatched-new-delete -Wno-redundant-move -Wno-return-type -Wno-stringop-overflow -Wno-nonnull '-std=gnu++17' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/v8/src/torque/torque.cc -o bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/_objs/torque/torque.o)
# Configuration: 624de2cbb434667587fa1b4f4b32920a311d1cdaf10a170eb8eb9041d48c0257
# Execution platform: @local_config_platform//:host
ERROR: /home/centos/.cache/bazel/_bazel_centos/221703495c2e97a5482194eda3ea2f8b/external/v8/BUILD.bazel:3657:10: Compiling src/torque/torque.cc [for tool] failed: (Exit 1): process-wrapper failed: error executing CppCompile command 
  (cd /home/centos/.cache/bazel/_bazel_centos/221703495c2e97a5482194eda3ea2f8b/sandbox/processwrapper-sandbox/157/execroot/envoy && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /home/centos/.cache/bazel/_bazel_centos/install/e35776b7f6e7942d80f99a8a88bdd24b/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/home/centos/.cache/bazel/_bazel_centos/221703495c2e97a5482194eda3ea2f8b/sandbox/processwrapper-sandbox/157/stats.out' /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 -fdata-sections '-std=c++14' -MD -MF bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/_objs/torque/torque.d '-frandom-seed=bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/_objs/torque/torque.o' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_ENABLE_WEBASSEMBLY -DGOOGLE3 -DENABLE_DEBUGGER_SUPPORT -DV8_ADVANCED_BIGINT_ALGORITHMS -DV8_CONCURRENT_MARKING -DV8_TARGET_ARCH_ARM64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_LINUX -DV8_SHORT_BUILTIN_CALLS '-DBAZEL_CURRENT_REPOSITORY="v8"' -iquote external/v8 -iquote bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8 -iquote external/bazel_tools -iquote bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/bazel_tools -isystem external/v8/include -isystem bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/include -g0 -g0 '-std=c++17' -fexceptions -fPIC -fno-strict-aliasing -Werror -Wextra -Wno-unknown-warning-option -Wno-bitwise-instead-of-logical -Wno-builtin-assume-aligned-alignment -Wno-unused-parameter -Wno-implicit-int-float-conversion -Wno-deprecated-copy -Wno-non-virtual-dtor -isystem . -Wno-extra -Wno-array-bounds -Wno-class-memaccess -Wno-comments -Wno-deprecated-declarations -Wno-implicit-fallthrough -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-mismatched-new-delete -Wno-redundant-move -Wno-return-type -Wno-stringop-overflow -Wno-nonnull '-std=gnu++17' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/v8/src/torque/torque.cc -o bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/_objs/torque/torque.o)
In file included from external/v8/src/base/macros.h:12,
                 from external/v8/src/torque/contextual.h:10,
                 from external/v8/src/torque/source-positions.h:10,
                 from external/v8/src/torque/torque.cc:5:
external/v8/src/base/logging.h: In function 'auto v8::base::detail::GetUnderlyingEnumTypeForPrinting(T)':
external/v8/src/base/logging.h:154:26: error: 'uint16_t' was not declared in this scope
  154 |                          uint16_t> >;
      |                          ^~~~~~~~
external/v8/src/base/logging.h:17:1: note: 'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   16 | #include "src/base/template-utils.h"
  +++ |+#include <cstdint>
   17 | 
external/v8/src/base/logging.h:154:34: error: template argument 3 is invalid
  154 |                          uint16_t> >;
      |                                  ^
external/v8/src/base/logging.h:154:36: error: template argument 3 is invalid
  154 |                          uint16_t> >;
      |                                    ^
external/v8/src/base/logging.h:154:37: error: expected identifier before ';' token
  154 |                          uint16_t> >;
      |                                     ^
external/v8/src/base/logging.h:155:22: error: 'int_t' does not name a type; did you mean 'wint_t'?
  155 |   return static_cast<int_t>(static_cast<underlying_t>(val));
      |                      ^~~~~
      |                      wint_t
external/v8/src/base/macros.h: At global scope:
external/v8/src/base/macros.h:316:8: error: 'uint64_t' does not name a type
  316 | inline uint64_t make_uint64(uint32_t high, uint32_t low) {
      |        ^~~~~~~~
external/v8/src/base/macros.h:13:1: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   12 | #include "src/base/logging.h"
  +++ |+#include <cstdint>
   13 | 
external/v8/src/base/macros.h:322:25: error: 'intptr_t' has not been declared
  322 | inline T RoundDown(T x, intptr_t m) {
      |                         ^~~~~~~~
external/v8/src/base/macros.h:328:11: error: 'intptr_t' has not been declared
  328 | template <intptr_t m, typename T>
      |           ^~~~~~~~
external/v8/src/base/macros.h: In function 'constexpr T RoundDown(T)':
external/v8/src/base/macros.h:332:17: error: 'm' was not declared in this scope
  332 |   static_assert(m != 0 && ((m & (m - 1)) == 0));
      |                 ^
external/v8/src/base/macros.h: At global scope:
external/v8/src/base/macros.h:338:23: error: 'intptr_t' has not been declared
  338 | inline T RoundUp(T x, intptr_t m) {
      |                       ^~~~~~~~
external/v8/src/base/macros.h:345:11: error: 'intptr_t' has not been declared
  345 | template <intptr_t m, typename T>
      |           ^~~~~~~~
external/v8/src/base/macros.h: In function 'constexpr T RoundUp(T)':
external/v8/src/base/macros.h:350:20: error: 'm' was not declared in this scope
  350 |   return RoundDown<m, T>(static_cast<T>(x + (m - 1)));
      |                    ^
external/v8/src/base/macros.h: In function 'void* AlignedAddress(void*, size_t)':
external/v8/src/base/macros.h:361:51: error: 'uintptr_t' does not name a type
  361 |   return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(address) &
      |                                                   ^~~~~~~~~
external/v8/src/base/macros.h:361:51: note: 'uintptr_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
external/v8/src/base/macros.h:362:47: error: 'uintptr_t' does not name a type
  362 |                                  ~static_cast<uintptr_t>(alignment - 1));
      |                                               ^~~~~~~~~
external/v8/src/base/macros.h:362:47: note: 'uintptr_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
At global scope:
cc1plus: note: unrecognized command-line option '-Wno-implicit-int-float-conversion' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-builtin-assume-aligned-alignment' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-bitwise-instead-of-logical' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
Target //source/exe:envoy-static failed to build
ERROR: /home/centos/.cache/bazel/_bazel_centos/221703495c2e97a5482194eda3ea2f8b/external/v8/BUILD.bazel:3562:11 Middleman _middlemen/@v8_S_S_Cv8_Ulibshared_Unoicu-cc_library-compile failed: (Exit 1): process-wrapper failed: error executing CppCompile command 
  (cd /home/centos/.cache/bazel/_bazel_centos/221703495c2e97a5482194eda3ea2f8b/sandbox/processwrapper-sandbox/157/execroot/envoy && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /home/centos/.cache/bazel/_bazel_centos/install/e35776b7f6e7942d80f99a8a88bdd24b/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/home/centos/.cache/bazel/_bazel_centos/221703495c2e97a5482194eda3ea2f8b/sandbox/processwrapper-sandbox/157/stats.out' /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 -fdata-sections '-std=c++14' -MD -MF bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/_objs/torque/torque.d '-frandom-seed=bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/_objs/torque/torque.o' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_ENABLE_WEBASSEMBLY -DGOOGLE3 -DENABLE_DEBUGGER_SUPPORT -DV8_ADVANCED_BIGINT_ALGORITHMS -DV8_CONCURRENT_MARKING -DV8_TARGET_ARCH_ARM64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_LINUX -DV8_SHORT_BUILTIN_CALLS '-DBAZEL_CURRENT_REPOSITORY="v8"' -iquote external/v8 -iquote bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8 -iquote external/bazel_tools -iquote bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/bazel_tools -isystem external/v8/include -isystem bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/include -g0 -g0 '-std=c++17' -fexceptions -fPIC -fno-strict-aliasing -Werror -Wextra -Wno-unknown-warning-option -Wno-bitwise-instead-of-logical -Wno-builtin-assume-aligned-alignment -Wno-unused-parameter -Wno-implicit-int-float-conversion -Wno-deprecated-copy -Wno-non-virtual-dtor -isystem . -Wno-extra -Wno-array-bounds -Wno-class-memaccess -Wno-comments -Wno-deprecated-declarations -Wno-implicit-fallthrough -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-mismatched-new-delete -Wno-redundant-move -Wno-return-type -Wno-stringop-overflow -Wno-nonnull '-std=gnu++17' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/v8/src/torque/torque.cc -o bazel-out/aarch64-opt-exec-ST-13fd9e64b72b/bin/external/v8/_objs/torque/torque.o)
INFO: Elapsed time: 303.095s, Critical Path: 54.94s
INFO: 160 processes: 4 internal, 156 processwrapper-sandbox.
ERROR: Build did NOT complete successfully

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 17 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Maybe adding a CI build with Fedora or Arch is warranted?

i dont think we want platform-specific testing - the point of using bazel is that we should at least theoretically get reproducible builds in any environment, and the point of static compiling is that it should deploy anywhere (with a supported glibc)

we have gcc tests already in ci, not sure if more could be done there

also, happy to work with any downstreams to improve compatibility etc.

i should say that we have limited capacity to support builds other than our officially supported way (ie using the ubuntu build container)

docker build works. I am looking into building it locally though. Maybe I will send some patches soon for Clang builds.

it’s v8 - external dependency, not envoy’s code

potentially we could patch it if there is a common issue - fixing upstream would also be an option cc @mpwarres

Yes. The problem is there are many more. In Arch I have some with Clang also.

i can only recommend using the build container as it increases the chances of success a lot (its tested in our CI)

wrt issue here im wondering if there are any fixes/workarounds that can make this work more generally or whether we can clarify build constraints in terms of supported versions etc and update some docs somewhere