Skip to content

Commit

Permalink
Cleanup: Split compatibility-date.capnp into its own capnp_library.
Browse files Browse the repository at this point in the history
This allows us to clean up dependencies of some internal libs. It's especially nice to eliminate the dependency on the generated file `trimmed-supported-compatibility-date.txt`.
  • Loading branch information
kentonv committed Feb 17, 2024
1 parent b9ae4b3 commit 4e43db4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/workerd/io/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,23 @@ capnp_embed(
src = ":trimmed-supported-compatibility-date-gen",
)

# TODO(cleanup): Split this target up further, as many depnedents don't need all the files here.
# Avoiding the dependency on supported-compatibility-date.capnp is often helpful due to the
# transitive dependency on `trimmed-supported-compatibility-date.txt` which is dynamically
# generated.
wd_cc_capnp_library(
name = "capnp",
srcs = [
"actor-storage.capnp",
"cdp.capnp",
"compatibility-date.capnp",
"supported-compatibility-date.capnp",
"worker-interface.capnp",
],
visibility = ["//visibility:public"],
deps = [
":outcome_capnp",
":script_version_capnp",
":compatibility_date_capnp",
":trimmed-supported-compatibility-date",
"@capnp-cpp//src/capnp/compat:http-over-capnp_capnp",
],
Expand All @@ -166,6 +170,12 @@ wd_cc_capnp_library(
visibility = ["//visibility:public"],
)

wd_cc_capnp_library(
name = "compatibility_date_capnp",
srcs = ["compatibility-date.capnp"],
visibility = ["//visibility:public"],
)

[kj_test(
src = f,
deps = [
Expand Down

0 comments on commit 4e43db4

Please sign in to comment.