-
Notifications
You must be signed in to change notification settings - Fork 296
/
BUILD.bazel
185 lines (170 loc) · 6.34 KB
/
BUILD.bazel
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
load("//bazel:defs.bzl", "gzip_compress")
load("//gitlab-ci/src/artifacts:upload.bzl", "upload_artifacts")
load("//publish:defs.bzl", "release_nostrip_binary", "release_strip_binary")
LINUX_ONLY = [
"metrics-proxy",
"sevctl",
"snptool",
"vsock_guest",
"vsock_host",
"guestos_tool",
"hostos_tool",
"setupos_tool",
]
NO_STRIP = [
"canister_sandbox",
"ic-btc-adapter",
"ic-https-outcalls-adapter",
"replica",
]
BINARIES = {
"canary-proxy": "//rs/boundary_node/canary_proxy:canary-proxy",
"canister_sandbox": "//rs/canister_sandbox",
"compiler_sandbox": "//rs/canister_sandbox:compiler_sandbox",
"ic-btc-adapter": "//rs/bitcoin/adapter:ic-btc-adapter",
"replica": "//rs/replica",
"boundary-node-prober": "//rs/boundary_node/prober:boundary-node-prober",
"certificate-issuer": "//rs/boundary_node/certificate_issuance/certificate_issuer:certificate-issuer",
"certificate-syncer": "//rs/boundary_node/certificate_issuance/certificate_syncer:certificate-syncer",
"denylist-updater": "//rs/boundary_node/denylist_updater:denylist-updater",
"e2e-test-driver": "//rs/scenario_tests:e2e-test-driver",
"guestos_tool": "//rs/ic_os/guestos_tool:guestos_tool",
"hostos_tool": "//rs/ic_os/hostos_tool:hostos_tool",
"ic-admin": "//rs/registry/admin:ic-admin",
"ic-backup": "//rs/backup:ic-backup",
"ic-balance-exporter": "//rs/boundary_node/ic_balance_exporter:ic-balance-exporter",
"ic-boundary": "//rs/boundary_node/ic_boundary:ic-boundary",
"ic-starter": "//rs/starter:ic-starter",
"ic-https-outcalls-adapter": "//rs/https_outcalls/adapter:ic-https-outcalls-adapter",
"ic-consensus-pool-util": "//rs/artifact_pool:ic-consensus-pool-util",
"ic-crypto-csp": "//rs/crypto:ic-crypto-csp",
"ic-nns-init": "//rs/nns/init:ic-nns-init",
"ic-prep": "//rs/prep:ic-prep",
"ic-recovery": "//rs/recovery:ic-recovery",
"ic-regedit": "//rs/registry/regedit:ic-regedit",
"ic-registry-replicator": "//rs/orchestrator/registry_replicator:ic-registry-replicator",
"ic-replay": "//rs/replay:ic-replay",
"ic-rosetta-api": "//rs/rosetta-api:ic-rosetta-api",
"ic-icrc-rosetta": "//rs/rosetta-api/icrc1/rosetta:ic-icrc-rosetta-bin",
"ic-test-state-machine": "//rs/state_machine_tests:ic-test-state-machine",
"ic-workload-generator": "//rs/workload_generator:ic-workload-generator",
"icx-proxy": "//rs/boundary_node/icx_proxy:icx-proxy",
"icx-proxy-dev": "//rs/boundary_node/icx_proxy:icx-proxy-dev",
"metrics-proxy": "@crate_index//:metrics-proxy__metrics-proxy",
"nfplot": "//rs/nervous_system/neurons_fund/nfplot",
"orchestrator": "//rs/orchestrator",
"sandbox_launcher": "//rs/canister_sandbox:sandbox_launcher",
"setupos_tool": "//rs/ic_os/setupos_tool:setupos_tool",
"snptool": "//rs/ic_os/snptool:snptool",
"sns": "//rs/sns/cli:sns",
"sns-audit": "//rs/sns/audit:sns-audit",
"sns-test-feature": "//rs/sns/cli:sns--test_feature",
"state-tool": "//rs/state_tool:state-tool",
"systemd-journal-gatewayd-shim": "//rs/boundary_node/systemd_journal_gatewayd_shim:systemd-journal-gatewayd-shim",
"vsock_guest": "//rs/ic_os/vsock/guest:vsock_guest",
"vsock_host": "//rs/ic_os/vsock/host:vsock_host",
"drun": "//rs/drun:drun",
"pocket-ic": "//rs/pocket_ic_server:pocket-ic-server",
}
LIBRARIES = {
"nss_icos": "//rs/ic_os/nss_icos",
}
[release_nostrip_binary(
name = name + "_bin",
binary = BINARIES[name],
) for name in BINARIES if name in NO_STRIP]
[release_strip_binary(
name = name + "_bin",
binary = BINARIES[name],
) for name in BINARIES if name not in NO_STRIP]
[release_strip_binary(
name = name + "_lib",
binary = LIBRARIES[name],
) for name in LIBRARIES]
[
genrule(
name = name + "_cleaned",
srcs = [name + "_bin"],
outs = [name],
cmd = select({
"@platforms//os:linux": "objcopy -R .comment -R .note -R .note.gnu.build-id $< $@",
"@platforms//os:osx": "cp $< $@",
}),
executable = True,
visibility = [
"//ic-os/boundary-guestos/envs:__subpackages__",
"//ic-os/guestos/envs:__subpackages__",
"//ic-os/hostos/envs:__subpackages__",
"//ic-os/setupos/envs:__subpackages__",
],
)
for name in BINARIES
]
[
genrule(
name = name + "_cleaned_lib",
srcs = [name + "_lib"],
outs = [name],
cmd = select({
"@platforms//os:linux": "objcopy -R .comment -R .note -R .note.gnu.build-id $< $@",
"@platforms//os:osx": "cp $< $@",
}),
executable = True,
visibility = [
"//ic-os/boundary-api-guestos/envs:__subpackages__",
"//ic-os/boundary-guestos/envs:__subpackages__",
"//ic-os/guestos/envs:__subpackages__",
"//ic-os/hostos/envs:__subpackages__",
"//ic-os/setupos/envs:__subpackages__",
],
)
for name in LIBRARIES
]
[
gzip_compress(
name = name + ".gz",
srcs = [name],
)
for name in BINARIES
]
filegroup(
name = "binaries",
srcs = select({
"@platforms//os:linux": [name + ".gz" for name in BINARIES],
"@platforms//os:osx": [name + ".gz" for name in BINARIES if name not in LINUX_ONLY],
}),
)
upload_artifacts(
name = "upload",
inputs = [":binaries"],
remote_subdir = "binaries/" + select({
"@platforms//cpu:x86_64": "x86_64",
"@platforms//cpu:arm64": "arm64",
"//conditions:default": "unknown",
}) + "-" + select({
"@platforms//os:linux": "linux",
"@platforms//os:osx": "darwin",
"//conditions:default": "unknown",
}),
)
# https://dfinity.atlassian.net/browse/IDX-2599
# various places in the source code, and possibly other repositories reference
# the legacy upload path. Unwinding it without a will involve an unpredictable amount of time.
upload_artifacts(
name = "legacy_upload",
inputs = [":binaries"],
remote_subdir = "release",
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//testnet/tools:__pkg__"],
)
BINS_TO_TEST = [":" + name for name in BINARIES]
sh_test(
name = "binary-libraries-test",
size = "small",
srcs = ["binary-libraries-test.sh"],
args = ["$(rootpath " + b + ")" for b in BINS_TO_TEST],
data = BINS_TO_TEST,
tags = [
"test_macos",
],
)