Skip to content

Commit d555e49

Browse files
authored
Migrate to bzlmod (#389)
1 parent fd88360 commit d555e49

File tree

1,034 files changed

+269044
-18030
lines changed

Some content is hidden

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

1,034 files changed

+269044
-18030
lines changed

.bazelci/presubmit.yml

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

.bazelignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
docs/
21
node_modules
32
plugin/bufbuild/node_modules
43
plugin/stephenh/ts-proto/node_modules

.bazelrc

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1+
# =========================================================================
2+
# STARTUP
3+
# =========================================================================
14

2-
common --jvmopt=-Djava.security.manager=allow
3-
build --java_language_version=17
4-
build --java_runtime_version=remotejdk_17
5-
build --tool_java_language_version=17
6-
build --tool_java_runtime_version=remotejdk_17
5+
# Use blake3 as digest function instead of the much slower default sha256.
6+
startup --digest_function=blake3
77

8-
common --enable_platform_specific_config
9-
build:windows --cxxopt='/std:c++14'
10-
build:windows --host_cxxopt='/std:c++14'
11-
build:linux --cxxopt='-std=c++14'
12-
build:linux --host_cxxopt='-std=c++14'
13-
build:macos --cxxopt='-std=c++14'
14-
build:macos --host_cxxopt='-std=c++14'
15-
build:freebsd --cxxopt='-std=c++14'
16-
build:freebsd --host_cxxopt='-std=c++14'
8+
# =========================================================================
9+
# COMMON
10+
# =========================================================================
1711

18-
build:bazelci --deleted_packages=docs
12+
# Use '+' instead of the legacy '~' when resolving repo names.
13+
common --incompatible_use_plus_in_repo_names
1914

20-
# workaround for scala
21-
build --incompatible_java_common_parameters=false
15+
# =========================================================================
16+
# BUILD
17+
# =========================================================================
2218

23-
# HOME appears to be required by //pkg/plugin/grpc/grpc:grpc_test
24-
# (for github.com/bazelbuild/rules_go/go/tools/bazel_testing)
25-
test --action_env=HOME
19+
# Don't leak PATH and LD_LIBRARY_PATH into the build.
20+
# build --incompatible_strict_action_env
2621

27-
# Don't depend on a JAVA_HOME pointing at a system JDK
28-
# see https://github.com/bazelbuild/rules_jvm_external/issues/445
29-
build --repo_env=JAVA_HOME=../bazel_tools/jdk
22+
# Don't use legacy repository rules.
23+
build --incompatible_disable_native_repo_rules
24+
25+
# C++17 for protobuf compatibility
26+
build --host_cxxopt=-std=c++17
27+
build --cxxopt=-std=c++17

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.4.0
1+
7.6.1

.bcr/metadata.template.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"homepage": "https://github.com/stackb/rules_proto",
3+
"maintainers": [
4+
{
5+
"name": "Paul Cody",
6+
"email": "[email protected]",
7+
"github": "pcj"
8+
}
9+
],
10+
"repository": [
11+
"github:stackb/rules_proto"
12+
],
13+
"versions": [],
14+
"yanked_versions": {}
15+
}

.bcr/presubmit.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
bcr_test_module:
2+
module_path: "."
3+
matrix:
4+
platform: ["debian10", "ubuntu2004", "macos"]
5+
bazel: [7.x, 8.x]
6+
tasks:
7+
run_tests:
8+
name: "Run test module"
9+
platform: ${{ platform }}
10+
bazel: ${{ bazel }}
11+
test_targets:
12+
- "//..."

.bcr/source.template.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"integrity": "",
3+
"strip_prefix": "{REPO}-{TAG}",
4+
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.tar.gz"
5+
}

.github/workflows/ci.bazelrc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# This file contains Bazel settings to apply on CI only.
2-
# It is referenced with a --bazelrc option in the call to bazel in ci.yaml
31
# Debug where options came from
42
build --announce_rc
3+
54
# Don't rely on test logs being easily accessible from the test runner,
65
# though it makes the log noisier.
76
test --test_output=errors
7+
88
# This directory is configured in GitHub actions to be persisted between runs.
99
build --disk_cache=$HOME/.cache/bazel
1010
build --repository_cache=$HOME/.cache/bazel-repo
11+
1112
# Allows tests to run bazelisk-in-bazel, since this is the cache folder used
1213
test --test_env=XDG_CACHE_HOME
13-
# Keep until @io_bazel_rules_scala is upgraded
14-
build --incompatible_java_common_parameters=false
14+
15+
# Use remote cache instance
16+
build:cas --remote_instance_name=main
17+
build:cas --remote_cache=grpc://cas.stack.build:50051

.github/workflows/ci.yaml

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,41 @@ name: CI
22

33
# Controls when the action will run.
44
on:
5-
# Triggers the workflow on push or pull request events but only for the master branch
65
push:
76
branches: [master]
87
pull_request:
9-
branches: [master]
10-
11-
# Allows you to run this workflow manually from the Actions tab
128
workflow_dispatch:
139

10+
concurrency:
11+
# Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
1415
jobs:
1516
test:
16-
# The type of runner that the job will run on
17-
runs-on: ubuntu-latest
18-
19-
# Steps represent a sequence of tasks that will be executed as part of the job
17+
runs-on: self-hosted
2018
steps:
21-
- uses: actions/checkout@v3
22-
23-
- uses: bazelbuild/setup-bazelisk@v2
24-
25-
- name: Mount bazel action cache
26-
uses: actions/cache@v3
27-
if: always()
19+
- uses: actions/checkout@v4
20+
- uses: bazel-contrib/[email protected]
2821
with:
29-
path: "~/.cache/bazel"
30-
key: bazel
31-
32-
- name: Mount bazel repo cache
33-
uses: actions/cache@v3
34-
if: always()
35-
with:
36-
path: "~/.cache/bazel-repo"
37-
key: bazel-repo
22+
# Avoid downloading Bazel every time.
23+
bazelisk-cache: true
24+
# Store build cache per workflow.
25+
disk-cache: true
26+
# Share repository cache between workflows.
27+
repository-cache: true
28+
- name: bazel build
29+
run: >-
30+
bazelisk
31+
--bazelrc=.github/workflows/ci.bazelrc
32+
--bazelrc=.bazelrc
33+
build
34+
...
3835
3936
- name: bazel test
40-
env:
41-
# Bazelisk will download bazel to here, ensure it is cached between runs.
42-
XDG_CACHE_HOME: ~/.cache/bazel-repo
4337
run: >-
44-
bazel
38+
bazelisk
4539
--bazelrc=.github/workflows/ci.bazelrc
4640
--bazelrc=.bazelrc
4741
test
48-
--deleted_packages=//plugin/grpc-ecosystem/grpc-gateway
49-
//example/...
50-
//pkg/...
51-
//plugin/...
52-
//language/...
53-
//rules/...
54-
//toolchain/...
42+
...

.github/workflows/format.yaml

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

0 commit comments

Comments
 (0)