Skip to content

Commit

Permalink
deps: integrate and use local copy of http-parser library (#19786)
Browse files Browse the repository at this point in the history
* integrate and use local copy of http-parser; refs #19749
* ignore third party dependency: http-parser
* exclude http-parser third-party code from clang-tidy

Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
  • Loading branch information
ameily authored Feb 11, 2022
1 parent 7f3f8f0 commit d3ecdce
Show file tree
Hide file tree
Showing 8 changed files with 3,037 additions and 40 deletions.
File renamed without changes.
4 changes: 4 additions & 0 deletions bazel/external/http_parser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is a clone of the [http-parser](https://github.com/nodejs/http-parser)
repo at commit `4f15b7d510dc7c6361a26a7c6d2f7c3a17f8d878`. See GitHub issue
[#19749](https://github.com/envoyproxy/envoy/issues/19749) for more
information.
2,575 changes: 2,575 additions & 0 deletions bazel/external/http_parser/http_parser.c

Large diffs are not rendered by default.

449 changes: 449 additions & 0 deletions bazel/external/http_parser/http_parser.h

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,9 @@ def _com_github_nlohmann_json():
)

def _com_github_nodejs_http_parser():
external_http_archive(
name = "com_github_nodejs_http_parser",
build_file = "@envoy//bazel/external:http-parser.BUILD",
)
native.bind(
name = "http_parser",
actual = "@com_github_nodejs_http_parser//:http_parser",
actual = "@envoy//bazel/external/http_parser",
)

def _com_github_alibaba_hessian2_codec():
Expand Down
14 changes: 0 additions & 14 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -516,20 +516,6 @@ REPOSITORY_LOCATIONS_SPEC = dict(
release_date = "2021-03-05",
cpe = "N/A",
),
com_github_nodejs_http_parser = dict(
project_name = "HTTP Parser",
project_desc = "Parser for HTTP messages written in C",
project_url = "https://github.com/nodejs/http-parser",
# This SHA includes fix for https://github.com/nodejs/http-parser/issues/517 which allows (opt-in) to serve
# requests with both Content-Legth and Transfer-Encoding: chunked headers set.
version = "4f15b7d510dc7c6361a26a7c6d2f7c3a17f8d878",
sha256 = "6a12896313ce1ca630cf516a0ee43a79b5f13f5a5d8143f56560ac0b21c98fac",
strip_prefix = "http-parser-{version}",
urls = ["https://github.com/nodejs/http-parser/archive/{version}.tar.gz"],
use_category = ["controlplane", "dataplane_core"],
release_date = "2020-07-10",
cpe = "cpe:2.3:a:nodejs:node.js:*",
),
com_github_alibaba_hessian2_codec = dict(
project_name = "hessian2-codec",
project_desc = "hessian2-codec is a C++ library for hessian2 codec",
Expand Down
2 changes: 1 addition & 1 deletion ci/run_clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function exclude_check_format_testdata() {

# Exclude files in third_party which are temporary forks from other OSS projects.
function exclude_third_party() {
grep -v third_party/
grep -v third_party/ | grep -v bazel/external/http_parser
}

# Exclude files which are part of the Wasm emscripten environment
Expand Down
27 changes: 7 additions & 20 deletions tools/code_format/check_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,14 @@
import paths

EXCLUDED_PREFIXES = (
"./generated/",
"./thirdparty/",
"./build",
"./.git/",
"./bazel-",
"./.cache",
"./source/extensions/extensions_build_config.bzl",
"./contrib/contrib_build_config.bzl",
"./bazel/toolchains/configs/",
"./tools/testdata/check_format/",
"./tools/pyformat/",
"./third_party/",
"./test/extensions/filters/http/wasm/test_data",
"./generated/", "./thirdparty/", "./build", "./.git/", "./bazel-", "./.cache",
"./source/extensions/extensions_build_config.bzl", "./contrib/contrib_build_config.bzl",
"./bazel/toolchains/configs/", "./tools/testdata/check_format/", "./tools/pyformat/",
"./third_party/", "./test/extensions/filters/http/wasm/test_data",
"./test/extensions/filters/network/wasm/test_data",
"./test/extensions/stats_sinks/wasm/test_data",
"./test/extensions/bootstrap/wasm/test_data",
"./test/extensions/common/wasm/test_data",
"./test/extensions/access_loggers/wasm/test_data",
"./source/extensions/common/wasm/ext",
"./examples/wasm-cc",
)
"./test/extensions/stats_sinks/wasm/test_data", "./test/extensions/bootstrap/wasm/test_data",
"./test/extensions/common/wasm/test_data", "./test/extensions/access_loggers/wasm/test_data",
"./source/extensions/common/wasm/ext", "./examples/wasm-cc", "./bazel/external/http_parser/")
SUFFIXES = ("BUILD", "WORKSPACE", ".bzl", ".cc", ".h", ".java", ".m", ".mm", ".proto")
PROTO_SUFFIX = (".proto")

Expand Down

0 comments on commit d3ecdce

Please sign in to comment.