From 9bf067dd5a97a8f5bf4dc0bc517afcbbad2b4695 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 4 Nov 2024 19:28:44 -0600 Subject: [PATCH] fix: ftbfs when including simdjson in Node.js (#44567) --- patches/node/.patches | 1 + ...deprecation_ftbfs_in_simdjson_header.patch | 60 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 patches/node/chore_disable_deprecation_ftbfs_in_simdjson_header.patch diff --git a/patches/node/.patches b/patches/node/.patches index 1394c2d7bca5..d8853df51624 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -42,3 +42,4 @@ build_restore_clang_as_default_compiler_on_macos.patch fix_-wextra-semi_errors_in_nghttp2_helper_h.patch fix_remove_harmony-import-assertions_from_node_cc.patch win_almost_fix_race_detecting_esrch_in_uv_kill.patch +chore_disable_deprecation_ftbfs_in_simdjson_header.patch diff --git a/patches/node/chore_disable_deprecation_ftbfs_in_simdjson_header.patch b/patches/node/chore_disable_deprecation_ftbfs_in_simdjson_header.patch new file mode 100644 index 000000000000..266554c00ca2 --- /dev/null +++ b/patches/node/chore_disable_deprecation_ftbfs_in_simdjson_header.patch @@ -0,0 +1,60 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charles Kerr +Date: Mon, 4 Nov 2024 17:40:17 -0600 +Subject: chore: disable deprecation ftbfs in simdjson header + +Without this patch, building with simdjson fails with + +> error: identifier '_padded' preceded by whitespace in a literal operator +> declaration is deprecated [-Werror,-Wdeprecated-literal-operator] + +This patch can be removed once this is fixed upstream in simdjson. + +diff --git a/deps/simdjson/simdjson.h b/deps/simdjson/simdjson.h +index ddb6f2e4e0a6edd23d5e16db07bc4bb18974d4aa..533dfea4d5fd3c7f6f7fdf0ea525479b11634fd3 100644 +--- a/deps/simdjson/simdjson.h ++++ b/deps/simdjson/simdjson.h +@@ -3650,12 +3650,17 @@ inline std::ostream& operator<<(std::ostream& out, simdjson_result padded_string::load(std::string_view filen + + } // namespace simdjson + ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wdeprecated-literal-operator" ++ + inline simdjson::padded_string operator "" _padded(const char *str, size_t len) { + return simdjson::padded_string(str, len); + } +@@ -4041,6 +4049,8 @@ inline simdjson::padded_string operator "" _padded(const char8_t *str, size_t le + return simdjson::padded_string(reinterpret_cast(str), len); + } + #endif ++#pragma clang diagnostic pop ++ + #endif // SIMDJSON_PADDED_STRING_INL_H + /* end file simdjson/padded_string-inl.h */ + /* skipped duplicate #include "simdjson/padded_string_view.h" */ +@@ -118280,4 +118290,4 @@ namespace simdjson { + /* end file simdjson/ondemand.h */ + + #endif // SIMDJSON_H +-/* end file simdjson.h */ ++/* end file simdjson.h */ +\ No newline at end of file