Skip to content

Commit 07bc378

Browse files
committed
Allow nghttp2 to export a shared library so that we can link the curl binary dynamically against it.
- Use case in the curl PR. #42546 After building curl, we see this. ``` - ldd bazel-bin/external/+_repo_rules+curl/curl_bin linux-vdso.so.1 (0x0000ffffa8c25000) libnghttp2.so.14 => /opt/datadog-agent/embedded/lib/libnghttp2.so.14 (0x0000ffff90240000) libz.so => /opt/datadog-agent/embedded/lib/libz.so (0x0000ffff90210000) libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff901e0000) libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffff90130000) libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffff90100000) librt.so.1 => /lib/aarch64-linux-gnu/librt.so.1 (0x0000ffff900d0000) libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff8ff10000) /lib/ld-linux-aarch64.so.1 (0x0000ffff9028e000) ```
1 parent 6b70e19 commit 07bc378

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ load("@rules_license//rules:license.bzl", "license")
33

44
package(
55
default_applicable_licenses = [":license"],
6-
default_visibility = ["//visibility:private"],
6+
default_visibility = ["//visibility:public"],
77
)
88

99
license(
@@ -14,9 +14,7 @@ license(
1414
visibility = ["//visibility:public"],
1515
)
1616

17-
exports_files([
18-
"COPYING",
19-
])
17+
SO_VERSION = 14
2018

2119
# This builds only the nghttp2 C library, not the C++ application code.
2220
# Following the omnibus build configuration which uses:
@@ -48,3 +46,9 @@ cc_library(
4846
"//conditions:default": [],
4947
}),
5048
)
49+
50+
cc_shared_library(
51+
name = "nghttp2_shared",
52+
shared_lib_name = "nghttp2.so.%s" % SO_VERSION,
53+
deps = ["nghttp2"],
54+
)

deps/repos.MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ http_archive(
158158

159159
http_archive(
160160
name = "nghttp2",
161-
build_file = "//deps:nghttp2.BUILD.bazel",
162161
files = {
163-
"config.h": "//deps/nghttp2:config.h",
162+
"BUILD.bazel": "//deps:nghttp2/nghttp2.BUILD.bazel",
163+
"config.h": "//deps:nghttp2/config.h",
164164
},
165165
sha256 = "9ebdfbfbca164ef72bdf5fd2a94a4e6dfb54ec39d2ef249aeb750a91ae361dfb",
166166
strip_prefix = "nghttp2-1.58.0",

0 commit comments

Comments
 (0)