Skip to content

Commit 2bed240

Browse files
authored
refactor: move stardoc to docs submodule (#792)
prevents building protoc from source in root repository Partially reverts #614
1 parent 565ea29 commit 2bed240

File tree

10 files changed

+30
-63
lines changed

10 files changed

+30
-63
lines changed

.bazelignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
# Nested modules
2+
docs/
13
e2e/
4+
5+
# TODO(bazel 8): move to REPO.bazel
26
examples/connect_node/node_modules
37
examples/node_modules
48
examples/proto_grpc/node_modules

.bazelrc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ common --incompatible_disallow_empty_glob
1616

1717
# Never Compile protoc Again
1818
common --incompatible_enable_proto_toolchain_resolution
19-
20-
# Ugh, stardoc needs to compile Java sources.
21-
# Don't depend on a JAVA_HOME pointing at a system JDK
22-
# see https://github.com/bazelbuild/rules_jvm_external/issues/445
23-
build --repo_env=JAVA_HOME=../bazel_tools/jdk
19+
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
20+
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
2421

2522
# verbose
2623
common:verbose --@aspect_rules_ts//ts:verbose --worker_verbose

.github/workflows/ci.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ jobs:
5656
runs-on: ${{ matrix.os }}-latest
5757
needs:
5858
- matrix-prep
59+
defaults:
60+
run:
61+
working-directory: ${{ matrix.folder }}
5962
strategy:
6063
fail-fast: false
6164
matrix:
@@ -105,7 +108,13 @@ jobs:
105108
bzlmod: 0
106109
- folder: e2e/workspace
107110
bzlmod: 1
108-
111+
include:
112+
- bazel-version:
113+
major: 7
114+
version: 7.3.2
115+
bzlmod: 1
116+
folder: docs
117+
os: ubuntu
109118
# Steps represent a sequence of tasks that will be executed as part of the job
110119
steps:
111120
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
@@ -130,7 +139,6 @@ jobs:
130139
bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-
131140
132141
- name: Configure Bazel version
133-
working-directory: ${{ matrix.folder }}
134142
shell: bash
135143
run: |
136144
# Overwrite the .bazelversion instead of using USE_BAZEL_VERSION so that Bazelisk
@@ -146,12 +154,10 @@ jobs:
146154
# TODO: remove this block once we have Aspect CLI Windows releases
147155
- name: Don't use Aspect CLI on Windows
148156
if: matrix.os == 'windows'
149-
working-directory: ${{ matrix.folder }}
150157
shell: bash
151158
run: rm -f .bazeliskrc
152159

153160
- name: bazel test //...
154-
working-directory: ${{ matrix.folder }}
155161
shell: bash
156162
run: |
157163
bazel \

MODULE.bazel

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ bazel_dep(name = "aspect_rules_lint", version = "1.2.1", dev_dependency = True)
2525
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
2626
bazel_dep(name = "rules_go", version = "0.46.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
2727
bazel_dep(name = "rules_nodejs", version = "6.2.0", dev_dependency = True)
28-
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True, repo_name = "io_bazel_stardoc")
29-
bazel_dep(name = "toolchains_protoc", version = "0.3.0", dev_dependency = True)
30-
31-
# Should not be required, stardoc leaks a dependency
32-
bazel_dep(name = "rules_java", version = "7.6.1", dev_dependency = True)
33-
34-
register_toolchains(
35-
"//tools/toolchains:all",
36-
dev_dependency = True,
37-
)
3828

3929
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
4030
npm.npm_translate_lock(

WORKSPACE.bzlmod

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")
2-
3-
# Needed for stardoc to compile from Java sources
4-
http_jar(
5-
name = "protobuf-java",
6-
integrity = "sha256-kHLmD+Zs/11sDxGh3yHY8+Sym17ngrRcP8dfWfviuDk=",
7-
urls = ["https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/4.27.0/protobuf-java-4.27.0.jar"],
8-
)

docs/.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.bazelversion

docs/BUILD.bazel

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,18 @@ load("@aspect_bazel_lib//lib:docs.bzl", "stardoc_with_diff_test", "update_docs")
44

55
stardoc_with_diff_test(
66
name = "rules",
7-
bzl_library_target = "//ts:defs",
8-
tags = [
9-
"skip-on-bazel6",
10-
"skip-on-bzlmod-0",
11-
"skip-on-rbe",
12-
],
7+
bzl_library_target = "@aspect_rules_ts//ts:defs",
138
)
149

1510
stardoc_with_diff_test(
1611
name = "proto",
17-
bzl_library_target = "//ts:proto",
18-
tags = [
19-
"skip-on-bazel6",
20-
"skip-on-bzlmod-0",
21-
"skip-on-rbe",
22-
],
12+
bzl_library_target = "@aspect_rules_ts//ts:proto",
2313
)
2414

2515
stardoc_with_diff_test(
2616
name = "repositories",
27-
bzl_library_target = "//ts:repositories",
17+
bzl_library_target = "@aspect_rules_ts//ts:repositories",
2818
symbol_names = ["rules_ts_dependencies"],
29-
tags = [
30-
"skip-on-bazel6",
31-
"skip-on-bzlmod-0",
32-
"skip-on-rbe",
33-
],
3419
)
3520

36-
update_docs(
37-
name = "update",
38-
tags = [
39-
"skip-on-bazel6",
40-
"skip-on-bzlmod-0",
41-
"skip-on-rbe",
42-
],
43-
)
21+
update_docs(name = "update")

docs/MODULE.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
bazel_dep(name = "aspect_bazel_lib", version = "2.14.0")
2+
bazel_dep(name = "aspect_rules_ts", version = "0.0.0")
3+
bazel_dep(name = "stardoc", version = "0.7.1", repo_name = "io_bazel_stardoc")
4+
5+
local_path_override(
6+
module_name = "aspect_rules_ts",
7+
path = "..",
8+
)

tools/toolchains/BUILD.bazel

Lines changed: 0 additions & 9 deletions
This file was deleted.

ts/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ load("//ts/private:options.bzl", "options")
55

66
exports_files(
77
glob(["*.bzl"]),
8-
visibility = ["//docs:__pkg__"],
8+
visibility = ["//visibility:public"],
99
)
1010

1111
_skip_lib_check_selection_required = """

0 commit comments

Comments
 (0)