| load("@bazel_gazelle//:def.bzl", "gazelle") |
| load("@io_bazel_rules_go//go:def.bzl", "go_path") |
| load("@bazeldnf//:def.bzl", "bazeldnf") |
| |
| # gazelle:prefix source.monogon.dev |
| # gazelle:go_naming_convention import |
| # gazelle:exclude **/gomod-generated-placeholder.go |
| # gazelle:exclude .bazeldnf/** |
| gazelle(name = "gazelle") |
| |
| gazelle( |
| name = "gazelle-update-repos", |
| args = [ |
| "-from_file=go.mod", |
| "-to_macro=third_party/go/repositories.bzl%go_repositories", |
| "-prune", |
| ], |
| command = "update-repos", |
| ) |
| |
| # Shortcut for the Go SDK |
| alias( |
| name = "go", |
| actual = "@go_sdk//:bin/go", |
| visibility = ["//visibility:public"], |
| ) |
| |
| load("@rules_python//python:defs.bzl", "py_runtime_pair") |
| |
| # Python toolchains - just use the host python for now. |
| # TODO(T649): move to external (nix?) interpreters. |
| py_runtime( |
| name = "host_python3", |
| interpreter_path = "/usr/bin/python3", |
| python_version = "PY3", |
| # Necessary on NixOS, as the nixpkgs-packaged Bazel has this overriden to |
| # the local /nix/store. |
| stub_shebang = "#!/usr/bin/python3", |
| ) |
| |
| py_runtime( |
| name = "host_python2", |
| interpreter_path = "/usr/bin/python2", |
| python_version = "PY2", |
| stub_shebang = "#!/usr/bin/python2", |
| ) |
| |
| py_runtime_pair( |
| name = "host_python_pair", |
| py2_runtime = ":host_python2", |
| py3_runtime = ":host_python3", |
| ) |
| |
| toolchain( |
| name = "host_python", |
| toolchain = ":host_python_pair", |
| toolchain_type = "@rules_python//python:toolchain_type", |
| ) |
| |
| # bazeldnf binary |
| bazeldnf(name = "bazeldnf") |
| |
| # Shortcuts for top-level binaries/tools |
| |
| # Shortcut for kubectl when running through bazel run |
| # (don't depend on this, it might turn into an env-based PATH shortcut, use |
| # @io_k8s_kubernetes//cmd/kubectl instead) |
| alias( |
| name = "kubectl", |
| actual = "@io_k8s_kubernetes//cmd/kubectl:kubectl", |
| ) |
| |
| # Shortcut for the Delve debugger for interactive debugging |
| alias( |
| name = "dlv", |
| actual = "@com_github_go_delve_delve//cmd/dlv:dlv", |
| ) |
| |
| # Shortcut for launching a single Metropolis node instance in a VM. |
| test_suite( |
| name = "launch", |
| tags = ["manual"], |
| tests = [ |
| "//metropolis/test/launch/cli/launch", |
| ], |
| ) |
| |
| # Shortcut for launching a virtual network a Metropolis cluster consisting of two nodes. |
| test_suite( |
| name = "launch-multi2", |
| tags = ["manual"], |
| tests = [ |
| "//metropolis/test/launch/cli/launch-multi2", |
| ], |
| ) |
| |
| alias( |
| name = "metroctl", |
| actual = "//metropolis/cli/metroctl:metroctl", |
| ) |
| |
| alias( |
| name = "goimports", |
| actual = "@org_golang_x_tools//cmd/goimports:goimports", |
| visibility = ["//visibility:public"], |
| ) |