Skip to content

Commit

Permalink
build(deps): fix v8 missing include for numeric_t types (envoyproxy#2…
Browse files Browse the repository at this point in the history
…9425)

See envoyproxy#29311.

The patch fixes include types for late clang (15.0.7) / gcc (13.2.1)
for Arch linux / Fedora, like in

    In file included from external/v8/src/torque/torque.cc:5:
    In file included from external/v8/src/torque/source-positions.h:10:
    In file included from external/v8/src/torque/contextual.h:10:
    In file included from external/v8/src/base/macros.h:12:
    external/v8/src/base/logging.h:154:26: error: use of undeclared identifier 'uint16_t'

Signed-off-by: Ivan Prisyazhnyy <[email protected]>
  • Loading branch information
sitano authored Oct 16, 2023
1 parent 2b7a0dd commit 0c67f82
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,10 @@ cc_library(name = "curl", visibility = ["//visibility:public"], deps = ["@envoy/
def _v8():
external_http_archive(
name = "v8",
patches = ["@envoy//bazel:v8.patch"],
patches = [
"@envoy//bazel:v8.patch",
"@envoy//bazel:v8_include.patch",
],
patch_args = ["-p1"],
)
native.bind(
Expand Down
41 changes: 41 additions & 0 deletions bazel/v8_include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# fix include types for late clang (15.0.7) / gcc (13.2.1)
# for Arch linux / Fedora, like in
# In file included from external/v8/src/torque/torque.cc:5:
# In file included from external/v8/src/torque/source-positions.h:10:
# In file included from external/v8/src/torque/contextual.h:10:
# In file included from external/v8/src/base/macros.h:12:
# external/v8/src/base/logging.h:154:26: error: use of undeclared identifier 'uint16_t'

diff --git a/src/base/logging.h b/src/base/logging.h
--- a/src/base/logging.h
+++ b/src/base/logging.h
@@ -5,6 +5,7 @@
#ifndef V8_BASE_LOGGING_H_
#define V8_BASE_LOGGING_H_

+#include <cstdint>
#include <cstring>
#include <sstream>
#include <string>
diff --git a/src/base/macros.h b/src/base/macros.h
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -5,6 +5,7 @@
#ifndef V8_BASE_MACROS_H_
#define V8_BASE_MACROS_H_

+#include <cstdint>
#include <limits>
#include <type_traits>

diff --git a/src/inspector/v8-string-conversions.h b/src/inspector/v8-string-conversions.h
--- a/src/inspector/v8-string-conversions.h
+++ b/src/inspector/v8-string-conversions.h
@@ -5,6 +5,7 @@
#ifndef V8_INSPECTOR_V8_STRING_CONVERSIONS_H_
#define V8_INSPECTOR_V8_STRING_CONVERSIONS_H_

+#include <cstdint>
#include <string>

// Conversion routines between UT8 and UTF16, used by string-16.{h,cc}. You may

0 comments on commit 0c67f82

Please sign in to comment.