forked from stratum/stratum
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathWORKSPACE
159 lines (126 loc) · 5.6 KB
/
WORKSPACE
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
# Copyright 2018 Google LLC
# Copyright 2018-present Open Networking Foundation
# Copyright 2022-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
workspace(name = "com_github_stratum_stratum")
# ---------------------------------------------------------------------------
# Dependency overrides
#
# If you would like to override a dependency, you can do so in
# this section. Be sure to use the same name as the dependency
# that you are overriding. You can use a local version of the
# dependency or a remote one.
#
# Example:
#
# local_repository(
# name = "com_github_opennetworklinux",
# path = "~/OpenNetworkLinux",
# )
#
# Please do not push changes to this section upstream.
# ---------------------------------------------------------------------------
### NOTE: REMOVE BEFORE UPSTREAMING ###
### NOTE: ENSURE THAT STRATUM CAN STILL BUILD AGAINST UNMODIFIED P4RUNTIME ###
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
# fetch modified p4runtime from ipdk repository
# note that this cannot be upstreamed
name = "com_github_p4lang_p4runtime",
remote = "https://github.com/ipdk-io/p4runtime-dev.git",
# strip_prefix = "proto", # https://github.com/bazelbuild/bazel/issues/10062
patch_cmds = ["mv proto/* ."], # Workaround since strip_prefix is broken.
# tag: 2023.11.0 (3-Oct-2023)
# descended from v1.4.0-rc.5 (23-Mar-2020)
# replaced with SHA from pending PR
commit = "7464b4b4db7bb00e442084af4e3ee7e35fd52213",
)
# ---------------------------------------------------------------------------
# Load tools to build Stratum
# ---------------------------------------------------------------------------
load("//bazel/rules:build_tools.bzl", "build_tools_deps")
build_tools_deps()
load("//bazel/rules:proto_gen.bzl", "proto_gen_deps")
proto_gen_deps()
# ---------------------------------------------------------------------------
# Load Stratum dependencies
# ---------------------------------------------------------------------------
load("//bazel:deps.bzl", "stratum_deps")
stratum_deps()
# ---------------------------------------------------------------------------
# Load transitive dependencies
# ---------------------------------------------------------------------------
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
load("@com_github_p4lang_PI//bazel:deps.bzl", "PI_deps")
PI_deps()
load("//stratum/hal/bin/bmv2:bmv2.bzl", "bmv2_configure")
bmv2_configure(name = "local_bmv2_bin")
load("//stratum/hal/lib/barefoot:barefoot.bzl", "barefoot_configure")
barefoot_configure(name = "local_barefoot_bin")
load("//stratum/hal/lib/tdi/tofino:tofino.bzl", "tofino_configure")
tofino_configure(name = "local_tofino_bin")
load("//stratum/hal/lib/tdi/dpdk:dpdk.bzl", "dpdk_configure")
dpdk_configure(name = "local_dpdk_bin")
load("//stratum/hal/lib/tdi/es2k:es2k.bzl", "es2k_configure")
es2k_configure(name = "local_es2k_bin")
load("//stratum/hal/bin/np4intel:np4intel.bzl", "np4intel_configure")
np4intel_configure(name = "local_np4intel_bin")
# PI NP4 dependencies
load("@com_github_p4lang_PI_np4//targets/np4:np4.bzl", "np4_configure")
np4_configure(name = "local_np4_bin")
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()
load("//stratum/hal/lib/phal/onlp:onlp.bzl", "onlp_configure")
onlp_configure(name = "local_onlp_bin")
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
switched_rules_by_language(
name = "com_google_googleapis_imports",
grpc = True,
cc = True,
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()
# ---------------------------------------------------------------------------
# Load Golang dependencies.
# ---------------------------------------------------------------------------
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
gazelle_dependencies(go_sdk = "go_sdk")
load("@io_bazel_rules_go//tests:grpc_repos.bzl", "grpc_dependencies")
grpc_dependencies()
# ---------------------------------------------------------------------------
# Override net, text, and sys Go modules to patch new Go update
# ---------------------------------------------------------------------------
go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=",
version = "v0.1.0",
)
go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=",
version = "v0.3.0",
)
go_repository(
name = "org_golang_x_sys",
importpath = "golang.org/x/sys",
sum = "h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=",
version = "v0.5.0",
)
# ---------------------------------------------------------------------------
# Load CDLang dependencies.
# ---------------------------------------------------------------------------
load("//stratum/testing/cdlang:deps.bzl", "cdlang_rules_dependencies")
cdlang_rules_dependencies()
# ---------------------------------------------------------------------------
# Load dependencies for `latex_document` rule.
# ---------------------------------------------------------------------------
load("@bazel_latex//:repositories.bzl", "latex_repositories")
latex_repositories()