Skip to content

Commit 80105c1

Browse files
committed
More experiments
Signed-off-by: Jonh Wendell <[email protected]>
1 parent cd0083c commit 80105c1

File tree

4 files changed

+57
-15
lines changed

4 files changed

+57
-15
lines changed

bazel/envoy_test.bzl

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def envoy_cc_fuzz_test(
8686
size = "medium",
8787
deps = [],
8888
tags = [],
89+
env = {},
8990
**kwargs):
9091
exec_properties = exec_properties | select({
9192
repository + "//bazel:engflow_rbe_x86_64": {"Pool": rbe_pool} if rbe_pool else {},
@@ -113,6 +114,11 @@ def envoy_cc_fuzz_test(
113114
**kwargs
114115
)
115116

117+
real_env = dict(env)
118+
real_env.update({
119+
"LD_LIBRARY_PATH": "/build/bazel_root/base/execroot/envoy/bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib64",
120+
})
121+
116122
native.cc_test(
117123
name = name,
118124
copts = envoy_copts("@envoy", test = True),
@@ -140,6 +146,7 @@ def envoy_cc_fuzz_test(
140146
}),
141147
size = size,
142148
tags = ["fuzz_target"] + tags,
149+
env = real_env,
143150
)
144151

145152
fuzzing_decoration(
@@ -178,6 +185,12 @@ def envoy_cc_test(
178185
repository + "//bazel:engflow_rbe_x86_64": {"Pool": rbe_pool} if rbe_pool else {},
179186
"//conditions:default": {},
180187
})
188+
189+
real_env = dict(env)
190+
real_env.update({
191+
"LD_LIBRARY_PATH": "/build/bazel_root/base/execroot/envoy/bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib64",
192+
})
193+
181194
native.cc_test(
182195
name = name,
183196
srcs = srcs,
@@ -200,7 +213,7 @@ def envoy_cc_test(
200213
shard_count = shard_count,
201214
size = size,
202215
flaky = flaky,
203-
env = env,
216+
env = real_env,
204217
exec_properties = exec_properties,
205218
)
206219

@@ -288,20 +301,28 @@ def envoy_benchmark_test(
288301
data = [],
289302
rbe_pool = None,
290303
exec_properties = {},
304+
env = {},
291305
tags = [],
292306
repository = "",
293307
**kargs):
294308
exec_properties = exec_properties | select({
295309
repository + "//bazel:engflow_rbe_x86_64": {"Pool": rbe_pool} if rbe_pool else {},
296310
"//conditions:default": {},
297311
})
312+
313+
real_env = dict(env)
314+
real_env.update({
315+
"LD_LIBRARY_PATH": "/build/bazel_root/base/execroot/envoy/bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib64",
316+
})
317+
298318
native.sh_test(
299319
name = name,
300320
srcs = [repository + "//bazel:test_for_benchmark_wrapper.sh"],
301321
data = [":" + benchmark_binary] + data,
302322
exec_properties = exec_properties,
303323
args = ["%s/%s" % (native.package_name(), benchmark_binary)],
304324
tags = tags + ["nocoverage"],
325+
env = real_env,
305326
**kargs
306327
)
307328

@@ -341,6 +362,7 @@ def envoy_sh_test(
341362
coverage = True,
342363
cc_binary = [],
343364
tags = [],
365+
env = {},
344366
**kargs):
345367
if coverage:
346368
if cc_binary == []:
@@ -358,16 +380,22 @@ def envoy_sh_test(
358380
srcs = [test_runner_cc],
359381
data = srcs + data + cc_binary,
360382
tags = tags,
383+
env = env,
361384
deps = ["//test/test_common:environment_lib"] + cc_binary,
362385
**kargs
363386
)
364387

365388
else:
389+
real_env = dict(env)
390+
real_env.update({
391+
"LD_LIBRARY_PATH": "/build/bazel_root/base/execroot/envoy/bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib64",
392+
})
366393
native.sh_test(
367394
name = name,
368395
srcs = ["//bazel:sh_test_wrapper.sh"],
369396
data = srcs + data + cc_binary,
370397
args = srcs,
371398
tags = tags + ["nocoverage"],
399+
env = real_env,
372400
**kargs
373401
)

bazel/external/openssl.BUILD

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,29 @@ licenses(["notice"]) # Apache 2
66
filegroup(
77
name = "all",
88
srcs = glob(["**"]),
9-
#visibility = ["//visibility:public"],
109
)
1110

1211
configure_make(
1312
name = "openssl",
1413
lib_source = ":all",
14+
lib_name = "openssl",
1515
configure_in_place = True,
1616
configure_command = "Configure",
1717
targets = ["build_sw", "install_sw"],
1818
args = ["-j"],
1919
out_lib_dir = "lib64",
20-
out_static_libs = ["libssl.a", "libcrypto.a"],
20+
#out_static_libs = ["libssl.a", "libcrypto.a"],
2121
out_shared_libs = ["libssl.so.3", "libcrypto.so.3"],
2222
out_include_dir = "include",
2323
visibility = ["//visibility:public"],
2424
)
2525

26-
# filegroup(
27-
# name = "libs",
28-
# srcs = [":openssl"],
29-
# visibility = ["//visibility:public"],
30-
# )
31-
3226
cc_library(
3327
name = "libs",
3428
deps = [":openssl"],
3529
visibility = ["//visibility:public"],
3630
srcs = [":openssl"],
37-
data = [":openssl"],
38-
alwayslink = True,
31+
linkstatic = True,
3932
)
4033

4134
# envoy_cc_library(

bssl-compat/BUILD

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,40 @@ filegroup(
88
licenses(["notice"]) # Apache 2
99

1010
cmake(
11-
name = "bssl-compat",
11+
name = "bssl-compat-cmake",
1212
lib_source = ":srcs",
1313
out_shared_libs = [],
1414
out_static_libs = ["libbssl-compat.a"],
15-
visibility = ["//visibility:public"],
15+
includes = ["include"],
1616
generate_crosstool_file = False,
1717

1818
cache_entries = {"CMAKE_BUILD_TYPE": "Bazel"},
1919
generate_args = ["-GNinja"],
2020

2121
build_args = [ "-j" ],
22-
deps = ["@openssl//:libs"],
22+
#deps = ["@openssl//:libs"],
23+
build_data = ["@openssl//:libs"],
24+
env = {
25+
"OPENSSL_ROOT_DIR": "/build/bazel_root/base/execroot/envoy/bazel-out/k8-fastbuild/bin/external/openssl/openssl",
26+
"LD_LIBRARY_PATH": "/build/bazel_root/base/execroot/envoy/bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib64",
27+
},
28+
)
29+
30+
filegroup(
31+
name = "bssl_includes",
32+
srcs = glob([":bssl-compat-cmake/include/**/*.h"]),
33+
visibility = ["//visibility:private"],
34+
)
35+
36+
cc_library(
37+
name = "bssl-compat",
38+
#srcs = [":bssl-compat-cmake/lib/libbssl-compat.a"],
39+
#srcs = [":bssl-compat-cmake"],
40+
linkstatic = True,
41+
includes = [":bssl-compat-cmake/include"],
42+
hdrs = [":bssl_includes"],
43+
deps = [":bssl-compat-cmake"],
44+
data = ["@openssl//:libs"],
2345
)
2446

2547
alias(

ci/do_ci.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ function bazel_binary_build() {
206206
[[ -n "${ENVOY_RBE}" ]] && rm -rf bazel-bin/"${ENVOY_BIN}"*
207207

208208
bazel build "${BAZEL_BUILD_OPTIONS[@]}" --remote_download_toplevel -c "${COMPILE_TYPE}" "${BUILD_TARGET}" "${CONFIG_ARGS[@]}"
209-
echo "envoy --version output: $(bazel-bin/"${ENVOY_BIN}" --version)"
210209
collect_build_profile "${BINARY_TYPE}"_build
211210

212211
# Copy the built envoy binary somewhere that we can access outside of the

0 commit comments

Comments
 (0)