Skip to content

Commit

Permalink
chore(bazel): add MODULE.bazel files for bzlmod
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 committed Mar 1, 2024
1 parent 6146252 commit 3b9bbbb
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@

# Defaults to auto which means off for Windows, explicitly enable for sh tests
build --enable_runfiles=yes
common --enable_bzlmod
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# Ignore all bazel-* symlinks. There is no full list since this can change
# based on the name of the directory bazel is cloned into.
/bazel-*
MODULE.bazel.lock
/tests/rbe_repo/examples/bazel_toolchains_client/bazel-*
/tests/rbe_repo/examples/toolchain_config_host/bazel-*
/rbe-test-output/
Expand Down
9 changes: 9 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module(
name = "bazel_toolchains",
version = "",
)

bazel_dep(name = "bazel_skylib", version = "1.3.0")

non_module_deps = use_extension("//:non_module_deps.bzl", "non_module_deps")
use_repo(non_module_deps, "rbe_default")
Empty file added WORKSPACE.bzlmod
Empty file.
32 changes: 32 additions & 0 deletions non_module_deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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.

"""This file contains the download of rbe_default dependency.
"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

def _non_module_deps_impl():
http_archive(
name = "rbe_default",
# The sha256 digest of the tarball might change without notice. So it's not
# included here. Please refer to the link mentioned above for instructions
# on how to generate your own configs.
urls = [
"https://storage.googleapis.com/rbe-toolchain/bazel-configs/rbe-ubuntu1604/latest/rbe_default.tar",
],
)

non_module_deps = module_extension(implementation = _non_module_deps_impl)

0 comments on commit 3b9bbbb

Please sign in to comment.