Skip to content

Commit ae34ad0

Browse files
committed
Merge branch 'master' into noinfo
2 parents ff0943a + 433ea85 commit ae34ad0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+800
-356
lines changed

.bazelci/presubmit.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@ buildifier:
33
version: latest
44
warnings: "default"
55
platforms:
6-
ubuntu1604:
6+
ubuntu1804:
77
test_targets:
88
- "//..."
9-
ubuntu1804:
9+
ubuntu2004:
10+
test_targets:
11+
- "//..."
12+
ubuntu2204:
1013
test_targets:
1114
- "//..."
1215
macos:
1316
test_targets:
1417
- "//..."
18+
macos_arm64:
19+
test_targets:
20+
- "//..."
1521
windows:
1622
test_flags:
1723
- "--enable_runfiles"

.bazelrc

+7
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ build:release -c opt --stamp --workspace_status_command="$PWD/status.py"
88
# *last* statement in the root configuration file, as the local configuration
99
# file should be able to overwrite flags from the root configuration.
1010
try-import %workspace%/.bazelrc.user
11+
12+
# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
13+
# https://github.com/bazelbuild/buildtools/issues/1204
14+
common --noenable_bzlmod
15+
16+
build --cxxopt=-std=c++14
17+
build --host_cxxopt=-std=c++14

.pre-commit-config.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# First [install pre-commit](https://pre-commit.com/#installation),
2+
# then run
3+
# pre-commit install
4+
# See https://pre-commit.com for more information
5+
# See https://pre-commit.com/hooks.html for more hooks
6+
7+
repos:
8+
# Check formatting and lint for starlark code
9+
- repo: https://github.com/keith/pre-commit-buildifier
10+
rev: 6.3.3
11+
hooks:
12+
- id: buildifier
13+
- id: buildifier-lint

BUILD.bazel

+8-7
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,22 @@ test_suite(
2121
name = "tests",
2222
tests = [
2323
"//api_proto:api.gen.pb.go_checkshtest",
24-
"//build:go_default_test",
24+
"//build:build_test",
2525
"//build_proto:build.gen.pb.go_checkshtest",
2626
"//buildifier:buildifier_integration_test",
2727
"//deps_proto:deps.gen.pb.go_checkshtest",
28-
"//edit:go_default_test",
28+
"//edit:edit_test",
2929
"//extra_actions_base_proto:extra_actions_base.gen.pb.go_checkshtest",
30-
"//labels:go_default_test",
30+
"//labels:labels_test",
3131
"//lang:tables.gen.go_checkshtest",
32-
"//tables:go_default_test",
33-
"//warn:go_default_test",
34-
"//warn/docs:go_default_test",
35-
"//wspace:go_default_test",
32+
"//tables:tables_test",
33+
"//warn:warn_test",
34+
"//warn/docs:docs_test",
35+
"//wspace:wspace_test",
3636
],
3737
)
3838

39+
#gazelle:go_naming_convention import_alias
3940
gazelle(
4041
name = "gazelle",
4142
prefix = "github.com/bazelbuild/buildtools",

CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Admins
2-
* @vladmos @pmbethe09 @meisterT
2+
* @vladmos @pmbethe09 @larsrc-google

MODULE.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
2+
# https://github.com/bazelbuild/buildtools/issues/1204

WARNINGS.md

-1
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,6 @@ The statement has no effect. Consider removing it or storing its result in a var
765765

766766
* Category name: `out-of-order-load`
767767
* Automatic fix: yes
768-
* [Disabled by default](buildifier/README.md#linter)
769768
* [Suppress the warning](#suppress): `# buildifier: disable=out-of-order-load`
770769

771770
Load statements should be ordered by their first argument - extension file label.

WORKSPACE

+31-14
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ go_repository(
3939

4040
http_archive(
4141
name = "com_google_protobuf",
42-
sha256 = "9b4ee22c250fe31b16f1a24d61467e40780a3fbb9b91c3b65be2a376ed913a1a",
43-
strip_prefix = "protobuf-3.13.0",
42+
sha256 = "616bb3536ac1fff3fb1a141450fa28b875e985712170ea7f1bfe5e5fc41e2cd8",
43+
strip_prefix = "protobuf-24.4",
4444
urls = [
45-
"https://github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz",
45+
"https://github.com/protocolbuffers/protobuf/archive/v24.4.tar.gz",
4646
],
4747
)
4848

@@ -76,20 +76,37 @@ load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_depen
7676

7777
buildifier_dependencies()
7878

79-
# We don't use any nodejs but this includes a rule for publishing releases to npm
8079
http_archive(
81-
name = "build_bazel_rules_nodejs",
82-
sha256 = "8a7c981217239085f78acc9898a1f7ba99af887c1996ceb3b4504655383a2c3c",
83-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0/rules_nodejs-4.0.0.tar.gz"],
80+
name = "rules_nodejs",
81+
sha256 = "162f4adfd719ba42b8a6f16030a20f434dc110c65dc608660ef7b3411c9873f9",
82+
strip_prefix = "rules_nodejs-6.0.2",
83+
url = "https://github.com/bazelbuild/rules_nodejs/releases/download/v6.0.2/rules_nodejs-v6.0.2.tar.gz",
8484
)
8585

86-
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install")
86+
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
8787

88-
node_repositories(node_version = "16.7.0")
88+
nodejs_register_toolchains(
89+
name = "nodejs",
90+
node_version = "16.7.0",
91+
)
8992

90-
# Fetch third-party dependencies for building npm packages
91-
npm_install(
92-
name = "buildozer_npm_deps",
93-
package_json = "//buildozer/npm:package.json",
94-
package_lock_json = "//buildozer/npm:package-lock.json",
93+
http_archive(
94+
name = "aspect_rules_js",
95+
sha256 = "7ab9776bcca823af361577a1a2ebb9a30d2eb5b94ecc964b8be360f443f714b2",
96+
strip_prefix = "rules_js-1.32.6",
97+
url = "https://github.com/aspect-build/rules_js/releases/download/v1.32.6/rules_js-v1.32.6.tar.gz",
9598
)
99+
100+
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
101+
102+
rules_js_dependencies()
103+
104+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
105+
106+
bazel_features_deps()
107+
108+
load("@aspect_bazel_lib//lib:repositories.bzl", "register_copy_to_directory_toolchains", "register_jq_toolchains")
109+
110+
register_jq_toolchains()
111+
112+
register_copy_to_directory_toolchains()

api_proto/BUILD.bazel

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ go_proto_library(
2323
)
2424

2525
go_library(
26-
name = "go_default_library",
26+
name = "api_proto",
2727
embed = [":api_proto_go_proto"],
2828
importpath = "github.com/bazelbuild/buildtools/api_proto",
2929
visibility = ["//visibility:public"],
3030
)
31+
32+
alias(
33+
name = "go_default_library",
34+
actual = ":api_proto",
35+
visibility = ["//visibility:public"],
36+
)

api_proto/api.gen.pb.go

+19-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api_proto/api.proto

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ message Output {
3434
enum ERROR {
3535
UNKNOWN = 0;
3636
MISSING = 1;
37+
MISSING_LIST_ITEM = 2;
3738
}
3839
}
3940
}

build/BUILD.bazel

+11-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ go_yacc(
88
)
99

1010
go_library(
11-
name = "go_default_library",
11+
name = "build",
1212
srcs = [
1313
"lex.go",
1414
"parse.y.baz.go", # keep
@@ -23,12 +23,12 @@ go_library(
2323
importpath = "github.com/bazelbuild/buildtools/build",
2424
visibility = ["//visibility:public"],
2525
deps = [
26-
"//tables:go_default_library",
26+
"//tables",
2727
],
2828
)
2929

3030
go_test(
31-
name = "go_default_test",
31+
name = "build_test",
3232
size = "small",
3333
srcs = [
3434
"checkfile_test.go",
@@ -49,9 +49,15 @@ go_test(
4949
"rewrite_test_files/original_formatted.star",
5050
"rewrite_test_files/original.star",
5151
],
52-
embed = [":go_default_library"],
52+
embed = [":build"],
5353
deps = [
54-
"//tables:go_default_library",
54+
"//tables",
5555
"//testutils",
5656
],
5757
)
58+
59+
alias(
60+
name = "go_default_library",
61+
actual = ":build",
62+
visibility = ["//visibility:public"],
63+
)

build_proto/BUILD.bazel

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
12
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
23
load("@rules_proto//proto:defs.bzl", "proto_library")
34
load("//build:build_defs.bzl", "go_proto_checkedin_test")
@@ -18,8 +19,21 @@ proto_library(
1819
)
1920

2021
go_proto_library(
21-
name = "go_default_library",
22+
name = "build_proto_go_proto",
2223
importpath = "github.com/bazelbuild/buildtools/build_proto",
2324
proto = ":blaze_query_proto",
2425
visibility = ["//visibility:public"],
2526
)
27+
28+
go_library(
29+
name = "build_proto",
30+
embed = [":build_proto_go_proto"],
31+
importpath = "github.com/bazelbuild/buildtools/build_proto",
32+
visibility = ["//visibility:public"],
33+
)
34+
35+
alias(
36+
name = "go_default_library",
37+
actual = ":build_proto",
38+
visibility = ["//visibility:public"],
39+
)

build_proto/build.gen.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)