Open JamyDev opened 2 years ago
Problem +1 github.com/go-vgo/robotgo/key v1.0.0-beta5
Problem +1. Even with @JamyDev's patch I get an error
compilepkg: /repodir/external/com_github_go_delve_delve/pkg/proc/internal/ebpf/trace_bpfel_x86.go:125:12: could not embed trace_bpfel_x86.o: no matching files found
Target @com_github_go_delve_delve//pkg/proc/native:native failed to build
From my understanding, it seems like Gazelle's official strategy here is to either manually add BUILD files or patch the resulting BUILD files to accept a cc_library rule containing the header and object. Though the easiest thing would be if Delve added Bazel support.
@FastNav did you get it figured out, was there a different patch needed for later dlv
versions? If so, please share for future folks that run into this.
for the record, you can also just knock out the ebpf code and force the fallback, as used on all platforms that arent x86_64 linux- here's the patch i apply in delve's go_repository
entry
diff --git a/pkg/proc/internal/ebpf/helpers.go b/pkg/proc/internal/ebpf/helpers.go
index d9b5e7df..9c0039bb 100644
--- a/pkg/proc/internal/ebpf/helpers.go
+++ b/pkg/proc/internal/ebpf/helpers.go
@@ -1,5 +1,5 @@
-//go:build linux && amd64 && go1.16
-// +build linux,amd64,go1.16
+//go:build dummy
+// +build dummy
package ebpf
diff --git a/pkg/proc/internal/ebpf/helpers_disabled.go b/pkg/proc/internal/ebpf/helpers_disabled.go
index 66d18c52..bdb88e69 100644
--- a/pkg/proc/internal/ebpf/helpers_disabled.go
+++ b/pkg/proc/internal/ebpf/helpers_disabled.go
@@ -1,6 +1,3 @@
-//go:build !linux || !amd64 || !go1.16
-// +build !linux !amd64 !go1.16
-
package ebpf
import (
What version of gazelle are you using?
6bbfc47f1b0a27ee1efeddcc6671f3e4e03235dc
What version of rules_go are you using?
v0.30.0
What version of Bazel are you using?
4.2.2
Does this issue reproduce with the latest releases of all the above?
Likely
What operating system and processor architecture are you using?
MacOS 12.2
What did you do?
Installing
github.com/go-delve/delve@v1.7.3
(and later) and then running Gazelle to generate the build files for the dependency, gazelle will fail to includebpf/include/function_vals.bpf.h
in the srcs for github.com/go-delve/delve/pkg/proc/internal/ebpfThe h file is referenced as a # include in
helpers.go
of that same package, so it should be possible to reference that for an auto import.What did you expect to see?
BUILD.bazel for bpf package srcs include the necessary .h file
What did you see instead?
BUILD file for this dir:
Current workaround:
The following patch added to out
@com_github_go_delve_delve
repository (-p1
)