diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 2411c41e5..9a2ce666e 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -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: - "--" - "..." diff --git a/.bazelrc b/.bazelrc index d6f139529..6e46063f1 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 000000000..c6b7980b6 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +8.x diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f8e68bd22..a9dec4c55 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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 \ No newline at end of file + path: rbe_configs_gen_windows_amd64.exe diff --git a/.gitignore b/.gitignore index 1cbbb1ddb..11399e1dd 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ *.pyc # Go binaries built natively by the Go toolchain -/rbe_configs_gen \ No newline at end of file +/rbe_configs_gen +MODULE.bazel.lock diff --git a/WORKSPACE b/MODULE.bazel similarity index 55% rename from WORKSPACE rename to MODULE.bazel index b4fd8bc16..dc82f584d 100644 --- a/WORKSPACE +++ b/MODULE.bazel @@ -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 @@ -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", @@ -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() diff --git a/examples/remotebuildexecution/hello_world/cc/BUILD b/examples/remotebuildexecution/hello_world/cc/BUILD index 937b92030..f9df5895f 100644 --- a/examples/remotebuildexecution/hello_world/cc/BUILD +++ b/examples/remotebuildexecution/hello_world/cc/BUILD @@ -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( diff --git a/examples/remotebuildexecution/hello_world/java/BUILD b/examples/remotebuildexecution/hello_world/java/BUILD index 4a72fd88a..9396bdb2d 100644 --- a/examples/remotebuildexecution/hello_world/java/BUILD +++ b/examples/remotebuildexecution/hello_world/java/BUILD @@ -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"], diff --git a/examples/remotebuildexecution/rbe_system_check/cc/BUILD b/examples/remotebuildexecution/rbe_system_check/cc/BUILD index 596221607..597b15b4d 100644 --- a/examples/remotebuildexecution/rbe_system_check/cc/BUILD +++ b/examples/remotebuildexecution/rbe_system_check/cc/BUILD @@ -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( diff --git a/repositories/BUILD b/repositories/BUILD deleted file mode 100644 index b454e8a66..000000000 --- a/repositories/BUILD +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2016 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. - -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -licenses(["notice"]) # Apache 2.0 - -package(default_visibility = ["//visibility:public"]) - -bzl_library( - name = "repositories", - srcs = [ - "repositories.bzl", - ], -) diff --git a/repositories/repositories.bzl b/repositories/repositories.bzl deleted file mode 100644 index 85100ab27..000000000 --- a/repositories/repositories.bzl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2016 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. - -# Once recursive workspace is implemented in Bazel, this file should cease -# to exist. -""" -Provides functions to pull all dependencies of this repository. -""" - -load( - "@bazel_tools//tools/build_defs/repo:http.bzl", - "http_archive", -) - -def repositories(): - """Download dependencies of bazel-toolchains.""" - excludes = native.existing_rules().keys() - - if "bazel_skylib" not in excludes: - http_archive( - name = "bazel_skylib", - sha256 = "e5d90f0ec952883d56747b7604e2a15ee36e288bb556c3d0ed33e818a4d971f2", - strip_prefix = "bazel-skylib-1.0.2", - urls = ["https://github.com/bazelbuild/bazel-skylib/archive/1.0.2.tar.gz"], - ) diff --git a/tests/rules/exec_properties/BUILD b/tests/rules/exec_properties/BUILD index e10ca30d0..f5f741e0a 100644 --- a/tests/rules/exec_properties/BUILD +++ b/tests/rules/exec_properties/BUILD @@ -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",