-
Notifications
You must be signed in to change notification settings - Fork 480
Add nghttp2 module #4750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
laramiel
wants to merge
5
commits into
bazelbuild:main
Choose a base branch
from
laramiel:nghttp2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+277
−0
Open
Add nghttp2 module #4750
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module( | ||
name = "nghttp2", | ||
version = "1.65.0", | ||
compatibility_level = 1, | ||
bazel_compatibility = [">=7.2.1"], | ||
) | ||
bazel_dep(name = "bazel_skylib", version = "1.7.1") | ||
bazel_dep(name = "rules_cc", version = "0.1.1") | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") | ||
load("@bazel_skylib//rules:copy_file.bzl", "copy_file") | ||
load("@bazel_skylib//rules:expand_template.bzl", "expand_template") | ||
|
||
package(default_visibility = ["//visibility:private"]) | ||
|
||
licenses(["notice"]) | ||
|
||
exports_files(["COPYING"]) | ||
|
||
# To enable nghttp2 debug output, specify: | ||
# bazel build --@nghttp2//:debug | ||
bool_flag( | ||
name = "debug", | ||
build_setting_default = False, | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
config_setting( | ||
name = "debug_setting", | ||
flag_values = { | ||
":debug": "True", | ||
}, | ||
) | ||
|
||
cc_library( | ||
name = "nghttp2", | ||
hdrs = [ | ||
"lib/includes/nghttp2/nghttp2.h", | ||
"lib/includes/nghttp2/nghttp2ver.h", | ||
], | ||
defines = [ | ||
"NGHTTP2_STATICLIB", | ||
], | ||
strip_include_prefix = "lib/includes", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
":nghttp2_impl", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "nghttp2_impl", | ||
srcs = glob(["lib/*.c"]), | ||
hdrs = glob(["lib/*.h"]), | ||
copts = select({ | ||
"@rules_cc//cc/compiler:msvc-cl": [], | ||
"//conditions:default": [ | ||
"-Wno-string-plus-int", | ||
], | ||
}), | ||
local_defines = [ | ||
"BUILDING_NGHTTP2", | ||
"HAVE_CONFIG_H", | ||
] + select( | ||
{ | ||
":debug_setting": ["DEBUGBUILD"], | ||
"//conditions:default": [], | ||
}, | ||
), | ||
deps = [ | ||
":nghttp2_config", | ||
":nghttp2_headers", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "nghttp2_headers", | ||
hdrs = [ | ||
"lib/includes/nghttp2/nghttp2.h", | ||
"lib/includes/nghttp2/nghttp2ver.h", | ||
], | ||
defines = [ | ||
"NGHTTP2_STATICLIB", | ||
], | ||
strip_include_prefix = "lib/includes", | ||
) | ||
|
||
cc_library( | ||
name = "nghttp2_config", | ||
hdrs = [ | ||
"lib/config.h", | ||
], | ||
strip_include_prefix = "lib", | ||
) | ||
|
||
expand_template( | ||
name = "nghttp2ver_h", | ||
out = "lib/includes/nghttp2/nghttp2ver.h", | ||
substitutions = { | ||
"@PACKAGE_VERSION@": "1.65.0", | ||
"@PACKAGE_VERSION_NUM@": "0x014100", | ||
}, | ||
template = "lib/includes/nghttp2/nghttp2ver.h.in", | ||
) | ||
|
||
# Generated based on running configure on several platforms. | ||
copy_file( | ||
name = "config_h", | ||
src = "config/config.h", | ||
out = "lib/config.h", | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../MODULE.bazel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
#ifndef EXTERNAL_NGHTTP2_CONFIG_H_ | ||
#define EXTERNAL_NGHTTP2_CONFIG_H_ | ||
|
||
#if !defined(_WIN32) && !defined(__APPLE__) | ||
#include <stdint.h> | ||
#endif | ||
|
||
#define HAVE_STD_MAP_EMPLACE 1 | ||
#define HAVE__EXIT 1 | ||
#define HAVE_INTTYPES_H 1 | ||
#define HAVE_LIMITS_H 1 | ||
#define HAVE_FCNTL_H 1 | ||
#define HAVE_TIME_H 1 | ||
#define NGHTTP2_NORETURN __attribute__((noreturn)) | ||
|
||
#if defined(_WIN32) | ||
#include <stddef.h> | ||
#define ssize_t ptrdiff_t | ||
#define HAVE_DECL_INITGROUPS 0 | ||
|
||
#elif defined(__APPLE__) | ||
#define HAVE_ARPA_INET_H 1 | ||
#define HAVE_SOCKADDR_IN6_SIN6_LEN 1 | ||
#define HAVE_SOCKADDR_IN_SIN_LEN 1 | ||
#define SIZEOF_TIME_T 8 | ||
#define STDC_HEADERS 1 | ||
|
||
#else | ||
#define HAVE_ACCEPT4 1 | ||
#define HAVE_ARPA_INET_H 1 | ||
#endif | ||
|
||
// common linux, apple | ||
#if !defined(_WIN32) | ||
#define HAVE_ATOMIC_STD_SHARED_PTR 1 | ||
#define HAVE_CHOWN 1 | ||
#define HAVE_CXX14 1 | ||
#define HAVE_DECL_INITGROUPS 1 | ||
#define HAVE_DECL_STRERROR_R 1 | ||
#define HAVE_DLFCN_H 1 | ||
#define HAVE_DUP2 1 | ||
#define HAVE_FORK 1 | ||
#define HAVE_GETCWD 1 | ||
#define HAVE_GETPWNAM 1 | ||
#define HAVE_LOCALTIME_R 1 | ||
#define HAVE_MEMCHR 1 | ||
#define HAVE_MEMMOVE 1 | ||
#define HAVE_MEMORY_H 1 | ||
#define HAVE_MEMSET 1 | ||
#define HAVE_MKOSTEMP 1 | ||
#define HAVE_NETDB_H 1 | ||
#define HAVE_NETINET_IN_H 1 | ||
#define HAVE_PTRDIFF_T 1 | ||
#define HAVE_PWD_H 1 | ||
#define HAVE_SOCKET 1 | ||
#define HAVE_SQRT 1 | ||
#define HAVE_STD_FUTURE 1 | ||
#define HAVE_STDDEF_H 1 | ||
#define HAVE_STDINT_H 1 | ||
#define HAVE_STDLIB_H 1 | ||
#define HAVE_STRCHR 1 | ||
#define HAVE_STRDUP 1 | ||
#define HAVE_STRERROR 1 | ||
#define HAVE_STRERROR_R 1 | ||
#define HAVE_STRING_H 1 | ||
#define HAVE_STRINGS_H 1 | ||
#define HAVE_STRNDUP 1 | ||
#define HAVE_STRSTR 1 | ||
#define HAVE_STRTOL 1 | ||
#define HAVE_STRTOUL 1 | ||
#define HAVE_STRUCT_TM_TM_GMTOFF 1 | ||
#define HAVE_SYS_SOCKET_H 1 | ||
#define HAVE_SYS_STAT_H 1 | ||
#define HAVE_SYS_TIME_H 1 | ||
#define HAVE_SYS_TYPES_H 1 | ||
#define HAVE_SYSLOG_H 1 | ||
#define HAVE_THREAD_LOCAL 1 | ||
#define HAVE_TIMEGM 1 | ||
#define HAVE_UNISTD_H 1 | ||
#define HAVE_VFORK 1 | ||
#define HAVE_WORKING_FORK 1 | ||
#define HAVE_WORKING_VFORK 1 | ||
#endif | ||
|
||
#if !defined(_WIN32) | ||
#ifndef _ALL_SOURCE | ||
#define _ALL_SOURCE 1 | ||
#endif | ||
#ifndef _GNU_SOURCE | ||
#define _GNU_SOURCE 1 | ||
#endif | ||
#ifndef _POSIX_PTHREAD_SEMANTICS | ||
#define _POSIX_PTHREAD_SEMANTICS 1 | ||
#endif | ||
#ifndef _TANDEM_SOURCE | ||
#define _TANDEM_SOURCE 1 | ||
#endif | ||
#ifndef __EXTENSIONS__ | ||
#define __EXTENSIONS__ 1 | ||
#endif | ||
#endif | ||
|
||
#if defined(__APPLE__) | ||
#if defined AC_APPLE_UNIVERSAL_BUILD | ||
#if defined __BIG_ENDIAN__ | ||
#define WORDS_BIGENDIAN 1 | ||
#endif | ||
#endif | ||
#ifndef _DARWIN_USE_64_BIT_INODE | ||
#define _DARWIN_USE_64_BIT_INODE 1 | ||
#endif | ||
#endif | ||
|
||
#if UINTPTR_MAX == UINT64_MAX | ||
#define SIZEOF_INT_P 8 | ||
#elif UINTPTR_MAX == UINT32_MAX | ||
#define SIZEOF_INT_P 4 | ||
#else | ||
#error "Unknown int pointer size" | ||
#endif | ||
|
||
#endif // EXTERNAL_NGHTTP2_CONFIG_H_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
matrix: | ||
platform: | ||
- debian11 | ||
- ubuntu2204 | ||
- macos | ||
- macos_arm64 | ||
- windows | ||
bazel: | ||
- 8.x | ||
- 7.x | ||
tasks: | ||
verify_targets: | ||
name: Verify build targets | ||
platform: ${{ platform }} | ||
bazel: ${{ bazel }} | ||
build_targets: | ||
- '@nghttp2//:nghttp2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"url": "https://github.com/nghttp2/nghttp2/releases/download/v1.65.0/nghttp2-1.65.0.tar.gz", | ||
"integrity": "sha256-jKTyp3unqsIKyj41F6LJbPz3xrBkq31KCAnn5OnrmRQ=", | ||
"strip_prefix": "nghttp2-1.65.0", | ||
"overlay": { | ||
"BUILD.bazel": "sha256-/BtheCJ2f/XjZtaUjezUnIXFuUSKAIxC503hxI/pXN0=", | ||
"MODULE.bazel": "sha256-aV83DVhH5ZJHkSzoDPknM8f64Otq2uhmJSRxUcEda+0=", | ||
"config/config.h": "sha256-ionfCCUf7G0RP+Ae+9PyGof5bAGYtcha5tDCEY7wHUQ=" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"homepage": "https://nghttp2.org/", | ||
"maintainers": [ | ||
{ | ||
"email": "[email protected]", | ||
"name": "No Maintainer Specified" | ||
} | ||
], | ||
"repository": [ | ||
"github:nghttp2/nghttp2" | ||
], | ||
"versions": [ | ||
"1.65.0" | ||
], | ||
"yanked_versions": {} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind listing yourself as the maintainer of this module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are maintainer responsibilities? I have a pretty large list of dependencies that I'm hoping to get in and I'm not sure that I want maintainer on all of them.
See https://github.com/laramiel/tensorstore-registry/tree/main/modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly serving as a contact point for future changes of this module, see https://github.com/bazelbuild/bazel-central-registry/blob/main/docs/bcr-policies.md#responsibilities-of-a-module-maintainer