Bug 207567
Summary: | Go package for libcap is not "go get"-able and not a module | ||
---|---|---|---|
Product: | Tools | Reporter: | thediveo |
Component: | libcap | Assignee: | Andrew G. Morgan (morgan) |
Status: | RESOLVED CODE_FIX | ||
Severity: | enhancement | CC: | kernel, morgan |
Priority: | P4 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 5.3.0 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
thediveo
2020-05-03 21:01:56 UTC
As of the present time, the way the packages are built is dependent on whether or not you are running a golang build with or without https://go-review.googlesource.com/c/go/+/210639/ applied (ie., with cgo-less support for capabilities). I don't plan to pursue go get support until I have an official golang version number to key this kind of build dependency off. If anyone wants to offer a patch, we can see where that gets us. I'm exploring support for this. It looks as if my Go runtime patch (see Comment 1) is not to being included in go1.15, so I'm exploring other ways to conditionally build the non-CGo support - likely a dev build tag or somesuch. As a first step, I'm going to attempt to modularize the CGo "psx" package. This is mt first commit towards that effort: https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=a3e844af8976dc7397f272eade1bb609050220eb Plenty of unknowns for me in this effort. Numerous attempts later. This should be fixed in libcap-2.37. Go module release v0.2.37. The official import paths for the "cap" and the "psx" packages are: "kernel.org/pub/linux/libs/security/libcap/cap" "kernel.org/pub/linux/libs/security/libcap/psx" Note, for go build tools prior to go1.15beta1, you will need to manually supply: export CGO_LDFLAGS_ALLOW="-Wl,-?-wrap[=,][^-.@][^,]*" To be able to build the "psx" package, which is needed for the "cap" package since Go does not yet include this patch: https://go-review.googlesource.com/c/go/+/210639 or anything equivalent to it. If you want to explore building with a Go toolchain including that patch, please report issues or success via: https://github.com/golang/go/issues/1435 Building the "cap" package against such a Go toolchain currently requires CGO_ENABLE=0 go build -tags allthreadssyscall ... to coax the "cap" package into not requiring CGo. |