yesod-mirror/MODULE.bazel

381 lines
12 KiB
Text
Raw Permalink Normal View History

###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
bazel_dep(name = "protobuf", version = "32.1", repo_name = "com_google_protobuf")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_jsonnet", version = "0.7.2")
bazel_dep(name = "jsonnet_go", version = "0.21.0")
# Define http_file and http_archive early so they can be used throughout the file
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
single_version_override(
module_name = "rules_jsonnet",
patch_strip = 1,
patches = ["//third_party/patches:rules_jsonnet_visibility.patch"],
version = "0.7.2",
)
register_toolchains("//tools/jsonnet_compiler:helm_jsonnet_toolchain")
jsonnet_deps = use_extension("//tools:jsonnet_deps.bzl", "jsonnet_deps")
use_repo(
jsonnet_deps,
"github_com_cert_manager_cert_manager",
"github_com_flatcar_flatcar_linux_update_operator",
"github_com_grafana_jsonnet_libs_ksonnet_util",
"github_com_grafana_jsonnet_libs_tanka_util",
"github_com_jsonnet_libs_docsonnet_doc_util",
"github_com_jsonnet_libs_k8s_libsonnet_1_29",
)
helm_deps = use_extension("//tools:helm_deps.bzl", "helm_deps")
use_repo(
helm_deps,
"helm_bitnami_keycloak",
"helm_bitnami_wordpress",
"helm_chroma_chromadb",
"helm_coderv2_coder",
"helm_grafana_grafana",
"helm_hashicorp_consul",
"helm_hashicorp_vault",
"helm_jaegertracing_jaeger_operator",
"helm_jetstack_cert_manager",
"helm_jetstack_trust_manager",
"helm_nvidia_gpu_operator",
"helm_prometheuscommunity_alertmanager",
"helm_prometheuscommunity_prometheus",
"helm_temporal_temporal",
"helm_crossplane_crossplane",
)
bazel_dep(name = "rules_webtesting", version = "0.4.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "rules_mypy", version = "0.40.0")
bazel_dep(name = "build_stack_rules_proto", version = "4.2.0")
bazel_dep(name = "rules_playwright", version = "0.4.0")
register_toolchains("@build_stack_rules_proto//toolchain:standard")
##############
# ASPECT LIB #
##############
bazel_dep(name = "aspect_bazel_lib", version = "2.21.1")
##################################
# QT 6 (special complicated dep) #
##################################
bazel_dep(name = "rules_qt", version = "0.0.5")
qt = use_extension("@rules_qt//extension:qt.bzl", "fetch")
qt.install(
name = "qt_linux_x86_64",
build_file = "@rules_qt//extension:qt/6.8.3/linux_x86_64.BUILD",
os = "linux",
version = "6.8.3",
)
qt.install(
name = "qt_windows_x86_64",
build_file = "@rules_qt//extension:qt/6.8.3/windows_x86_64.BUILD",
os = "windows",
version = "6.8.3",
windows_architecture = "win64_msvc2022",
)
qt.install(
name = "qt_mac_aarch64",
build_file = "@rules_qt//extension:qt/6.8.3/mac_aarch64.BUILD",
os = "macos",
version = "6.8.3",
)
use_repo(qt, "qt_linux_x86_64", "qt_mac_aarch64", "qt_windows_x86_64")
register_toolchains(
"@rules_qt//tools:all",
)
#################
# OCI & RELATED #
#################
bazel_dep(name = "rules_oci", version = "2.2.6")
# TODO: acmcarther@ - Remove if unused.
bazel_dep(
name = "container_structure_test",
version = "1.19.1",
)
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "distroless_base",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
tag = "latest",
)
use_repo(oci, "distroless_base")
oci.pull(
name = "distroless_cc",
image = "gcr.io/distroless/cc",
platforms = ["linux/amd64"],
tag = "latest",
)
use_repo(oci, "distroless_cc")
oci.pull(
name = "distroless_python3",
image = "gcr.io/distroless/python3-debian11",
platforms = ["linux/amd64"],
tag = "latest",
)
use_repo(oci, "distroless_python3")
oci.pull(
name = "python_3_11_slim",
image = "python:3.11-slim",
platforms = ["linux/amd64"],
tag = "latest",
)
use_repo(oci, "python_3_11_slim")
oci.pull(
name = "codercom_enterprise_base",
image = "docker.io/codercom/enterprise-base",
platforms = ["linux/amd64"],
# TODO
tag = "latest",
)
use_repo(oci, "codercom_enterprise_base", "codercom_enterprise_base_linux_amd64", "distroless_base_linux_amd64")
oci.pull(
name = "python_alpine",
digest = "sha256:8d8c6d3808243160605925c2a7ab2dc5c72d0e75651699b0639143613e0855b8",
image = "python:3.11-alpine",
platforms = ["linux/amd64"],
)
use_repo(oci, "distroless_python3_linux_amd64", "python_alpine", "python_alpine_linux_amd64")
oci.pull(
name = "coder_dev_base_image",
image = "forgejo.csbx.dev/acmcarther/coder-dev-base-image",
platforms = ["linux/amd64"],
tag = "4",
)
use_repo(oci, "coder_dev_base_image", "coder_dev_base_image_linux_amd64", "distroless_cc_linux_amd64", "python_3_11_slim_linux_amd64")
##############
# DISTROLESS #
##############
bazel_dep(name = "rules_distroless", version = "0.5.1")
apt = use_extension(
"@rules_distroless//apt:extensions.bzl",
"apt",
)
apt.install(
name = "noble",
lock = "//k8s/container/coder-dev-base-image:noble.lock.json",
manifest = "//k8s/container/coder-dev-base-image:noble.yaml",
)
use_repo(apt, "noble")
################
# JAVA & TOOLS #
################
bazel_dep(name = "rules_java", version = "9.3.0")
http_file(
name = "copybara_jar",
downloaded_file_path = "copybara_deploy.jar",
sha256 = "a1feedd74d85d55f5e2c965aa81d42b6bba2f8d99674453e6926c4bb0dbd8feb",
urls = ["https://github.com/google/copybara/releases/download/v20260112/copybara_deploy.jar"],
)
################
# GO & RELATED #
################
bazel_dep(
name = "rules_go",
version = "0.59.0",
)
bazel_dep(
name = "gazelle",
version = "0.47.0",
)
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.from_file(go_mod = "//:go.mod")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
# All *direct* Go dependencies of the module have to be listed explicitly.
use_repo(
go_deps,
"com_github_amikos_tech_chroma_go",
"com_github_gofrs_flock",
"com_github_google_generative_ai_go",
"com_github_google_uuid",
"com_github_gorilla_mux",
"com_github_gorilla_websocket",
"com_github_grafana_tanka",
"com_github_mholt_archiver_v3",
"com_github_modelcontextprotocol_go_sdk",
"com_github_steveyegge_gastown",
"com_github_stretchr_testify",
"in_gopkg_yaml_v3",
"io_nhooyr_websocket",
"io_temporal_go_sdk",
"org_golang_google_api",
"org_golang_google_grpc",
"org_golang_google_protobuf",
)
bazel_dep(name = "aspect_rules_js", version = "2.5.0")
bazel_dep(name = "aspect_rules_jest", version = "0.22.0")
bazel_dep(name = "aspect_rules_esbuild", version = "0.22.1")
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
bazel_dep(name = "rules_nodejs", version = "6.3.0")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "rules_pkg", version = "1.1.0")
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
)
use_repo(npm, "npm")
####################
# PYTHON & RELATED #
####################
bazel_dep(name = "rules_python", version = "1.5.3")
bazel_dep(name = "aspect_rules_py", version = "1.6.3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.12",
)
# third_party/python dependencies
pip_third_party = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip_third_party.parse(
# Required to allow pex packages to contain some dependencies
# No idea how any of that works.
enable_implicit_namespace_pkgs = True,
hub_name = "pip_third_party",
python_version = "3.12",
requirements_lock = "//third_party/python:requirements.lock",
)
use_repo(pip_third_party, "pip_third_party")
#############################
# MYPY Python Type Checking #
#############################
types = use_extension("@rules_mypy//mypy:types.bzl", "types")
types.requirements(
name = "pip_types",
pip_requirements = "@pip_third_party//:requirements.bzl",
requirements_txt = "//third_party/python:requirements.txt",
)
use_repo(types, "pip_types")
http_archive(
name = "uv_macos_aarch64",
build_file_content = """exports_files(["uv"])""",
sha256 = "89661d9a16682197086df54bb43d0b03e58e23d4d9360fc8c6c0166f2828fd71",
strip_prefix = "uv-aarch64-apple-darwin",
url = "https://github.com/astral-sh/uv/releases/download/0.9.24/uv-aarch64-apple-darwin.tar.gz",
)
http_archive(
name = "uv_linux_x86_64",
build_file_content = """exports_files(["uv"])""",
sha256 = "fb13ad85106da6b21dd16613afca910994446fe94a78ee0b5bed9c75cd066078",
strip_prefix = "uv-x86_64-unknown-linux-gnu",
url = "https://github.com/astral-sh/uv/releases/download/0.9.24/uv-x86_64-unknown-linux-gnu.tar.gz",
)
http_archive(
name = "helm_macos_aarch64",
build_file_content = """exports_files(["helm"])""",
sha256 = "a7ea99937a9679b3935fa0a2b70e577aa1ea84e5856e7c0821ca6ffa064ea976",
strip_prefix = "darwin-arm64",
url = "https://get.helm.sh/helm-v4.0.4-darwin-arm64.tar.gz",
)
http_archive(
name = "helm_linux_x86_64",
build_file_content = """exports_files(["helm"])""",
sha256 = "29454bc351f4433e66c00f5d37841627cbbcc02e4c70a6d796529d355237671c",
strip_prefix = "linux-amd64",
url = "https://get.helm.sh/helm-v4.0.4-linux-amd64.tar.gz",
)
# This is a package for spacy which includes the english lnaguage pipeline for
# text-to-speech
#
# It must be linked into packages depending on kokoro, or else we try to pip install the
# package at runtime and fail.
http_file(
name = "spacy_en_core_web_sm",
downloaded_file_path = "en_core_web_sm-3.8.0-py3-none-any.whl",
integrity = "sha256-GTJCnbcn1L/z3u1rNM/AXfF3lPSlLusmz4ko98Gg+4U=",
url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl",
)
http_file(
name = "bazelisk_linux_amd64",
downloaded_file_path = "bazelisk",
executable = True,
sha256 = "e1508323f347ad1465a887bc5d2bfb91cffc232d11e8e997b623227c6b32fb76",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-amd64"],
)
http_file(
name = "bazelisk_linux_arm64",
downloaded_file_path = "bazelisk",
executable = True,
sha256 = "bb608519a440d45d10304eb684a73a2b6bb7699c5b0e5434361661b25f113a5d",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-arm64"],
)
http_file(
name = "pnpm_linux_amd64",
downloaded_file_path = "pnpm",
executable = True,
sha256 = "2089504c90939a21d9add2a9c96fd3112d8fcc9e71306b4333f89a14ca678fd2",
urls = ["https://github.com/pnpm/pnpm/releases/download/v9.15.4/pnpm-linux-x64"],
)
http_file(
name = "pnpm_macos_arm64",
downloaded_file_path = "pnpm",
executable = True,
sha256 = "e748ba824790fcd128e27680e8f0238b28c1e6fc274c00095b9b8ae3a76495dd",
urls = ["https://github.com/pnpm/pnpm/releases/download/v9.15.4/pnpm-macos-arm64"],
)
http_file(
name = "sops_darwin_arm64",
downloaded_file_path = "sops",
executable = True,
sha256 = "a087bd505b23dceb7debf60e02f4520c16fe32b02c0253c4e52821575f5d5027",
urls = ["https://github.com/getsops/sops/releases/download/v3.9.3/sops-v3.9.3.darwin.arm64"],
)
http_file(
name = "sops_linux_amd64",
downloaded_file_path = "sops",
executable = True,
sha256 = "835ee92ef7269e1e40d69cbe5e1042975f3cd38044e8a0fa3c1a13543b7dcfaa",
urls = ["https://github.com/getsops/sops/releases/download/v3.9.3/sops-v3.9.3.linux.amd64"],
)