Skip to content

Commit

Permalink
[build] Move io-channels.h back into io target
Browse files Browse the repository at this point in the history
io-channels.h has a circular dependency with io due to its dependency on
io-util.h (parsing the header using bazel is expected to fail accordingly).
This means any source file depending on it would need to be in a bazel target
depending on io to avoid missing header errors, even if the source file doesn't
use io itself. Move it back into io in accordance with IWYU.

- Fix dependencies for io:actor-id, util:duration-exceeded-logger
- Fix duration-exceeded-logger.h appearing in two targets
  • Loading branch information
fhanau committed Nov 12, 2024
1 parent eb008ce commit c2e2369
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
13 changes: 2 additions & 11 deletions src/workerd/io/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ wd_cc_library(
"compatibility-date.h",
"features.h",
"hibernation-manager.h",
"io-channels.h",
"io-context.h",
"io-own.h",
"io-util.h",
Expand Down Expand Up @@ -86,7 +87,6 @@ wd_cc_library(
":actor-id",
":actor-storage_capnp",
":cdp_capnp",
":io-channels",
":io-gate",
":io-helpers",
":limit-enforcer",
Expand Down Expand Up @@ -228,16 +228,7 @@ wd_cc_library(
name = "actor-id",
hdrs = ["actor-id.h"],
visibility = ["//visibility:public"],
)

wd_cc_library(
name = "io-channels",
hdrs = ["io-channels.h"],
visibility = ["//visibility:public"],
deps = [
":actor-id",
":trace",
],
deps = ["@capnp-cpp//src/kj"],
)

genrule(
Expand Down
1 change: 0 additions & 1 deletion src/workerd/server/tests/python/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("//:build/pyodide_bucket.bzl", "PYODIDE_IMPORTS_TO_TEST")
load("//:build/wd_test.bzl", "wd_test")
load("//src/workerd/server/tests/python:import_tests.bzl", "gen_import_tests")
load("//src/workerd/server/tests/python:py_wd_test.bzl", "py_wd_test")

Expand Down
3 changes: 2 additions & 1 deletion src/workerd/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ wd_cc_library(
"batch-queue.h",
"canceler.h",
"color-util.h",
"duration-exceeded-logger.h",
"http-util.h",
"stream-utils.h",
"uncaught-exception-source.h",
Expand All @@ -50,6 +49,7 @@ wd_cc_library(
],
visibility = ["//visibility:public"],
deps = [
":duration-exceeded-logger",
"@capnp-cpp//src/kj",
"@capnp-cpp//src/kj:kj-async",
],
Expand Down Expand Up @@ -199,6 +199,7 @@ wd_cc_library(
name = "duration-exceeded-logger",
hdrs = ["duration-exceeded-logger.h"],
visibility = ["//visibility:public"],
deps = ["@capnp-cpp//src/kj"],
)

exports_files(["autogate.h"])
Expand Down

0 comments on commit c2e2369

Please sign in to comment.