build: add fietsje config and alias for Delve debugger
Test Plan: Debugged a running process using `bazel run :dlv`.
X-Origin-Diff: phab/D550
GitOrigin-RevId: 3bea727afc0cc275fac19238067d871c42beef19
diff --git a/BUILD b/BUILD
index 8da7909..c188aa9 100644
--- a/BUILD
+++ b/BUILD
@@ -85,3 +85,9 @@
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",
+)
diff --git a/build/fietsje/BUILD.bazel b/build/fietsje/BUILD.bazel
index 4a5d3fb..70b6639 100644
--- a/build/fietsje/BUILD.bazel
+++ b/build/fietsje/BUILD.bazel
@@ -6,6 +6,7 @@
"dependency.go",
"deps_cilium.go",
"deps_containerd.go",
+ "deps_delve.go",
"deps_gvisor.go",
"deps_kubernetes.go",
"deps_sqlboiler.go",
diff --git a/build/fietsje/deps_delve.go b/build/fietsje/deps_delve.go
new file mode 100644
index 0000000..747f3e2
--- /dev/null
+++ b/build/fietsje/deps_delve.go
@@ -0,0 +1,27 @@
+// Copyright 2020 The Monogon Project Authors.
+//
+// SPDX-License-Identifier: Apache-2.0
+//
+// 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.
+
+package main
+
+func depsDelve(p *planner) {
+ p.collect("github.com/go-delve/delve", "v1.4.1").use(
+ "github.com/google/go-dap",
+ "github.com/peterh/liner",
+ "github.com/cosiner/argv",
+ "golang.org/x/arch",
+ "go.starlark.net",
+ )
+}
diff --git a/build/fietsje/main.go b/build/fietsje/main.go
index 7aa020b..875d5f7 100644
--- a/build/fietsje/main.go
+++ b/build/fietsje/main.go
@@ -96,6 +96,9 @@
// used by deltagen
p.collectOverride("github.com/lyft/protoc-gen-star", "v0.4.14")
+ // for interactive debugging during development (//:dlv alias)
+ depsDelve(p)
+
// First generate the repositories starlark rule into memory. This is because rendering will lock all unlocked
// dependencies, which might take a while. If a use were to interrupt it now, they would end up with an incomplete
// repositories.bzl and would have to restore from git.
diff --git a/nogo_config.json b/nogo_config.json
index 4fa0397..01e7d7c 100644
--- a/nogo_config.json
+++ b/nogo_config.json
@@ -55,7 +55,8 @@
"external/com_github_modern_go_reflect2/": "third_party",
"sqlite3.*go": "third_party",
"external/com_github_google_gvisor/": "third_party",
- "external/io_k8s_sigs_structured_merge_diff/": "third_party"
+ "external/io_k8s_sigs_structured_merge_diff/": "third_party",
+ "external/com_github_go_delve_delve/": "third_party"
}
},
"unusedresult": {
diff --git a/third_party/go/repositories.bzl b/third_party/go/repositories.bzl
index 8cadef1..32d2ffe 100644
--- a/third_party/go/repositories.bzl
+++ b/third_party/go/repositories.bzl
@@ -343,6 +343,12 @@
sum = "h1:n2Ltr3SrfQlf/9nOna1DoGKxLx3qTSI8Ttl6Xrqp6mw=",
)
go_repository(
+ name = "com_github_cosiner_argv",
+ importpath = "github.com/cosiner/argv",
+ version = "v0.0.0-20170225145430-13bacc38a0a5",
+ sum = "h1:rIXlvz2IWiupMFlC45cZCXZFvKX/ExBcSLrDy2G0Lp8=",
+ )
+ go_repository(
name = "com_github_cpuguy83_go_md2man",
importpath = "github.com/cpuguy83/go-md2man",
version = "v1.0.10",
@@ -505,6 +511,12 @@
sum = "h1:p1FS4Qf4pgi/ntt4XI1n1rM7EAmOQLRmvPYNXtNlxWA=",
)
go_repository(
+ name = "com_github_go_delve_delve",
+ importpath = "github.com/go-delve/delve",
+ version = "v1.4.1",
+ sum = "h1:kZs0umEv+VKnK84kY9/ZXWrakdLTeRTyYjFdgLelZCQ=",
+ )
+ go_repository(
name = "com_github_go_openapi_analysis",
importpath = "github.com/go-openapi/analysis",
version = "v0.19.5",
@@ -649,6 +661,12 @@
sum = "h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=",
)
go_repository(
+ name = "com_github_google_go_dap",
+ importpath = "github.com/google/go-dap",
+ version = "v0.2.0",
+ sum = "h1:whjIGQRumwbR40qRU7CEKuFLmePUUc2s4Nt9DoXXxWk=",
+ )
+ go_repository(
name = "com_github_google_go_tpm",
importpath = "github.com/google/go-tpm",
version = "v0.1.2-0.20190725015402-ae6dd98980d4",
@@ -1103,6 +1121,12 @@
sum = "h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=",
)
go_repository(
+ name = "com_github_peterh_liner",
+ importpath = "github.com/peterh/liner",
+ version = "v0.0.0-20170317030525-88609521dc4b",
+ sum = "h1:8uaXtUkxiy+T/zdLWuxa/PG4so0TPZDZfafFNNSaptE=",
+ )
+ go_repository(
name = "com_github_petermattis_goid",
importpath = "github.com/petermattis/goid",
version = "v0.0.0-20180202154549-b0b1615b78e5",
@@ -1386,6 +1410,12 @@
sum = "h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4=",
)
go_repository(
+ name = "net_starlark_go",
+ importpath = "go.starlark.net",
+ version = "v0.0.0-20190702223751-32f345186213",
+ sum = "h1:lkYv5AKwvvduv5XWP6szk/bvvgO6aDeUujhZQXIFTes=",
+ )
+ go_repository(
name = "org_uber_go_atomic",
importpath = "go.uber.org/atomic",
version = "v1.3.2",
@@ -1404,6 +1434,12 @@
sum = "h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM=",
)
go_repository(
+ name = "org_golang_x_arch",
+ importpath = "golang.org/x/arch",
+ version = "v0.0.0-20190927153633-4e8777c89be4",
+ sum = "h1:QlVATYS7JBoZMVaf+cNjb90WD/beKVHnIxFKT4QaHVI=",
+ )
+ go_repository(
name = "org_golang_x_crypto",
importpath = "golang.org/x/crypto",
version = "v0.0.0-20200128174031-69ecbb4d6d5d",
diff --git a/third_party/go/shelf.pb.text b/third_party/go/shelf.pb.text
index 1673d67..99755c8 100644
--- a/third_party/go/shelf.pb.text
+++ b/third_party/go/shelf.pb.text
@@ -391,6 +391,13 @@
semver: "v0.0.0-20180108230652-97fdf19511ea"
>
entry: <
+ import_path: "github.com/cosiner/argv"
+ version: "v0.0.0-20170225145430-13bacc38a0a5"
+ bazel_name: "com_github_cosiner_argv"
+ sum: "h1:rIXlvz2IWiupMFlC45cZCXZFvKX/ExBcSLrDy2G0Lp8="
+ semver: "v0.0.0-20170225145430-13bacc38a0a5"
+>
+entry: <
import_path: "github.com/cpuguy83/go-md2man"
version: "7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19"
bazel_name: "com_github_cpuguy83_go_md2man"
@@ -587,6 +594,13 @@
semver: "v4.0.0-20200507103349-d540ee52783e"
>
entry: <
+ import_path: "github.com/go-delve/delve"
+ version: "v1.4.1"
+ bazel_name: "com_github_go_delve_delve"
+ sum: "h1:kZs0umEv+VKnK84kY9/ZXWrakdLTeRTyYjFdgLelZCQ="
+ semver: "v1.4.1"
+>
+entry: <
import_path: "github.com/go-openapi/analysis"
version: "v0.19.5"
bazel_name: "com_github_go_openapi_analysis"
@@ -755,6 +769,13 @@
semver: "v0.4.0"
>
entry: <
+ import_path: "github.com/google/go-dap"
+ version: "v0.2.0"
+ bazel_name: "com_github_google_go_dap"
+ sum: "h1:whjIGQRumwbR40qRU7CEKuFLmePUUc2s4Nt9DoXXxWk="
+ semver: "v0.2.0"
+>
+entry: <
import_path: "github.com/google/go-tpm"
version: "ae6dd98980d4"
bazel_name: "com_github_google_go_tpm"
@@ -1329,6 +1350,13 @@
semver: "v2.0.1+incompatible"
>
entry: <
+ import_path: "github.com/peterh/liner"
+ version: "v0.0.0-20170317030525-88609521dc4b"
+ bazel_name: "com_github_peterh_liner"
+ sum: "h1:8uaXtUkxiy+T/zdLWuxa/PG4so0TPZDZfafFNNSaptE="
+ semver: "v0.0.0-20170317030525-88609521dc4b"
+>
+entry: <
import_path: "github.com/petermattis/goid"
version: "v0.0.0-20180202154549-b0b1615b78e5"
bazel_name: "com_github_petermattis_goid"
@@ -1672,6 +1700,13 @@
semver: "v0.22.0"
>
entry: <
+ import_path: "go.starlark.net"
+ version: "v0.0.0-20190702223751-32f345186213"
+ bazel_name: "net_starlark_go"
+ sum: "h1:lkYv5AKwvvduv5XWP6szk/bvvgO6aDeUujhZQXIFTes="
+ semver: "v0.0.0-20190702223751-32f345186213"
+>
+entry: <
import_path: "go.uber.org/atomic"
version: "v1.3.2"
bazel_name: "org_uber_go_atomic"
@@ -1700,6 +1735,13 @@
semver: "v1.15.0"
>
entry: <
+ import_path: "golang.org/x/arch"
+ version: "v0.0.0-20190927153633-4e8777c89be4"
+ bazel_name: "org_golang_x_arch"
+ sum: "h1:QlVATYS7JBoZMVaf+cNjb90WD/beKVHnIxFKT4QaHVI="
+ semver: "v0.0.0-20190927153633-4e8777c89be4"
+>
+entry: <
import_path: "golang.org/x/crypto"
version: "69ecbb4d6d5dab05e49161c6e77ea40a030884e1"
bazel_name: "org_golang_x_crypto"