Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Bzlmod #1019

Merged
merged 8 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
---
buildifier:
version: latest
# Check for issues with the format of our bazel config files.
# All warnings from https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md
# are enabled except:
# rule-impl-return,uninitialized,return-value,rule-impl-return,unsorted-dict-items,out-of-order-load
# TODO (suvanjan): Re-enable once issues and https://github.com/bazelbuild/buildtools/issues/575
# are fixed.
warnings: "attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,confusing-name,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,function-docstring,git-repository,http-archive,integer-division,load,load-on-top,module-docstring,name-conventions,native-build,native-package,no-effect,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unreachable,unused-variable"
tasks:
presubmit:
platform: ubuntu1604
platform: ubuntu2204
build_targets:
- "--"
- "..."
Expand Down
3 changes: 0 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@
# Defaults to auto which means off for Windows, explicitly enable for sh tests
build --enable_runfiles=yes

# Explicitly enable WORKSPACE
# See https://github.com/bazelbuild/bazel/issues/23023
common --enable_workspace
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.x
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ jobs:
go test ./cmd/... ./pkg/...
# Upload the config generation binaries for easy sharing.
- name: Upload Artifact Linux AMD64
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: rbe_configs_gen_linux_amd64
path: rbe_configs_gen_linux_amd64
- name: Upload Artifact Windows AMD64
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: rbe_configs_gen_windows_amd64.exe
path: rbe_configs_gen_windows_amd64.exe
path: rbe_configs_gen_windows_amd64.exe
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
*.pyc

# Go binaries built natively by the Go toolchain
/rbe_configs_gen
/rbe_configs_gen
MODULE.bazel.lock
26 changes: 4 additions & 22 deletions WORKSPACE → MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
workspace(name = "bazel_toolchains")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_java", version = "8.7.2")
bazel_dep(name = "rules_cc", version = "0.0.17")

# Use pre-generated toolchain configs for the latest Bazel and latest Ubuntu 16.04
# container. Pre-generated configs are only provided as a convenience for
Expand All @@ -22,7 +11,7 @@ workspace(name = "bazel_toolchains")
# toolchain configs in production because they may break without warning.
# For more information and alternatives, please visit:
# https://github.com/bazelbuild/bazel-toolchains#rbe_configs_gen---cli-tool-to-generate-configs
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "rbe_default",
Expand All @@ -31,10 +20,3 @@ http_archive(
# on how to generate your own configs.
urls = ["https://storage.googleapis.com/rbe-toolchain/bazel-configs/rbe-ubuntu1604/latest/rbe_default.tar"],
)

load(
"//repositories:repositories.bzl",
bazel_toolchains_repositories = "repositories",
)

bazel_toolchains_repositories()
4 changes: 4 additions & 0 deletions examples/remotebuildexecution/hello_world/cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")

package(default_visibility = ["//visibility:public"])

cc_library(
Expand Down
2 changes: 2 additions & 0 deletions examples/remotebuildexecution/hello_world/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_java//java:java_binary.bzl", "java_binary")

java_binary(
name = "hello_java",
srcs = ["HelloWorld.java"],
Expand Down
3 changes: 3 additions & 0 deletions examples/remotebuildexecution/rbe_system_check/cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_test.bzl", "cc_test")

package(default_visibility = ["//visibility:public"])

cc_binary(
Expand Down
26 changes: 0 additions & 26 deletions repositories/BUILD

This file was deleted.

36 changes: 0 additions & 36 deletions repositories/repositories.bzl

This file was deleted.

2 changes: 1 addition & 1 deletion tests/rules/exec_properties/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load(":compare.bzl", "compare_dicts_test")
load("//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict")
load(":compare.bzl", "compare_dicts_test")

compare_dicts_test(
name = "docker_network_compare_test",
Expand Down