blob: 759a9b8b9d7a67039535fab48d1c892445f1c173 [file] [log] [blame]
Leopold Schabel5c80aca2019-10-22 15:48:58 +02001load("@bazel_gazelle//:def.bzl", "gazelle")
Serge Bazanskif369cfa2020-05-22 18:36:42 +02002load("//build/fietsje:def.bzl", "fietsje")
Leopold Schabeleff72172020-01-04 15:07:52 +01003load("@io_bazel_rules_go//go:def.bzl", "go_path", "nogo")
Leopold Schabel5c80aca2019-10-22 15:48:58 +02004
Serge Bazanski31370b02021-01-07 16:31:14 +01005# gazelle:prefix source.monogon.dev
Serge Bazanskif12bedf2021-01-15 16:58:50 +01006# gazelle:go_naming_convention go_default_library
7# gazelle:go_naming_convention_external go_default_library
Leopold Schabel5c80aca2019-10-22 15:48:58 +02008gazelle(name = "gazelle")
Leopold Schabeld868d692019-11-17 17:28:29 +01009
Serge Bazanskif369cfa2020-05-22 18:36:42 +020010fietsje(name = "fietsje")
11
Leopold Schabeld868d692019-11-17 17:28:29 +010012# Shortcut for the Go SDK
13alias(
14 name = "go",
15 actual = "@go_sdk//:bin/go",
Leopold Schabela4516f92019-12-04 20:27:05 +000016 visibility = ["//visibility:public"],
17)
18
Leopold Schabel60a85b62019-11-17 19:12:41 +010019# nogo linters
20nogo(
21 name = "nogo_vet",
22 config = "nogo_config.json",
23 visibility = ["//visibility:public"],
24 # These deps enable the analyses equivalent to running `go vet`.
25 # Passing vet = True enables only a tiny subset of these (the ones
26 # that are always correct).
27 #
28 # You can see the what `go vet` does by running `go doc cmd/vet`.
29 deps = [
30 "@org_golang_x_tools//go/analysis/passes/asmdecl:go_tool_library",
31 "@org_golang_x_tools//go/analysis/passes/assign:go_tool_library",
32 "@org_golang_x_tools//go/analysis/passes/atomic:go_tool_library",
33 "@org_golang_x_tools//go/analysis/passes/bools:go_tool_library",
34 "@org_golang_x_tools//go/analysis/passes/buildtag:go_tool_library",
Hendrik Hofstadt4ff52bd2020-01-12 15:21:49 +010035 # Disable cgocall because it fails processing com_github_mattn_go_sqlite3 before exclusions are applied
36 #"@org_golang_x_tools//go/analysis/passes/cgocall:go_tool_library",
Leopold Schabel60a85b62019-11-17 19:12:41 +010037 "@org_golang_x_tools//go/analysis/passes/composite:go_tool_library",
38 "@org_golang_x_tools//go/analysis/passes/copylock:go_tool_library",
39 "@org_golang_x_tools//go/analysis/passes/httpresponse:go_tool_library",
40 "@org_golang_x_tools//go/analysis/passes/loopclosure:go_tool_library",
41 "@org_golang_x_tools//go/analysis/passes/lostcancel:go_tool_library",
42 "@org_golang_x_tools//go/analysis/passes/nilfunc:go_tool_library",
43 "@org_golang_x_tools//go/analysis/passes/printf:go_tool_library",
44 "@org_golang_x_tools//go/analysis/passes/shift:go_tool_library",
45 "@org_golang_x_tools//go/analysis/passes/stdmethods:go_tool_library",
46 "@org_golang_x_tools//go/analysis/passes/structtag:go_tool_library",
47 "@org_golang_x_tools//go/analysis/passes/tests:go_tool_library",
48 "@org_golang_x_tools//go/analysis/passes/unmarshal:go_tool_library",
49 "@org_golang_x_tools//go/analysis/passes/unreachable:go_tool_library",
50 "@org_golang_x_tools//go/analysis/passes/unsafeptr:go_tool_library",
51 "@org_golang_x_tools//go/analysis/passes/unusedresult:go_tool_library",
52 ],
53)
Serge Bazanski7a1b10c2020-02-11 10:02:21 +010054
55load("@rules_python//python:defs.bzl", "py_runtime_pair")
56
57# Python toolchains - just use the host python for now.
58# TODO(T649): move to external (nix?) interpreters.
59py_runtime(
60 name = "host_python3",
61 interpreter_path = "/usr/bin/python3",
62 python_version = "PY3",
63)
64
65py_runtime(
66 name = "host_python2",
67 interpreter_path = "/usr/bin/python2",
68 python_version = "PY2",
69)
70
71py_runtime_pair(
72 name = "host_python_pair",
73 py2_runtime = ":host_python2",
74 py3_runtime = ":host_python3",
75)
76
77toolchain(
78 name = "host_python",
79 toolchain = ":host_python_pair",
80 toolchain_type = "@rules_python//python:toolchain_type",
81)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010082
Leopold Schabel26d41992020-12-15 19:27:58 +010083# Shortcuts for top-level binaries/tools
84
Serge Bazanski2fb13a82020-02-11 12:41:37 +010085# Shortcut for kubectl when running through bazel run
86# (don't depend on this, it might turn into an env-based PATH shortcut, use
Serge Bazanskibb7db922020-04-30 12:43:10 +020087# @io_k8s_kubernetes//cmd/kubectl instead)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010088alias(
89 name = "kubectl",
Serge Bazanskibb7db922020-04-30 12:43:10 +020090 actual = "@io_k8s_kubernetes//cmd/kubectl:kubectl",
Serge Bazanski2fb13a82020-02-11 12:41:37 +010091)
Leopold Schabel3058b7a2020-06-03 17:51:07 +020092
93# Shortcut for the Delve debugger for interactive debugging
94alias(
95 name = "dlv",
96 actual = "@com_github_go_delve_delve//cmd/dlv:dlv",
97)
Lorenz Brunfc5dbc62020-05-28 12:18:07 +020098
Serge Bazanski662b5b32020-12-21 13:49:00 +010099# Shortcut for launching a single Metropolis node instance in a VM.
Lorenz Brunfc5dbc62020-05-28 12:18:07 +0200100alias(
101 name = "launch",
Serge Bazanski77cb6c52020-12-19 00:09:22 +0100102 actual = "//metropolis/test/launch/cli/launch",
Lorenz Brunfc5dbc62020-05-28 12:18:07 +0200103)
Lorenz Brun52f7f292020-06-24 16:42:02 +0200104
Serge Bazanski662b5b32020-12-21 13:49:00 +0100105# Shortcut for launching a virtual network a Metropolis cluster consisting of two nodes.
Lorenz Brun52f7f292020-06-24 16:42:02 +0200106alias(
107 name = "launch-multi2",
Serge Bazanski77cb6c52020-12-19 00:09:22 +0100108 actual = "//metropolis/test/launch/cli/launch-multi2",
Lorenz Brun52f7f292020-06-24 16:42:02 +0200109)
Leopold Schabel26d41992020-12-15 19:27:58 +0100110
111alias(
112 name = "goimports",
113 actual = "@org_golang_x_tools//cmd/goimports:goimports",
114 visibility = ["//visibility:public"],
115)