load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "nogo")
load("@rules_shell//shell:sh_test.bzl", "sh_test")

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

# Platform for cross-compiling to Linux x86_64
platform(
    name = "linux_x86_64",
    constraint_values = [
        "@platforms//os:linux",
        "@platforms//cpu:x86_64",
    ],
    missing_toolchain_error = "No Linux x86_64 toolchain matched. Docker/Eagle image builds should pass --platforms=//:linux_x86_64 and --extra_toolchains=@llvm_toolchain_linux//:cc-toolchain-x86_64-linux when compiling C++ code.",
)

# Platform for cross-compiling to Linux ARM64
platform(
    name = "linux_arm64",
    constraint_values = [
        "@platforms//os:linux",
        "@platforms//cpu:aarch64",
    ],
    missing_toolchain_error = "No Linux ARM64 toolchain matched. Shardok ARM64 builds should pass --platforms=//:linux_arm64 and --extra_toolchains=@llvm_toolchain_linux_arm64//:cc-toolchain-aarch64-linux.",
)

gazelle(name = "gazelle")

# gazelle:proto file
# gazelle:prefix github.com/nolen777/eagle0
# gazelle:exclude .ijwb

nogo(
    name = "my_nogo",
    vet = True,
    visibility = ["//visibility:public"],
)

# Dependency constraint tests
# These verify architectural boundaries are maintained
sh_test(
    name = "build_deps_test",
    srcs = ["scripts/check_build_deps.sh"],
    args = ["--ci"],
    tags = [
        "local",  # Needs bazel query access
        "no-sandbox",
    ],
)
