[bug#54335,09/14] gnu: Add go-github-com-vishvananda-netns.
Commit Message
* gnu/packages/golang.scm (go-github-com-vishvananda-netns): New variable.
---
gnu/packages/golang.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
Comments
Dominic Martinez schreef op do 10-03-2022 om 22:18 [-0500]:
> + (arguments '(#:tests? #f ; Tests require root privileges
Is this still the case? Nowadays, some namespace stuff can be done
without root.
Greetings,
Maxime.
Dominic Martinez schreef op do 10-03-2022 om 22:18 [-0500]:
> * gnu/packages/golang.scm (go-github-com-vishvananda-netns): New variable.
This is already packaged in Guix (go-netns).
Greetings,
Maxime.
Maxime Devos <maximedevos@telenet.be> writes:
> This is already packaged in Guix (go-netns).
This and netlink were my bad; thank you for pointing that out!
@@ -9955,3 +9955,33 @@ (define-public go-github-com-songgao-water
library for Go that efficiently works with standard packages like io, bufio,
etc.. Use waterutil with it to work with TUN/TAP packets/frames.")
(license license:bsd-3)))
+
+(define-public go-github-com-vishvananda-netns
+ (package
+ (name "go-github-com-vishvananda-netns")
+ (version "0.0.0-20211101163701-50045581ed74")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/vishvananda/netns")
+ (commit (go-version->git-ref version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0kam780m036mk77fmc0w0z6qz4b5awkllcd1dps71zd1n82mr407"))))
+ (build-system go-build-system)
+ (arguments '(#:tests? #f ; Tests require root privileges
+ #:import-path "github.com/vishvananda/netns"))
+ (native-inputs
+ (list go-golang-org-x-sys))
+ (home-page "https://github.com/vishvananda/netns")
+ (synopsis "Simple network namespace handling for Go")
+ (description
+ "Package netns allows ultra-simple network namespace handling. NsHandles can be
+retrieved and set. Note that the current namespace is thread local so actions
+that set and reset namespaces should use LockOSThread to make sure the namespace
+doesn't change due to a goroutine switch. It is best to close NsHandles when
+you are done with them. This can be accomplished via a `defer ns.Close()` on
+the handle. Changing namespaces requires elevated privileges, so in most cases
+this code needs to be run as root.")
+ (license license:asl2.0)))