# Copyright 2017 gRPC authors.
#
# 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.

licenses(["notice"])  # Apache v2

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

load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict")

# The default toolchain suite for RBE linux, pass it to --crosstool_top
alias(
    name = "rbe_linux_default_toolchain_suite",
    actual = "//third_party/toolchains/rbe_ubuntu2004/cc:toolchain",
)

# The default CC toolchain suite for RBE linux
alias(
    name = "rbe_linux_default_cc_toolchain",
    actual = "//third_party/toolchains/rbe_ubuntu2004/config:cc-toolchain",
)

# The default platform for RBE Linux
platform(
	name = "rbe_linux_default_platform",
    # Inherit from the platform target generated by 'rbe_configs_gen'.
	parents = ["//third_party/toolchains/rbe_ubuntu2004/config:platform"],
	exec_properties = create_rbe_exec_properties_dict(
        docker_add_capabilities = "SYS_PTRACE",
        docker_privileged = True,
        # by default, all RBE actions will run on "small" workers.
        # For individual targets, this can be overridden by adding the "exec_properties = LARGE_MACHINE"
        # attribute.
        labels = {
            "os": "ubuntu",
            "machine_size": "small",
        },
        os_family = "Linux",
    ),
)

# The default toolchain suite for RBE windows, pass it to --crosstool_top
alias(
    name = "rbe_windows_default_toolchain_suite",
    actual = "//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/cc:toolchain",
)

# The default CC toolchain suite for RBE windows
alias(
    name = "rbe_windows_default_cc_toolchain",
    actual = "//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config:cc-toolchain",
)

# The default platform for RBE windows
platform(
    name = "rbe_windows_default_platform",
    # Inherit from the platform target generated by 'rbe_configs_gen'.
	parents = ["//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config:platform"],
    exec_properties = create_rbe_exec_properties_dict(
        os_family = "Windows",
        # by default, all RBE actions will run on "small" workers.
        labels = {"os": "windows_2019", "machine_size": "small"},
    ),
)
