Can not build aur/opensnitch(-git) on Manjaro · evilsocket/opensnitch · Discussion #768 (original) (raw)
Hi,
I was trying to update opensnitch (aur/opensnitch-git) on Manjaro but the build always fails.
I used it for almost one year and updated it successfully in the past multiple times, but now it won't build any more.
I've removed the opensnitch-git version and tried the aur/opensnitch version instead but it leads to the same error.
I get the following errors and don't know how to address this as I'm not familiar with the go build system.
==> Making package: opensnitch 1.5.2-1 (Fr 11 Nov 2022 22:58:47 CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
go: downloading github.com/golang/protobuf v1.5.2
go: downloading google.golang.org/protobuf v1.26.0
# github.com/golang/protobuf/protoc-gen-go
loadinternal: cannot find runtime/cgo
go: downloading google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
go: downloading google.golang.org/grpc v1.50.1
go: downloading google.golang.org/protobuf v1.27.1
# google.golang.org/grpc/cmd/protoc-gen-go-grpc
loadinternal: cannot find runtime/cgo
protoc-gen-go: /home/phk/.cache/yay/opensnitch/src/gopath/bin/protoc-gen-go
protoc-gen-go-grpc: /home/phk/.cache/yay/opensnitch/src/gopath/bin/protoc-gen-go-grpc
~/.cache/yay/opensnitch/src/opensnitch-1.5.2/proto ~/.cache/yay/opensnitch/src/opensnitch-1.5.2
protoc -I. ui.proto --go_out=../daemon/ui/protocol/ --go-grpc_out=../daemon/ui/protocol/ --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative
python3 -m grpc_tools.protoc -I. --python_out=../ui/opensnitch/ --grpc_python_out=../ui/opensnitch/ ui.proto
~/.cache/yay/opensnitch/src/opensnitch-1.5.2
~/.cache/yay/opensnitch/src/opensnitch-1.5.2/daemon ~/.cache/yay/opensnitch/src/opensnitch-1.5.2
go: downloading github.com/google/gopacket v1.1.14
go: downloading github.com/vishvananda/netlink v0.0.0-20210811191823-e1a867c6b452
go: downloading github.com/fsnotify/fsnotify v1.4.7
go: downloading golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271
go: downloading google.golang.org/grpc v1.32.0
go: downloading github.com/iovisor/gobpf v0.2.0
go: downloading github.com/evilsocket/ftrace v1.2.0
go: downloading github.com/google/nftables v0.0.0-20210514154851-a285acebcad3
go: downloading golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1
go: downloading github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae
go: downloading google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
go: downloading github.com/mdlayher/netlink v0.0.0-20191009155606-de872b0d824b
go: downloading github.com/koneu/natend v0.0.0-20150829182554-ec0926ea948d
go: downloading github.com/golang/protobuf v1.5.0
go: downloading golang.org/x/text v0.3.0
# github.com/evilsocket/opensnitch/daemon/netfilter
cgo-gcc-prolog: In function ‘_cgo_aceefaf8538a_Cfunc_stop_reading_packets’:
cgo-gcc-prolog:451:49: warning: unused variable ‘_cgo_a’ [-Wunused-variable]
# github.com/iovisor/gobpf/elf
cgo: cannot load DWARF output from $WORK/b084//_cgo_.o: zlib: invalid header
make: *** [Makefile:16: opensnitchd] Error 2
==> ERROR: A failure occurred in build().
Aborting...
-> error making: opensnitch
I think I had a similar error in the past, but unfortunately can not remember what the solution actually was.
Any help is highly appreciated.
Thanks in advance.
You must be logged in to vote
hey @0xphk , honestly, no idea why it's failing. It looks like something is not right with the Go installation?loadinternal: cannot find runtime/cgo and zlib: invalid header
what's your $ go env output?
You must be logged in to vote
10 replies
I have another question, I noticed that I need root privileges when I try to remove the cloned repo in my standard user account in ~/.cache/yay/opensnitch(-git).
There are a lot of directories in this path with permissions 0555 dr-xr-xr-x or even 0111 d--x--x--x which is very weird and I'm sure this isn't intended, or is it?
This leads also to be unable to reinstall or cleanbuild the package as it throws tons of permission denied errors.
Can somebody please check that the perms are wrong too? This is the same on both my running system and a newly setup vm.~/.cache/yay/opensnitch/ $ sudo find -type d -not -perm 0755 or~/.cache/yay/opensnitch/ $ sudo find -type d -perm 0555 or~/.cache/yay/opensnitch/ $ sudo find -type d -perm 0111
VM did end up with the same error on Go 1.19.3 and unable to build.
Did some more testing and can now confirm that building works if I use the latest Go 1.18 versiongo version go1.18.8 linux/amd64.
The loadinternal: cannot find runtime/cgo message is still there but thecgo: cannot load DWARF output from $WORK/b084//_cgo_.o: zlib: invalid header error isn't shown and compiling works.
So far a workaround for me is to extract the Go 1.18 release somewhere and put it in $PATH before the newer/systemwide go binary location.
Can you please take a look at the directory permissions?
There are a lot of directories in this path with permissions 0555 dr-xr-xr-x or even 0111 d--x--x--x
~ $ sudo find .cache/yay/opensnitch -type d -perm 0555 ~ $ sudo find .cache/yay/opensnitch -type d -not -perm 0755 ~ $ sudo find .cache/yay/opensnitch -type d -perm 0111 ~ $
everything seems normal here.
That's strange, could confirm this on 3 different Manjaro systems but only for aur/opensnitch-git,
I switched to aur/opensnitch and there is not problem so I stick to this.
EDIT: With the now working Go 1.18.8 build, the permission problems are also gone, so I expect it must have had something to do with the interrupted build process, leaving some directories in some strange state.
In any case, thanks for the help.