Skip to content

Commit 60a3e9f

Browse files
authored
fix: support --incompatible_disallow_empty_glob (#731)
* fix: support --incompatible_disallow_empty_glob This flag was flipped for Bazel 8 * switch our flag setting * chore(deps): upgrade stardoc * chore: docgen * chore: bump rules_proto
1 parent 3849ce6 commit 60a3e9f

File tree

7 files changed

+25
-18
lines changed

7 files changed

+25
-18
lines changed

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import %workspace%/.aspect/bazelrc/performance.bazelrc
1111
common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig
1212
common --@aspect_rules_ts//ts:default_to_tsc_transpiler
1313

14-
# We have some empty globs in this repo
15-
common --noincompatible_disallow_empty_glob
14+
# opt-in to flag that is on by default in Bazel 8
15+
common --incompatible_disallow_empty_glob
1616

1717
# Never Compile protoc Again
1818
common --incompatible_enable_proto_toolchain_resolution

MODULE.bazel

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True
2727
bazel_dep(name = "gazelle", version = "0.36.0", dev_dependency = True, repo_name = "bazel_gazelle")
2828
bazel_dep(name = "rules_go", version = "0.46.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
2929
bazel_dep(name = "rules_nodejs", version = "6.2.0", dev_dependency = True)
30-
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")
30+
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True, repo_name = "io_bazel_stardoc")
3131
bazel_dep(name = "toolchains_protoc", version = "0.3.0", dev_dependency = True)
3232

3333
# Should not be required, stardoc leaks a dependency
@@ -38,13 +38,6 @@ register_toolchains(
3838
dev_dependency = True,
3939
)
4040

41-
# pick up fix: https://github.com/bazelbuild/stardoc/pull/221
42-
git_override(
43-
module_name = "stardoc",
44-
commit = "3baa5d1761970c6285d2ac9c3adccfaac42f54c5",
45-
remote = "https://github.com/bazelbuild/stardoc.git",
46-
)
47-
4841
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
4942
npm.npm_translate_lock(
5043
name = "npm",

docs/proto.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Future work
4747
## ts_proto_library
4848

4949
<pre>
50+
load("@aspect_rules_ts//ts:proto.bzl", "ts_proto_library")
51+
5052
ts_proto_library(<a href="#ts_proto_library-name">name</a>, <a href="#ts_proto_library-node_modules">node_modules</a>, <a href="#ts_proto_library-proto">proto</a>, <a href="#ts_proto_library-protoc_gen_options">protoc_gen_options</a>, <a href="#ts_proto_library-gen_connect_es">gen_connect_es</a>, <a href="#ts_proto_library-gen_connect_query">gen_connect_query</a>,
5153
<a href="#ts_proto_library-gen_connect_query_service_mapping">gen_connect_query_service_mapping</a>, <a href="#ts_proto_library-copy_files">copy_files</a>, <a href="#ts_proto_library-proto_srcs">proto_srcs</a>, <a href="#ts_proto_library-files_to_copy">files_to_copy</a>, <a href="#ts_proto_library-kwargs">kwargs</a>)
5254
</pre>

docs/repositories.md

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/rules.md

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal_deps.bzl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ def rules_ts_internal_deps():
3333

3434
http_archive(
3535
name = "io_bazel_stardoc",
36-
sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432",
37-
urls = ["https://github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz"],
36+
sha256 = "fabb280f6c92a3b55eed89a918ca91e39fb733373c81e87a18ae9e33e75023ec",
37+
urls = [
38+
"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.7.1/stardoc-0.7.1.tar.gz",
39+
"https://github.com/bazelbuild/stardoc/releases/download/0.7.1/stardoc-0.7.1.tar.gz",
40+
],
3841
)
3942

4043
http_archive(
@@ -46,9 +49,9 @@ def rules_ts_internal_deps():
4649

4750
http_archive(
4851
name = "rules_proto",
49-
sha256 = "303e86e722a520f6f326a50b41cfc16b98fe6d1955ce46642a5b7a67c11c0f5d",
50-
strip_prefix = "rules_proto-6.0.0",
51-
url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.0/rules_proto-6.0.0.tar.gz",
52+
sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295",
53+
strip_prefix = "rules_proto-6.0.2",
54+
url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz",
5255
)
5356

5457
http_archive(

ts/defs.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def _is_file_missing(label):
2323
"""
2424
file_abs = "%s/%s" % (label.package, label.name)
2525
file_rel = file_abs[len(native.package_name()) + 1:]
26-
file_glob = native.glob([file_rel])
26+
file_glob = native.glob([file_rel], allow_empty = True)
2727
return len(file_glob) == 0
2828

2929
_tsc = "@npm_typescript//:tsc"
@@ -475,7 +475,7 @@ def _default_srcs(allow_js, resolve_json_module):
475475
include.append("**/*.json")
476476
exclude.extend(["**/package.json", "**/package-lock.json", "**/tsconfig*.json"])
477477

478-
return native.glob(include, exclude)
478+
return native.glob(include, exclude, allow_empty = True)
479479

480480
def _invoke_custom_transpiler(type_str, transpiler, transpile_target_name, srcs, common_kwargs):
481481
if type(transpiler) == "function" or type(transpiler) == "rule":

0 commit comments

Comments
 (0)