Skip to content

Commit 2b66215

Browse files
committed
split actor targets in bazel
1 parent ee25003 commit 2b66215

File tree

3 files changed

+45
-21
lines changed

3 files changed

+45
-21
lines changed

src/workerd/io/BUILD.bazel

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ wd_cc_library(
8787
],
8888
}),
8989
implementation_deps = [
90+
":actor-storage",
9091
"//src/workerd/api:data-url",
9192
"//src/workerd/api/node:exceptions",
93+
"//src/workerd/util:autogate",
9294
"//src/workerd/util:completion-membrane",
9395
"//src/workerd/util:perfetto",
9496
"//src/workerd/util:string-buffer",
@@ -100,8 +102,9 @@ wd_cc_library(
100102
],
101103
visibility = ["//visibility:public"],
102104
deps = [
103-
":actor",
105+
":actor-cache",
104106
":actor-id",
107+
":actor-sqlite",
105108
":actor-storage_capnp",
106109
":cdp_capnp",
107110
":container_capnp",
@@ -154,35 +157,55 @@ wd_cc_library(
154157
],
155158
)
156159

157-
# TODO(cleanup): Split this up further.
158160
wd_cc_library(
159-
name = "actor",
160-
srcs = [
161-
"actor-cache.c++",
162-
"actor-sqlite.c++",
163-
"actor-storage.c++",
164-
],
165-
hdrs = [
166-
"actor-cache.h",
167-
"actor-sqlite.h",
168-
"actor-storage.h",
169-
],
161+
name = "actor-cache",
162+
srcs = ["actor-cache.c++"],
163+
hdrs = ["actor-cache.h"],
170164
implementation_deps = [
171-
"@sqlite3",
165+
":actor-storage",
166+
":io-gate",
167+
"//src/workerd/util:duration-exceeded-logger",
168+
"//src/workerd/util:sentry",
172169
],
173170
visibility = ["//visibility:public"],
174171
deps = [
175172
":actor-storage_capnp",
173+
"//src/workerd/jsg:exception",
174+
"@capnp-cpp//src/capnp:capnp-rpc",
175+
"@capnp-cpp//src/kj:kj-async",
176+
],
177+
)
178+
179+
wd_cc_library(
180+
name = "actor-sqlite",
181+
srcs = ["actor-sqlite.c++"],
182+
hdrs = ["actor-sqlite.h"],
183+
implementation_deps = [
176184
":io-gate",
177185
"//src/workerd/jsg:exception",
178186
"//src/workerd/util:autogate",
179-
"//src/workerd/util:duration-exceeded-logger",
187+
"@capnp-cpp//src/kj:kj",
188+
"@sqlite3",
189+
],
190+
visibility = ["//visibility:public"],
191+
deps = [
192+
":actor-cache",
180193
"//src/workerd/util:sqlite",
181-
"@capnp-cpp//src/capnp:capnp-rpc",
182-
"@capnp-cpp//src/kj:kj-async",
183194
],
184195
)
185196

197+
wd_cc_library(
198+
name = "actor-storage",
199+
srcs = ["actor-storage.c++"],
200+
hdrs = ["actor-storage.h"],
201+
implementation_deps = [
202+
":actor-storage_capnp",
203+
"//src/workerd/jsg:exception",
204+
],
205+
visibility = ["//visibility:public"],
206+
deps = ["@capnp-cpp//src/kj:kj"],
207+
)
208+
186209
wd_cc_library(
187210
name = "frankenvalue",
188211
srcs = ["frankenvalue.c++"],
@@ -358,7 +381,7 @@ kj_test(
358381
kj_test(
359382
src = "actor-cache-test.c++",
360383
deps = [
361-
":actor",
384+
":actor-cache",
362385
":io-gate",
363386
"//src/workerd/util:test",
364387
"//src/workerd/util:test-util",
@@ -368,8 +391,9 @@ kj_test(
368391
kj_test(
369392
src = "actor-sqlite-test.c++",
370393
deps = [
371-
":actor",
394+
":actor-sqlite",
372395
":io-gate",
396+
"//src/workerd/util:autogate",
373397
"//src/workerd/util:test",
374398
"//src/workerd/util:test-util",
375399
],

src/workerd/io/actor-sqlite.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
#pragma once
66

7-
#include "actor-cache.h"
8-
7+
#include <workerd/io/actor-cache.h>
98
#include <workerd/util/sqlite-kv.h>
109
#include <workerd/util/sqlite-metadata.h>
1110

src/workerd/util/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ wd_cc_library(
195195
hdrs = ["capnp-mock.h"],
196196
visibility = ["//visibility:public"],
197197
deps = [
198+
"@capnp-cpp//src/capnp:capnp-rpc",
198199
"@capnp-cpp//src/capnp:capnpc",
199200
],
200201
)

0 commit comments

Comments
 (0)