Skip to content

Commit

Permalink
[WIP] Bazel cleanup
Browse files Browse the repository at this point in the history
- Pass all parameters in kj_test to ensure tags will actually be
  applied, avoiding a considerable footgun.
- Update wd_ts_bundle to fix --legacy_external_runfiles=false for
  dependents.
- Clean up a few globs to enable incompatible_disallow_empty_glob at a
  later time.
- Flip --legacy_external_runfiles=true early to avoid generating
  superfluous runfile trees.
  • Loading branch information
fhanau committed Mar 17, 2024
1 parent e5dabdd commit 9885217
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ startup --digest_function=BLAKE3
build --legacy_external_runfiles=false
build --jobs=24 --local_resources=cpu=HOST_CPUS

# Avoid generating duplicate runfile trees. This will become the default in a future bazel version.
build --legacy_external_runfiles=true

# Flip this early to avoid breaking compatibility once it becomes the default.
build --incompatible_disallow_empty_glob

# Dawn tint build flags
build --@dawn//src/tint:tint_build_glsl_writer=False
build --@dawn//src/tint:tint_build_glsl_validator=False
Expand Down
2 changes: 2 additions & 0 deletions build/kj_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ def kj_test(
"@//:use_dead_strip": ["-Wl,-dead_strip", "-Wl,-no_exported_symbols"],
"//conditions:default": [""],
}),
data = data,
tags = tags,
)
4 changes: 2 additions & 2 deletions build/wd_ts_bundle.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def wd_ts_bundle(
eslint_bin.eslint_test(
name = name + "@eslint",
args = [
"--config $(execpath {})".format(eslintrc_json),
"--parser-options project:$(execpath {})".format(tsconfig_json),
"--config $(location {})".format(eslintrc_json),
"--parser-options project:$(location {})".format(tsconfig_json),
"-f stylish",
"--report-unused-disable-directives",
] + ["$(location " + src + ")" for src in ts_srcs],
Expand Down
13 changes: 7 additions & 6 deletions src/cloudflare/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ wd_ts_bundle(
"internal/*.ts",
"internal/*.js",
],
exclude = [
"internal/test/*",
allow_empty = True,
),
modules = glob(
[
"*.ts",
"*.js",
],
allow_empty = True,
),
modules = glob([
"*.ts",
"*.js",
]),
schema_id = "0xbcc8f57c63814006",
tsconfig_json = "tsconfig.json",
)
5 changes: 1 addition & 4 deletions src/cloudflare/internal/test/d1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ load("//:build/wd_test.bzl", "wd_test")
wd_test(
src = "d1-api-test.wd-test",
args = ["--experimental"],
data = glob([
"*.js",
"*.capnp",
]),
data = glob(["*.js"]),
)
5 changes: 1 addition & 4 deletions src/cloudflare/internal/test/vectorize/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ load("//:build/wd_test.bzl", "wd_test")

wd_test(
src = "vectorize-api-test.wd-test",
data = glob([
"*.js",
"*.capnp",
]),
data = glob(["*.js"]),
)
5 changes: 1 addition & 4 deletions src/workerd/server/tests/unsafe-module/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ load("//:build/wd_test.bzl", "wd_test")

wd_test(
src = "unsafe-module-test.wd-test",
data = glob([
"*.js",
"*.capnp",
]),
args = ["--experimental"],
data = glob(["*.js"]),
)

0 comments on commit 9885217

Please sign in to comment.