forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repositories.bzl
1252 lines (1109 loc) · 36.7 KB
/
repositories.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
load(":dev_binding.bzl", "envoy_dev_binding")
load("@envoy_api//bazel:envoy_http_archive.bzl", "envoy_http_archive")
load("@envoy_api//bazel:external_deps.bzl", "load_repository_locations")
load(":repository_locations.bzl", "PROTOC_VERSIONS", "REPOSITORY_LOCATIONS_SPEC")
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
PPC_SKIP_TARGETS = ["envoy.filters.http.lua"]
WINDOWS_SKIP_TARGETS = [
"envoy.extensions.http.cache.file_system_http_cache",
"envoy.filters.http.file_system_buffer",
"envoy.filters.http.language",
"envoy.filters.http.sxg",
"envoy.tracers.dynamic_ot",
"envoy.tracers.datadog",
"envoy.tracers.opencensus",
]
# Make all contents of an external repository accessible under a filegroup. Used for external HTTP
# archives, e.g. cares.
def _build_all_content(exclude = []):
return """filegroup(name = "all", srcs = glob(["**"], exclude={}), visibility = ["//visibility:public"])""".format(repr(exclude))
BUILD_ALL_CONTENT = _build_all_content()
REPOSITORY_LOCATIONS = load_repository_locations(REPOSITORY_LOCATIONS_SPEC)
# Use this macro to reference any HTTP archive from bazel/repository_locations.bzl.
def external_http_archive(name, **kwargs):
envoy_http_archive(
name,
locations = REPOSITORY_LOCATIONS,
**kwargs
)
def _default_envoy_build_config_impl(ctx):
ctx.file("WORKSPACE", "")
ctx.file("BUILD.bazel", "")
ctx.symlink(ctx.attr.config, "extensions_build_config.bzl")
_default_envoy_build_config = repository_rule(
implementation = _default_envoy_build_config_impl,
attrs = {
"config": attr.label(default = "@envoy//source/extensions:extensions_build_config.bzl"),
},
)
def _envoy_repo_impl(repository_ctx):
"""This provides information about the Envoy repository
You can access the current project and api versions and the path to the repository in
.bzl/BUILD files as follows:
```starlark
load("@envoy_repo//:version.bzl", "VERSION", "API_VERSION")
```
`*VERSION` can be used to derive version-specific rules and can be passed
to the rules.
The `VERSION`s and also the local `PATH` to the repo can be accessed in
python libraries/binaries. By adding `@envoy_repo` to `deps` they become
importable through the `envoy_repo` namespace.
As the `PATH` is local to the machine, it is generally only useful for
jobs that will run locally.
This can be useful, for example, for bazel run jobs to run bazel queries that cannot be run
within the constraints of a `genquery`, or that otherwise need access to the repository
files.
"""
repo_version_path = repository_ctx.path(repository_ctx.attr.envoy_version)
api_version_path = repository_ctx.path(repository_ctx.attr.envoy_api_version)
version = repository_ctx.read(repo_version_path).strip()
api_version = repository_ctx.read(api_version_path).strip()
repository_ctx.file("version.bzl", "VERSION = '%s'\nAPI_VERSION = '%s'" % (version, api_version))
repository_ctx.file("path.bzl", "PATH = '%s'" % repo_version_path.dirname)
repository_ctx.file("__init__.py", "PATH = '%s'\nVERSION = '%s'\nAPI_VERSION = '%s'" % (repo_version_path.dirname, version, api_version))
repository_ctx.file("WORKSPACE", "")
repository_ctx.file("BUILD", """
load("@rules_python//python:defs.bzl", "py_library")
py_library(name = "envoy_repo", srcs = ["__init__.py"], visibility = ["//visibility:public"])
""")
_envoy_repo = repository_rule(
implementation = _envoy_repo_impl,
attrs = {
"envoy_version": attr.label(default = "@envoy//:VERSION.txt"),
"envoy_api_version": attr.label(default = "@envoy//:API_VERSION.txt"),
},
)
def envoy_repo():
if "envoy_repo" not in native.existing_rules().keys():
_envoy_repo(name = "envoy_repo")
# Bazel native C++ dependencies. For the dependencies that doesn't provide autoconf/automake builds.
def _cc_deps():
external_http_archive("grpc_httpjson_transcoding")
native.bind(
name = "path_matcher",
actual = "@grpc_httpjson_transcoding//src:path_matcher",
)
native.bind(
name = "grpc_transcoding",
actual = "@grpc_httpjson_transcoding//src:transcoding",
)
def _go_deps(skip_targets):
# Keep the skip_targets check around until Istio Proxy has stopped using
# it to exclude the Go rules.
if "io_bazel_rules_go" not in skip_targets:
external_http_archive(
name = "io_bazel_rules_go",
# TODO(wrowe, sunjayBhatia): remove when Windows RBE supports batch file invocation
patch_args = ["-p1"],
patches = ["@envoy//bazel:rules_go.patch"],
)
external_http_archive("bazel_gazelle")
def _rust_deps():
external_http_archive(
"rules_rust",
patches = ["@envoy//bazel:rules_rust.patch"],
)
def envoy_dependencies(skip_targets = []):
# Add a binding for repository variables.
envoy_repo()
# Setup Envoy developer tools.
envoy_dev_binding()
# Treat Envoy's overall build config as an external repo, so projects that
# build Envoy as a subcomponent can easily override the config.
if "envoy_build_config" not in native.existing_rules().keys():
_default_envoy_build_config(name = "envoy_build_config")
# Setup external Bazel rules
_foreign_cc_dependencies()
# Binding to an alias pointing to the selected version of BoringSSL:
# - BoringSSL FIPS from @boringssl_fips//:ssl,
# - non-FIPS BoringSSL from @boringssl//:ssl.
_boringssl()
_boringssl_fips()
native.bind(
name = "ssl",
actual = "@envoy//bazel:boringssl",
)
native.bind(
name = "crypto",
actual = "@envoy//bazel:boringcrypto",
)
# The long repo names (`com_github_fmtlib_fmt` instead of `fmtlib`) are
# semi-standard in the Bazel community, intended to avoid both duplicate
# dependencies and name conflicts.
_com_github_axboe_liburing()
_com_github_c_ares_c_ares()
_com_github_circonus_labs_libcircllhist()
_com_github_cyan4973_xxhash()
_com_github_datadog_dd_opentracing_cpp()
_com_github_mirror_tclap()
_com_github_envoyproxy_sqlparser()
_com_github_fmtlib_fmt()
_com_github_gabime_spdlog()
_com_github_google_benchmark()
_com_github_google_jwt_verify()
_com_github_google_libprotobuf_mutator()
_com_github_google_libsxg()
_com_github_google_tcmalloc()
_com_github_gperftools_gperftools()
_com_github_grpc_grpc()
_com_github_unicode_org_icu()
_com_github_intel_ipp_crypto_crypto_mb()
_com_github_intel_qatlib()
_com_github_jbeder_yaml_cpp()
_com_github_libevent_libevent()
_com_github_luajit_luajit()
_com_github_moonjit_moonjit()
_com_github_nghttp2_nghttp2()
_com_github_skyapm_cpp2sky()
_com_github_nodejs_http_parser()
_com_github_alibaba_hessian2_codec()
_com_github_tencent_rapidjson()
_com_github_nlohmann_json()
_com_github_ncopa_suexec()
_com_google_absl()
_com_google_googletest()
_com_google_protobuf()
_io_opencensus_cpp()
_com_github_curl()
_com_github_envoyproxy_sqlparser()
_v8()
_com_googlesource_chromium_base_trace_event_common()
_com_github_google_quiche()
_com_googlesource_googleurl()
_io_hyperscan()
_io_opentracing_cpp()
_net_colm_open_source_colm()
_net_colm_open_source_ragel()
_net_zlib()
_intel_dlb()
_com_github_zlib_ng_zlib_ng()
_org_boost()
_org_brotli()
_com_github_facebook_zstd()
_re2()
_upb()
_proxy_wasm_cpp_sdk()
_proxy_wasm_cpp_host()
_emsdk()
_rules_fuzzing()
external_http_archive("proxy_wasm_rust_sdk")
_com_google_cel_cpp()
_com_github_google_perfetto()
external_http_archive("com_github_google_flatbuffers")
external_http_archive("bazel_toolchains")
external_http_archive("bazel_compdb")
external_http_archive("envoy_build_tools")
# TODO(keith): Remove patch when we update rules_pkg
external_http_archive(
"rules_pkg",
patches = ["@envoy//bazel:rules_pkg.patch"],
)
external_http_archive("com_github_aignas_rules_shellcheck")
external_http_archive("aspect_bazel_lib")
_com_github_fdio_vpp_vcl()
# Unconditional, since we use this only for compiler-agnostic fuzzing utils.
_org_llvm_releases_compiler_rt()
_cc_deps()
_go_deps(skip_targets)
_rust_deps()
_kafka_deps()
_org_llvm_llvm()
_com_github_wamr()
_com_github_wavm_wavm()
_com_github_wasmtime()
_com_github_wasm_c_api()
switched_rules_by_language(
name = "com_google_googleapis_imports",
cc = True,
go = True,
grpc = True,
rules_override = {
"py_proto_library": "@envoy_api//bazel:api_build_system.bzl",
},
)
native.bind(
name = "bazel_runfiles",
actual = "@bazel_tools//tools/cpp/runfiles",
)
def _boringssl():
external_http_archive(
name = "boringssl",
patch_args = ["-p1"],
patches = ["@envoy//bazel:boringssl_static.patch"],
)
def _boringssl_fips():
external_http_archive(
name = "boringssl_fips",
build_file = "@envoy//bazel/external:boringssl_fips.BUILD",
patches = ["@envoy//bazel/external:boringssl_fips.patch"],
)
def _com_github_circonus_labs_libcircllhist():
external_http_archive(
name = "com_github_circonus_labs_libcircllhist",
build_file = "@envoy//bazel/external:libcircllhist.BUILD",
)
native.bind(
name = "libcircllhist",
actual = "@com_github_circonus_labs_libcircllhist//:libcircllhist",
)
def _com_github_axboe_liburing():
external_http_archive(
name = "com_github_axboe_liburing",
build_file_content = BUILD_ALL_CONTENT,
)
native.bind(
name = "uring",
actual = "@envoy//bazel/foreign_cc:liburing",
)
def _com_github_c_ares_c_ares():
external_http_archive(
name = "com_github_c_ares_c_ares",
build_file_content = BUILD_ALL_CONTENT,
)
native.bind(
name = "ares",
actual = "@envoy//bazel/foreign_cc:ares",
)
def _com_github_cyan4973_xxhash():
external_http_archive(
name = "com_github_cyan4973_xxhash",
build_file = "@envoy//bazel/external:xxhash.BUILD",
)
native.bind(
name = "xxhash",
actual = "@com_github_cyan4973_xxhash//:xxhash",
)
def _com_github_envoyproxy_sqlparser():
external_http_archive(
name = "com_github_envoyproxy_sqlparser",
build_file = "@envoy//bazel/external:sqlparser.BUILD",
)
native.bind(
name = "sqlparser",
actual = "@com_github_envoyproxy_sqlparser//:sqlparser",
)
def _com_github_mirror_tclap():
external_http_archive(
name = "com_github_mirror_tclap",
build_file = "@envoy//bazel/external:tclap.BUILD",
patch_args = ["-p1"],
)
native.bind(
name = "tclap",
actual = "@com_github_mirror_tclap//:tclap",
)
def _com_github_fmtlib_fmt():
external_http_archive(
name = "com_github_fmtlib_fmt",
build_file = "@envoy//bazel/external:fmtlib.BUILD",
)
native.bind(
name = "fmtlib",
actual = "@com_github_fmtlib_fmt//:fmtlib",
)
def _com_github_gabime_spdlog():
external_http_archive(
name = "com_github_gabime_spdlog",
build_file = "@envoy//bazel/external:spdlog.BUILD",
)
native.bind(
name = "spdlog",
actual = "@com_github_gabime_spdlog//:spdlog",
)
def _com_github_google_benchmark():
external_http_archive(
name = "com_github_google_benchmark",
)
native.bind(
name = "benchmark",
actual = "@com_github_google_benchmark//:benchmark",
)
def _com_github_google_libprotobuf_mutator():
external_http_archive(
name = "com_github_google_libprotobuf_mutator",
build_file = "@envoy//bazel/external:libprotobuf_mutator.BUILD",
)
def _com_github_google_libsxg():
external_http_archive(
name = "com_github_google_libsxg",
build_file_content = BUILD_ALL_CONTENT,
)
native.bind(
name = "libsxg",
actual = "@envoy//bazel/foreign_cc:libsxg",
)
def _com_github_unicode_org_icu():
external_http_archive(
name = "com_github_unicode_org_icu",
patches = ["@envoy//bazel/foreign_cc:icu.patch"],
patch_args = ["-p1"],
build_file_content = BUILD_ALL_CONTENT,
)
def _com_github_intel_ipp_crypto_crypto_mb():
external_http_archive(
name = "com_github_intel_ipp_crypto_crypto_mb",
build_file_content = BUILD_ALL_CONTENT,
)
def _com_github_intel_qatlib():
external_http_archive(
name = "com_github_intel_qatlib",
build_file_content = BUILD_ALL_CONTENT,
)
def _com_github_jbeder_yaml_cpp():
external_http_archive(
name = "com_github_jbeder_yaml_cpp",
)
native.bind(
name = "yaml_cpp",
actual = "@com_github_jbeder_yaml_cpp//:yaml-cpp",
)
def _com_github_libevent_libevent():
external_http_archive(
name = "com_github_libevent_libevent",
build_file_content = BUILD_ALL_CONTENT,
)
native.bind(
name = "event",
actual = "@envoy//bazel/foreign_cc:event",
)
def _net_colm_open_source_colm():
external_http_archive(
name = "net_colm_open_source_colm",
build_file_content = BUILD_ALL_CONTENT,
)
native.bind(
name = "colm",
actual = "@envoy//bazel/foreign_cc:colm",
)
def _net_colm_open_source_ragel():
external_http_archive(
name = "net_colm_open_source_ragel",
build_file_content = BUILD_ALL_CONTENT,
)
native.bind(
name = "ragel",
actual = "@envoy//bazel/foreign_cc:ragel",
)
def _net_zlib():
external_http_archive(
name = "net_zlib",
build_file_content = BUILD_ALL_CONTENT,
patch_args = ["-p1"],
patches = ["@envoy//bazel/foreign_cc:zlib.patch"],
)
native.bind(
name = "zlib",
actual = "@envoy//bazel/foreign_cc:zlib",
)
# Bind for grpc.
native.bind(
name = "madler_zlib",
actual = "@envoy//bazel/foreign_cc:zlib",
)
def _com_github_zlib_ng_zlib_ng():
external_http_archive(
name = "com_github_zlib_ng_zlib_ng",
build_file_content = BUILD_ALL_CONTENT,
patch_args = ["-p1"],
patches = ["@envoy//bazel/foreign_cc:zlib_ng.patch"],
)
# Boost in general is not approved for Envoy use, and the header-only
# dependency is only for the Hyperscan contrib package.
def _org_boost():
external_http_archive(
name = "org_boost",
build_file_content = """
filegroup(
name = "header",
srcs = glob([
"boost/**/*.h",
"boost/**/*.hpp",
"boost/**/*.ipp",
]),
visibility = ["@envoy//contrib/hyperscan/matching/input_matchers/source:__pkg__"],
)
""",
)
# If you're looking for envoy-filter-example / envoy_filter_example
# the hash is in ci/filter_example_setup.sh
def _org_brotli():
external_http_archive(
name = "org_brotli",
)
native.bind(
name = "brotlienc",
actual = "@org_brotli//:brotlienc",
)
native.bind(
name = "brotlidec",
actual = "@org_brotli//:brotlidec",
)
def _com_github_facebook_zstd():
external_http_archive(
name = "com_github_facebook_zstd",
build_file_content = BUILD_ALL_CONTENT,
)
native.bind(
name = "zstd",
actual = "@envoy//bazel/foreign_cc:zstd",
)
def _com_google_cel_cpp():
external_http_archive("com_google_cel_cpp")
def _com_github_google_perfetto():
external_http_archive(
name = "com_github_google_perfetto",
build_file_content = """
package(default_visibility = ["//visibility:public"])
cc_library(
name = "perfetto",
srcs = ["perfetto.cc"],
hdrs = ["perfetto.h"],
)
""",
)
def _com_github_nghttp2_nghttp2():
external_http_archive(
name = "com_github_nghttp2_nghttp2",
build_file_content = BUILD_ALL_CONTENT,
patch_args = ["-p1"],
# This patch cannot be picked up due to ABI rules. Discussion at;
# https://github.com/nghttp2/nghttp2/pull/1395
# https://github.com/envoyproxy/envoy/pull/8572#discussion_r334067786
patches = ["@envoy//bazel/foreign_cc:nghttp2.patch"],
)
native.bind(
name = "nghttp2",
actual = "@envoy//bazel/foreign_cc:nghttp2",
)
def _io_hyperscan():
external_http_archive(
name = "io_hyperscan",
build_file_content = BUILD_ALL_CONTENT,
patch_args = ["-p1"],
patches = ["@envoy//bazel/foreign_cc:hyperscan.patch"],
)
def _io_opentracing_cpp():
external_http_archive(
name = "io_opentracing_cpp",
patch_args = ["-p1"],
# Workaround for LSAN false positive in https://github.com/envoyproxy/envoy/issues/7647
patches = ["@envoy//bazel:io_opentracing_cpp.patch"],
)
native.bind(
name = "opentracing",
actual = "@io_opentracing_cpp//:opentracing",
)
def _com_github_datadog_dd_opentracing_cpp():
external_http_archive("com_github_datadog_dd_opentracing_cpp")
external_http_archive(
name = "com_github_msgpack_msgpack_c",
build_file = "@com_github_datadog_dd_opentracing_cpp//:bazel/external/msgpack.BUILD",
)
native.bind(
name = "dd_opentracing_cpp",
actual = "@com_github_datadog_dd_opentracing_cpp//:dd_opentracing_cpp",
)
def _com_github_skyapm_cpp2sky():
external_http_archive(
name = "com_github_skyapm_cpp2sky",
)
external_http_archive(
name = "skywalking_data_collect_protocol",
)
native.bind(
name = "cpp2sky",
actual = "@com_github_skyapm_cpp2sky//source:cpp2sky_data_lib",
)
def _com_github_tencent_rapidjson():
external_http_archive(
name = "com_github_tencent_rapidjson",
build_file = "@envoy//bazel/external:rapidjson.BUILD",
)
def _com_github_nlohmann_json():
external_http_archive(
name = "com_github_nlohmann_json",
build_file = "@envoy//bazel/external:json.BUILD",
)
native.bind(
name = "json",
actual = "@com_github_nlohmann_json//:json",
)
def _com_github_nodejs_http_parser():
native.bind(
name = "http_parser",
actual = "@envoy//bazel/external/http_parser",
)
def _com_github_alibaba_hessian2_codec():
external_http_archive("com_github_alibaba_hessian2_codec")
native.bind(
name = "hessian2_codec_object_codec_lib",
actual = "@com_github_alibaba_hessian2_codec//hessian2/basic_codec:object_codec_lib",
)
native.bind(
name = "hessian2_codec_codec_impl",
actual = "@com_github_alibaba_hessian2_codec//hessian2:codec_impl_lib",
)
def _com_github_ncopa_suexec():
external_http_archive(
name = "com_github_ncopa_suexec",
build_file = "@envoy//bazel/external:su-exec.BUILD",
)
native.bind(
name = "su-exec",
actual = "@com_github_ncopa_suexec//:su-exec",
)
def _com_google_googletest():
external_http_archive(
"com_google_googletest",
patches = ["@envoy//bazel:googletest.patch"],
patch_args = ["-p1"],
)
native.bind(
name = "googletest",
actual = "@com_google_googletest//:gtest",
)
# TODO(jmarantz): replace the use of bind and external_deps with just
# the direct Bazel path at all sites. This will make it easier to
# pull in more bits of abseil as needed, and is now the preferred
# method for pure Bazel deps.
def _com_google_absl():
external_http_archive(
name = "com_google_absl",
patches = ["@envoy//bazel:abseil.patch"],
patch_args = ["-p1"],
)
native.bind(
name = "abseil_any",
actual = "@com_google_absl//absl/types:any",
)
native.bind(
name = "abseil_base",
actual = "@com_google_absl//absl/base:base",
)
# Bind for grpc.
native.bind(
name = "absl-base",
actual = "@com_google_absl//absl/base",
)
native.bind(
name = "abseil_flat_hash_map",
actual = "@com_google_absl//absl/container:flat_hash_map",
)
native.bind(
name = "abseil_flat_hash_set",
actual = "@com_google_absl//absl/container:flat_hash_set",
)
native.bind(
name = "abseil_hash",
actual = "@com_google_absl//absl/hash:hash",
)
native.bind(
name = "abseil_hash_testing",
actual = "@com_google_absl//absl/hash:hash_testing",
)
native.bind(
name = "abseil_inlined_vector",
actual = "@com_google_absl//absl/container:inlined_vector",
)
native.bind(
name = "abseil_memory",
actual = "@com_google_absl//absl/memory:memory",
)
native.bind(
name = "abseil_node_hash_map",
actual = "@com_google_absl//absl/container:node_hash_map",
)
native.bind(
name = "abseil_node_hash_set",
actual = "@com_google_absl//absl/container:node_hash_set",
)
native.bind(
name = "abseil_str_format",
actual = "@com_google_absl//absl/strings:str_format",
)
native.bind(
name = "abseil_strings",
actual = "@com_google_absl//absl/strings:strings",
)
native.bind(
name = "abseil_int128",
actual = "@com_google_absl//absl/numeric:int128",
)
native.bind(
name = "abseil_optional",
actual = "@com_google_absl//absl/types:optional",
)
native.bind(
name = "abseil_synchronization",
actual = "@com_google_absl//absl/synchronization:synchronization",
)
native.bind(
name = "abseil_symbolize",
actual = "@com_google_absl//absl/debugging:symbolize",
)
native.bind(
name = "abseil_stacktrace",
actual = "@com_google_absl//absl/debugging:stacktrace",
)
# Require abseil_time as an indirect dependency as it is needed by the
# direct dependency jwt_verify_lib.
native.bind(
name = "abseil_time",
actual = "@com_google_absl//absl/time:time",
)
# Bind for grpc.
native.bind(
name = "absl-time",
actual = "@com_google_absl//absl/time:time",
)
native.bind(
name = "abseil_algorithm",
actual = "@com_google_absl//absl/algorithm:algorithm",
)
native.bind(
name = "abseil_variant",
actual = "@com_google_absl//absl/types:variant",
)
native.bind(
name = "abseil_status",
actual = "@com_google_absl//absl/status",
)
native.bind(
name = "abseil_cleanup",
actual = "@com_google_absl//absl/cleanup:cleanup",
)
def _com_google_protobuf():
external_http_archive(
name = "rules_python",
)
for platform in PROTOC_VERSIONS:
# Ideally we dont use a private build artefact as done here.
# If `rules_proto` implements protoc toolchains in the future (currently it
# is there, but is empty) we should remove these and use that rule
# instead.
external_http_archive(
"com_google_protobuf_protoc_%s" % platform,
build_file = "@rules_proto//proto/private:BUILD.protoc",
)
external_http_archive(
"com_google_protobuf",
patches = ["@envoy//bazel:protobuf.patch"],
patch_args = ["-p1"],
)
native.bind(
name = "protobuf",
actual = "@com_google_protobuf//:protobuf",
)
native.bind(
name = "protobuf_clib",
actual = "@com_google_protobuf//:protoc_lib",
)
native.bind(
name = "protocol_compiler",
actual = "@com_google_protobuf//:protoc",
)
native.bind(
name = "protoc",
actual = "@com_google_protobuf//:protoc",
)
# Needed for `bazel fetch` to work with @com_google_protobuf
# https://github.com/google/protobuf/blob/v3.6.1/util/python/BUILD#L6-L9
native.bind(
name = "python_headers",
actual = "@com_google_protobuf//util/python:python_headers",
)
def _io_opencensus_cpp():
external_http_archive(
name = "io_opencensus_cpp",
)
native.bind(
name = "opencensus_trace",
actual = "@io_opencensus_cpp//opencensus/trace",
)
native.bind(
name = "opencensus_trace_b3",
actual = "@io_opencensus_cpp//opencensus/trace:b3",
)
native.bind(
name = "opencensus_trace_cloud_trace_context",
actual = "@io_opencensus_cpp//opencensus/trace:cloud_trace_context",
)
native.bind(
name = "opencensus_trace_grpc_trace_bin",
actual = "@io_opencensus_cpp//opencensus/trace:grpc_trace_bin",
)
native.bind(
name = "opencensus_trace_trace_context",
actual = "@io_opencensus_cpp//opencensus/trace:trace_context",
)
native.bind(
name = "opencensus_exporter_ocagent",
actual = "@io_opencensus_cpp//opencensus/exporters/trace/ocagent:ocagent_exporter",
)
native.bind(
name = "opencensus_exporter_stdout",
actual = "@io_opencensus_cpp//opencensus/exporters/trace/stdout:stdout_exporter",
)
native.bind(
name = "opencensus_exporter_stackdriver",
actual = "@io_opencensus_cpp//opencensus/exporters/trace/stackdriver:stackdriver_exporter",
)
native.bind(
name = "opencensus_exporter_zipkin",
actual = "@io_opencensus_cpp//opencensus/exporters/trace/zipkin:zipkin_exporter",
)
def _com_github_curl():
# Used by OpenCensus Zipkin exporter.
external_http_archive(
name = "com_github_curl",
build_file_content = BUILD_ALL_CONTENT + """
cc_library(name = "curl", visibility = ["//visibility:public"], deps = ["@envoy//bazel/foreign_cc:curl"])
""",
# Patch curl 7.74.0 and later due to CMake's problematic implementation of policy `CMP0091`
# and introduction of libidn2 dependency which is inconsistently available and must
# not be a dynamic dependency on linux.
# Upstream patches submitted: https://github.com/curl/curl/pull/6050 & 6362
# TODO(https://github.com/envoyproxy/envoy/issues/11816): This patch is obsoleted
# by elimination of the curl dependency.
patches = ["@envoy//bazel/foreign_cc:curl.patch"],
patch_args = ["-p1"],
)
native.bind(
name = "curl",
actual = "@envoy//bazel/foreign_cc:curl",
)
def _v8():
external_http_archive(
name = "v8",
patches = ["@envoy//bazel:v8.patch"],
patch_args = ["-p1"],
)
native.bind(
name = "wee8",
actual = "@v8//:wee8",
)
def _com_googlesource_chromium_base_trace_event_common():
external_http_archive(
name = "com_googlesource_chromium_base_trace_event_common",
build_file = "@v8//:bazel/BUILD.trace_event_common",
)
native.bind(
name = "base_trace_event_common",
actual = "@com_googlesource_chromium_base_trace_event_common//:trace_event_common",
)
def _com_github_google_quiche():
external_http_archive(
name = "com_github_google_quiche",
patch_cmds = ["find quiche/ -type f -name \"*.bazel\" -delete"],
build_file = "@envoy//bazel/external:quiche.BUILD",
)
native.bind(
name = "quiche_common_platform",
actual = "@com_github_google_quiche//:quiche_common_platform",
)
native.bind(
name = "quiche_http2_adapter",
actual = "@com_github_google_quiche//:http2_adapter",
)
native.bind(
name = "quiche_quic_platform",
actual = "@com_github_google_quiche//:quic_platform",
)
native.bind(
name = "quiche_quic_platform_base",
actual = "@com_github_google_quiche//:quic_platform_base",
)
def _com_googlesource_googleurl():
external_http_archive(
name = "com_googlesource_googleurl",
patches = ["@envoy//bazel/external:googleurl.patch"],
patch_args = ["-p1"],
)
def _org_llvm_releases_compiler_rt():
external_http_archive(
name = "org_llvm_releases_compiler_rt",
build_file = "@envoy//bazel/external:compiler_rt.BUILD",
)
def _com_github_grpc_grpc():
external_http_archive(
name = "com_github_grpc_grpc",
patch_args = ["-p1"],
patches = ["@envoy//bazel:grpc.patch"],
)
external_http_archive("build_bazel_rules_apple")
# Rebind some stuff to match what the gRPC Bazel is expecting.
native.bind(
name = "protobuf_headers",
actual = "@com_google_protobuf//:protobuf_headers",
)
native.bind(
name = "libssl",
actual = "//external:ssl",
)
native.bind(
name = "libcrypto",
actual = "//external:crypto",
)
native.bind(
name = "cares",
actual = "//external:ares",
)
native.bind(
name = "grpc",
actual = "@com_github_grpc_grpc//:grpc++",
)
native.bind(
name = "grpc_health_proto",
actual = "@envoy//bazel:grpc_health_proto",
)
native.bind(
name = "grpc_alts_fake_handshaker_server",
actual = "@com_github_grpc_grpc//test/core/tsi/alts/fake_handshaker:fake_handshaker_lib",
)
native.bind(
name = "grpc_alts_handshaker_proto",
actual = "@com_github_grpc_grpc//test/core/tsi/alts/fake_handshaker:handshaker_proto",
)
native.bind(
name = "grpc_alts_transport_security_common_proto",
actual = "@com_github_grpc_grpc//test/core/tsi/alts/fake_handshaker:transport_security_common_proto",
)
native.bind(
name = "upb_lib_descriptor",
actual = "@upb//:descriptor_upb_proto",
)
native.bind(
name = "upb_lib_descriptor_reflection",
actual = "@upb//:descriptor_upb_proto_reflection",
)
native.bind(
name = "upb_textformat_lib",
actual = "@upb//:textformat",
)
native.bind(
name = "upb_json_lib",
actual = "@upb//:json",
)
native.bind(
name = "upb_reflection",
actual = "@upb//:reflection",
)
native.bind(
name = "upb_generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
actual = "@upb//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",