Skip to content

Commit

Permalink
bazel: Add RBE rules using BuildBuddy.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivucica committed Mar 26, 2024
1 parent 94547b3 commit 60d3ae1
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions .bazelrc
18 changes: 18 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,23 @@ git_repository(
)

load("@rules_libsdl12//:libsdl12.bzl", "libsdl12_repositories")

libsdl12_repositories()

# Toolchains for remote execution via buildbuddy.
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_buildbuddy_buildbuddy_toolchain",
sha256 = "1cab6ef3ae9b4211ab9d57826edd4bbc34e5b9e5cb1927c97f0788d8e7ad0442",
strip_prefix = "buildbuddy-toolchain-b043878a82f266fd78369b794a105b57dc0b2600",
urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/b043878a82f266fd78369b794a105b57dc0b2600.tar.gz"],
)

load("@io_buildbuddy_buildbuddy_toolchain//:deps.bzl", "buildbuddy_deps")

buildbuddy_deps()

load("@io_buildbuddy_buildbuddy_toolchain//:rules.bzl", "buildbuddy")

buildbuddy(name = "buildbuddy_toolchain")
45 changes: 45 additions & 0 deletions tools/bazel.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Use buildbuddy by passing --config=remote.
# This should be fine for this open source project.
query:remote --output=xml

build:remote --define=libsdl12_linux_deps_bin=true
build:remote --remote_executor=grpcs://remote.buildbuddy.io
build:remote --host_platform=@buildbuddy_toolchain//:platform
build:remote --platforms=@buildbuddy_toolchain//:platform
build:remote --extra_execution_platforms=@buildbuddy_toolchain//:platform
build:remote --crosstool_top=@buildbuddy_toolchain//:toolchain
build:remote --extra_toolchains=@buildbuddy_toolchain//:cc_toolchain
#build:remote --javabase=@buildbuddy_toolchain//:javabase_jdk8
#build:remote --host_javabase=@buildbuddy_toolchain//:javabase_jdk8
#build:remote --java_toolchain=@buildbuddy_toolchain//:toolchain_jdk8
#build:remote --host_java_toolchain=@buildbuddy_toolchain//:toolchain_jdk8
build:remote --define=EXECUTOR=remote
build:remote --define=libsdl12_linux_deps_bin=true

build:remote --bes_results_url=https://app.buildbuddy.io/invocation/
build:remote --bes_backend=grpcs://remote.buildbuddy.io
build:remote --remote_cache=grpcs://remote.buildbuddy.io
build:remote --remote_timeout=3600
build:remote --remote_executor=grpcs://remote.buildbuddy.io

# readonly:
#build:remote --noremote_upload_local_results # Uploads logs & artifacts without writing to cache
# toplevel:
#build:remote --remote_download_toplevel # Helps remove network bottleneck if caching is enabled

build:remote --jobs=50

# Use buildbuddy for cache only, by passing --config=remotecache.
# This should be fine for this open source project.
build:remotecache --bes_results_url=https://app.buildbuddy.io/invocation/
build:remotecache --bes_backend=grpcs://remote.buildbuddy.io
build:remotecache --remote_cache=grpcs://remote.buildbuddy.io
build:remotecache --remote_timeout=3600
build:remotecache --remote_executor=grpcs://remote.buildbuddy.io

# readonly:
#build:remotecache --noremote_upload_local_results # Uploads logs & artifacts without writing to cache
# toplevel:
#build:remotecache --remote_download_toplevel # Helps remove network bottleneck if caching is enabled

try-import %workspace%/.bazelrc.buildbuddysecrets

0 comments on commit 60d3ae1

Please sign in to comment.