[libnbd PATCH] golang: Bump minimum Go version to 1.17
by Eric Blake
Go 1.17 or newer is required to use unsafe.Slice(), which in turn
allows us to write a simpler conversion from a C array to a Go object
during callbacks.
To check if this makes sense, look at
https://repology.org/project/go/versions compared to our list in
ci/manifest.yml, at the time I made this commit:
Alpine 3.15: 1.17.10
AlmaLinux 8: 1.19.10
CentOS Stream 8: 1.20.4
Debian 10: 1.11.6
Debian 11: 1.15.15 (mainline), 1.19.8 (backports)
Debian 12: 1.19.8
Fedoar 36: 1.19.8
FreeBSD Ports: 1.20.7
OpenSUSE Leap 15.3: 1.16.3
OpenSUSE Leap 15.4: 1.18.1
Ubuntu 18.04: 1.18.1
We previously required a minimum of 1.13 for module support, which
means Debian 10 was already not supporting Go bindings. OpenSUSE Leap
15.3 loses support, but is relatively old these days. All other
systems appear unaffected by this bump in requirements, at least if
they can be configured to use developer backports.
Suggested-by: Nir Soffer <nsoffer(a)redhat.com>
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
This replaces
https://listman.redhat.com/archives/libguestfs/2023-August/032227.html
generator/GoLang.ml | 8 ++++----
README.md | 2 +-
golang/configure/go.mod | 4 ++--
golang/configure/test.go | 11 +++++++++++
golang/go.mod | 4 ++--
5 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/generator/GoLang.ml b/generator/GoLang.ml
index 73df5254..55ff1b8a 100644
--- a/generator/GoLang.ml
+++ b/generator/GoLang.ml
@@ -517,10 +517,10 @@ let
func copy_uint32_array(entries *C.uint32_t, count C.size_t) []uint32 {
ret := make([]uint32, int(count))
- // See https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices
- // TODO: Use unsafe.Slice() when we require Go 1.17.
- s := (*[1 << 30]uint32)(unsafe.Pointer(entries))[:count:count]
- copy(ret, s)
+ s := unsafe.Slice(entries, count)
+ for i, item := range s {
+ ret[i] = uint32(item)
+ }
return ret
}
";
diff --git a/README.md b/README.md
index c7166613..8524038e 100644
--- a/README.md
+++ b/README.md
@@ -105,7 +105,7 @@ ## Building from source
* Python >= 3.3 to build the Python 3 bindings and NBD shell (nbdsh).
* FUSE 3 to build the nbdfuse program.
* Linux >= 6.0 and ublksrv library to build nbdublk program.
-* go and cgo, for compiling the golang bindings and tests.
+* go and cgo >= 1.17, for compiling the golang bindings and tests.
* bash-completion >= 1.99 for tab completion.
Optional, only needed to run the test suite:
diff --git a/golang/configure/go.mod b/golang/configure/go.mod
index ce3e4f39..fcdb28db 100644
--- a/golang/configure/go.mod
+++ b/golang/configure/go.mod
@@ -1,4 +1,4 @@
module libguestfs.org/configure
-// First version of golang with working module support.
-go 1.13
+// First version of golang with working module support and unsafe.Slice.
+go 1.17
diff --git a/golang/configure/test.go b/golang/configure/test.go
index fe742f2b..a15c9ea3 100644
--- a/golang/configure/test.go
+++ b/golang/configure/test.go
@@ -25,8 +25,19 @@
import (
"fmt"
"runtime"
+ "unsafe"
)
+func check_slice(arr *uint32, cnt int) []uint32 {
+ /* We require unsafe.Slice(), introduced in 1.17 */
+ ret := make([]uint32, cnt)
+ s := unsafe.Slice(arr, cnt)
+ for i, item := range s {
+ ret[i] = uint32(item)
+ }
+ return ret
+}
+
func main() {
fmt.Println(runtime.Version())
diff --git a/golang/go.mod b/golang/go.mod
index fc772840..1b72e77d 100644
--- a/golang/go.mod
+++ b/golang/go.mod
@@ -1,4 +1,4 @@
module libguestfs.org/libnbd
-// First version of golang with working module support.
-go 1.13
+// First version of golang with working module support and unsafe.Slice.
+go 1.17
--
2.41.0
1 year, 3 months
[libnbd PATCH] ci: Update lcitool to request cargo during CI
by Eric Blake
Regenerate the CI build scripts with:
../libvirt-ci/bin/lcitool manifest ci/manifest.yml
using libvirt-ci bumped with a pending patch:
https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/424
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
CI is still not green, but I've been working on it today. I'm
currently waiting for a merge request to lcitool to land, if that
happens quickly, I can rework this commit message. I'm also playing
with pushing this patch to a forked repo, to see how it fares, before
sending it to the main repo.
ci/buildenv/almalinux-8.sh | 2 ++
ci/buildenv/alpine-317.sh | 2 ++
ci/buildenv/alpine-318.sh | 2 ++
ci/buildenv/alpine-edge.sh | 2 ++
ci/buildenv/centos-stream-8.sh | 2 ++
ci/buildenv/debian-11-cross-i686.sh | 2 ++
ci/buildenv/debian-11.sh | 2 ++
ci/buildenv/debian-12-cross-i686.sh | 2 ++
ci/buildenv/debian-12.sh | 2 ++
ci/buildenv/debian-sid.sh | 2 ++
ci/buildenv/fedora-37.sh | 2 ++
ci/buildenv/fedora-38.sh | 2 ++
ci/buildenv/fedora-rawhide.sh | 2 ++
ci/buildenv/opensuse-leap-15.sh | 2 ++
ci/buildenv/opensuse-tumbleweed.sh | 2 ++
ci/buildenv/ubuntu-2004.sh | 2 ++
ci/buildenv/ubuntu-2204.sh | 2 ++
ci/cirrus/freebsd-12.vars | 2 +-
ci/cirrus/freebsd-13.vars | 2 +-
ci/cirrus/freebsd-current.vars | 2 +-
ci/cirrus/macos-13.vars | 2 +-
ci/containers/almalinux-8.Dockerfile | 2 ++
ci/containers/alpine-317.Dockerfile | 2 ++
ci/containers/alpine-318.Dockerfile | 2 ++
ci/containers/alpine-edge.Dockerfile | 2 ++
ci/containers/centos-stream-8.Dockerfile | 2 ++
ci/containers/debian-11-cross-i686.Dockerfile | 2 ++
ci/containers/debian-11.Dockerfile | 2 ++
ci/containers/debian-12-cross-i686.Dockerfile | 2 ++
ci/containers/debian-12.Dockerfile | 2 ++
ci/containers/debian-sid.Dockerfile | 2 ++
ci/containers/fedora-37.Dockerfile | 2 ++
ci/containers/fedora-38.Dockerfile | 2 ++
ci/containers/fedora-rawhide.Dockerfile | 2 ++
ci/containers/opensuse-leap-15.Dockerfile | 2 ++
ci/containers/opensuse-tumbleweed.Dockerfile | 2 ++
ci/containers/ubuntu-2004.Dockerfile | 2 ++
ci/containers/ubuntu-2204.Dockerfile | 2 ++
38 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/ci/buildenv/almalinux-8.sh b/ci/buildenv/almalinux-8.sh
index a7d31f03..2b4b9e3d 100644
--- a/ci/buildenv/almalinux-8.sh
+++ b/ci/buildenv/almalinux-8.sh
@@ -13,8 +13,10 @@ function install_buildenv() {
dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/alpine-317.sh b/ci/buildenv/alpine-317.sh
index f7d8d50b..e9cd44ac 100644
--- a/ci/buildenv/alpine-317.sh
+++ b/ci/buildenv/alpine-317.sh
@@ -10,8 +10,10 @@ function install_buildenv() {
apk add \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/alpine-318.sh b/ci/buildenv/alpine-318.sh
index f7d8d50b..e9cd44ac 100644
--- a/ci/buildenv/alpine-318.sh
+++ b/ci/buildenv/alpine-318.sh
@@ -10,8 +10,10 @@ function install_buildenv() {
apk add \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/alpine-edge.sh b/ci/buildenv/alpine-edge.sh
index f7d8d50b..e9cd44ac 100644
--- a/ci/buildenv/alpine-edge.sh
+++ b/ci/buildenv/alpine-edge.sh
@@ -10,8 +10,10 @@ function install_buildenv() {
apk add \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/centos-stream-8.sh b/ci/buildenv/centos-stream-8.sh
index 524e4a4f..ceb0a121 100644
--- a/ci/buildenv/centos-stream-8.sh
+++ b/ci/buildenv/centos-stream-8.sh
@@ -14,8 +14,10 @@ function install_buildenv() {
dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/debian-11-cross-i686.sh b/ci/buildenv/debian-11-cross-i686.sh
index fb90a64d..eb95d3a0 100644
--- a/ci/buildenv/debian-11-cross-i686.sh
+++ b/ci/buildenv/debian-11-cross-i686.sh
@@ -11,9 +11,11 @@ function install_buildenv() {
apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
diffutils \
flake8 \
diff --git a/ci/buildenv/debian-11.sh b/ci/buildenv/debian-11.sh
index cd0744d9..70d995ac 100644
--- a/ci/buildenv/debian-11.sh
+++ b/ci/buildenv/debian-11.sh
@@ -11,9 +11,11 @@ function install_buildenv() {
apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/debian-12-cross-i686.sh b/ci/buildenv/debian-12-cross-i686.sh
index fb90a64d..eb95d3a0 100644
--- a/ci/buildenv/debian-12-cross-i686.sh
+++ b/ci/buildenv/debian-12-cross-i686.sh
@@ -11,9 +11,11 @@ function install_buildenv() {
apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
diffutils \
flake8 \
diff --git a/ci/buildenv/debian-12.sh b/ci/buildenv/debian-12.sh
index cd0744d9..70d995ac 100644
--- a/ci/buildenv/debian-12.sh
+++ b/ci/buildenv/debian-12.sh
@@ -11,9 +11,11 @@ function install_buildenv() {
apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/debian-sid.sh b/ci/buildenv/debian-sid.sh
index cd0744d9..70d995ac 100644
--- a/ci/buildenv/debian-sid.sh
+++ b/ci/buildenv/debian-sid.sh
@@ -11,9 +11,11 @@ function install_buildenv() {
apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/fedora-37.sh b/ci/buildenv/fedora-37.sh
index 227a8395..66241e32 100644
--- a/ci/buildenv/fedora-37.sh
+++ b/ci/buildenv/fedora-37.sh
@@ -9,8 +9,10 @@ function install_buildenv() {
dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/fedora-38.sh b/ci/buildenv/fedora-38.sh
index 227a8395..66241e32 100644
--- a/ci/buildenv/fedora-38.sh
+++ b/ci/buildenv/fedora-38.sh
@@ -9,8 +9,10 @@ function install_buildenv() {
dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/fedora-rawhide.sh b/ci/buildenv/fedora-rawhide.sh
index b6661fd2..20575d28 100644
--- a/ci/buildenv/fedora-rawhide.sh
+++ b/ci/buildenv/fedora-rawhide.sh
@@ -10,8 +10,10 @@ function install_buildenv() {
dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/opensuse-leap-15.sh b/ci/buildenv/opensuse-leap-15.sh
index c77cd305..b1e6c0ad 100644
--- a/ci/buildenv/opensuse-leap-15.sh
+++ b/ci/buildenv/opensuse-leap-15.sh
@@ -9,8 +9,10 @@ function install_buildenv() {
zypper install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/opensuse-tumbleweed.sh b/ci/buildenv/opensuse-tumbleweed.sh
index b2febe6c..d36d4255 100644
--- a/ci/buildenv/opensuse-tumbleweed.sh
+++ b/ci/buildenv/opensuse-tumbleweed.sh
@@ -9,8 +9,10 @@ function install_buildenv() {
zypper install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/ubuntu-2004.sh b/ci/buildenv/ubuntu-2004.sh
index 76404492..9b1eb4e2 100644
--- a/ci/buildenv/ubuntu-2004.sh
+++ b/ci/buildenv/ubuntu-2004.sh
@@ -11,9 +11,11 @@ function install_buildenv() {
apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdmainutils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/buildenv/ubuntu-2204.sh b/ci/buildenv/ubuntu-2204.sh
index cd0744d9..70d995ac 100644
--- a/ci/buildenv/ubuntu-2204.sh
+++ b/ci/buildenv/ubuntu-2204.sh
@@ -11,9 +11,11 @@ function install_buildenv() {
apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/cirrus/freebsd-12.vars b/ci/cirrus/freebsd-12.vars
index e09daaaf..7e886289 100644
--- a/ci/cirrus/freebsd-12.vars
+++ b/ci/cirrus/freebsd-12.vars
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
-PKGS='autoconf automake bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py39-flake8 python3 qemu valgrind'
+PKGS='autoconf automake awk bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py39-flake8 python3 qemu rust valgrind'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'
diff --git a/ci/cirrus/freebsd-13.vars b/ci/cirrus/freebsd-13.vars
index e09daaaf..7e886289 100644
--- a/ci/cirrus/freebsd-13.vars
+++ b/ci/cirrus/freebsd-13.vars
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
-PKGS='autoconf automake bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py39-flake8 python3 qemu valgrind'
+PKGS='autoconf automake awk bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py39-flake8 python3 qemu rust valgrind'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'
diff --git a/ci/cirrus/freebsd-current.vars b/ci/cirrus/freebsd-current.vars
index e09daaaf..7e886289 100644
--- a/ci/cirrus/freebsd-current.vars
+++ b/ci/cirrus/freebsd-current.vars
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
-PKGS='autoconf automake bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py39-flake8 python3 qemu valgrind'
+PKGS='autoconf automake awk bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py39-flake8 python3 qemu rust valgrind'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'
diff --git a/ci/cirrus/macos-13.vars b/ci/cirrus/macos-13.vars
index 6f19a5e4..b7aa0025 100644
--- a/ci/cirrus/macos-13.vars
+++ b/ci/cirrus/macos-13.vars
@@ -11,6 +11,6 @@ MAKE='/opt/homebrew/bin/gmake'
NINJA='/opt/homebrew/bin/ninja'
PACKAGING_COMMAND='brew'
PIP3='/opt/homebrew/bin/pip3'
-PKGS='autoconf automake bash-completion ccache diffutils flake8 git glib gnu-sed gnutls golang jq libev libtool libxml2 make ocaml ocaml-findlib perl pkg-config python3 qemu'
+PKGS='autoconf automake awk bash-completion ccache diffutils flake8 git glib gnu-sed gnutls golang jq libev libtool libxml2 make ocaml ocaml-findlib perl pkg-config python3 qemu rust'
PYPI_PKGS=''
PYTHON='/opt/homebrew/bin/python3'
diff --git a/ci/containers/almalinux-8.Dockerfile b/ci/containers/almalinux-8.Dockerfile
index 94466550..b6b99890 100644
--- a/ci/containers/almalinux-8.Dockerfile
+++ b/ci/containers/almalinux-8.Dockerfile
@@ -14,8 +14,10 @@ RUN dnf update -y && \
dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/alpine-317.Dockerfile b/ci/containers/alpine-317.Dockerfile
index abd9476c..d88766f1 100644
--- a/ci/containers/alpine-317.Dockerfile
+++ b/ci/containers/alpine-317.Dockerfile
@@ -11,8 +11,10 @@ RUN apk update && \
apk add \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/alpine-318.Dockerfile b/ci/containers/alpine-318.Dockerfile
index 7a3920ae..a0b24c19 100644
--- a/ci/containers/alpine-318.Dockerfile
+++ b/ci/containers/alpine-318.Dockerfile
@@ -11,8 +11,10 @@ RUN apk update && \
apk add \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/alpine-edge.Dockerfile b/ci/containers/alpine-edge.Dockerfile
index d0fb0075..d6fe680b 100644
--- a/ci/containers/alpine-edge.Dockerfile
+++ b/ci/containers/alpine-edge.Dockerfile
@@ -11,8 +11,10 @@ RUN apk update && \
apk add \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/centos-stream-8.Dockerfile b/ci/containers/centos-stream-8.Dockerfile
index e0d763ae..6d1f8fed 100644
--- a/ci/containers/centos-stream-8.Dockerfile
+++ b/ci/containers/centos-stream-8.Dockerfile
@@ -15,8 +15,10 @@ RUN dnf distro-sync -y && \
dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/debian-11-cross-i686.Dockerfile b/ci/containers/debian-11-cross-i686.Dockerfile
index 385891fe..7b7d0dc7 100644
--- a/ci/containers/debian-11-cross-i686.Dockerfile
+++ b/ci/containers/debian-11-cross-i686.Dockerfile
@@ -13,9 +13,11 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
diffutils \
flake8 \
diff --git a/ci/containers/debian-11.Dockerfile b/ci/containers/debian-11.Dockerfile
index 0fe9d734..59e01480 100644
--- a/ci/containers/debian-11.Dockerfile
+++ b/ci/containers/debian-11.Dockerfile
@@ -13,9 +13,11 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/debian-12-cross-i686.Dockerfile b/ci/containers/debian-12-cross-i686.Dockerfile
index e11047c2..ff7805ef 100644
--- a/ci/containers/debian-12-cross-i686.Dockerfile
+++ b/ci/containers/debian-12-cross-i686.Dockerfile
@@ -13,9 +13,11 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
diffutils \
flake8 \
diff --git a/ci/containers/debian-12.Dockerfile b/ci/containers/debian-12.Dockerfile
index 49313eef..ee7dce07 100644
--- a/ci/containers/debian-12.Dockerfile
+++ b/ci/containers/debian-12.Dockerfile
@@ -13,9 +13,11 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/debian-sid.Dockerfile b/ci/containers/debian-sid.Dockerfile
index 6a19fb33..c82894d6 100644
--- a/ci/containers/debian-sid.Dockerfile
+++ b/ci/containers/debian-sid.Dockerfile
@@ -13,9 +13,11 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/fedora-37.Dockerfile b/ci/containers/fedora-37.Dockerfile
index 9536a7b8..597ec283 100644
--- a/ci/containers/fedora-37.Dockerfile
+++ b/ci/containers/fedora-37.Dockerfile
@@ -20,8 +20,10 @@ exec "$@"\n' > /usr/bin/nosync && \
nosync dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/fedora-38.Dockerfile b/ci/containers/fedora-38.Dockerfile
index 3ee4dae0..94bef2aa 100644
--- a/ci/containers/fedora-38.Dockerfile
+++ b/ci/containers/fedora-38.Dockerfile
@@ -20,8 +20,10 @@ exec "$@"\n' > /usr/bin/nosync && \
nosync dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/fedora-rawhide.Dockerfile b/ci/containers/fedora-rawhide.Dockerfile
index 66f27580..91cd0ab1 100644
--- a/ci/containers/fedora-rawhide.Dockerfile
+++ b/ci/containers/fedora-rawhide.Dockerfile
@@ -21,8 +21,10 @@ exec "$@"\n' > /usr/bin/nosync && \
nosync dnf install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/opensuse-leap-15.Dockerfile b/ci/containers/opensuse-leap-15.Dockerfile
index f3b3fc3f..48f06a4a 100644
--- a/ci/containers/opensuse-leap-15.Dockerfile
+++ b/ci/containers/opensuse-leap-15.Dockerfile
@@ -10,8 +10,10 @@ RUN zypper update -y && \
zypper install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/opensuse-tumbleweed.Dockerfile b/ci/containers/opensuse-tumbleweed.Dockerfile
index 3be06900..fff6c4fe 100644
--- a/ci/containers/opensuse-tumbleweed.Dockerfile
+++ b/ci/containers/opensuse-tumbleweed.Dockerfile
@@ -10,8 +10,10 @@ RUN zypper dist-upgrade -y && \
zypper install -y \
autoconf \
automake \
+ awk \
bash-completion \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/ubuntu-2004.Dockerfile b/ci/containers/ubuntu-2004.Dockerfile
index d95b90eb..35eaded4 100644
--- a/ci/containers/ubuntu-2004.Dockerfile
+++ b/ci/containers/ubuntu-2004.Dockerfile
@@ -13,9 +13,11 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdmainutils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
diff --git a/ci/containers/ubuntu-2204.Dockerfile b/ci/containers/ubuntu-2204.Dockerfile
index de066a02..1ad85c0d 100644
--- a/ci/containers/ubuntu-2204.Dockerfile
+++ b/ci/containers/ubuntu-2204.Dockerfile
@@ -13,9 +13,11 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
autoconf \
automake \
+ awk \
bash-completion \
bsdextrautils \
ca-certificates \
+ cargo \
ccache \
clang \
diffutils \
--
2.41.0
1 year, 3 months
[libnbd PATCH v5 00/12] Rust Bindings for Libnbd
by Tage Johansson
A new version of the Rust bindings for Libnbd. Most changes have been
mentioned as replies to the comments I got on v4. But the most significant
change is probably that the patches have been reordered.
Best regards,
Tage
Tage Johansson (12):
rust: create basic Rust bindings
rust: Add a couple of integration tests
rust: Make it possible to run tests with Valgrind
rust: Add some examples
generator: Add information about asynchronous handle calls
generator: Add information about the lifetime of closures
rust: Use more specific closure traits
rust: async: Create an async friendly handle type
generator: Add `modifies_fd` flag to the [call] structure
rust: async: Use the modifies_fd flag to exclude calls
rust: async: Add a couple of integration tests
rust: async: Add an example
.gitignore | 10 +
.ocamlformat | 4 +
Makefile.am | 2 +
configure.ac | 30 +
generator/API.ml | 84 ++
generator/API.mli | 35 +
generator/Makefile.am | 4 +
generator/Rust.ml | 794 ++++++++++++++++++
generator/Rust.mli | 22 +
generator/RustSys.ml | 167 ++++
generator/RustSys.mli | 19 +
generator/generator.ml | 4 +
rust/Cargo.toml | 59 ++
rust/Makefile.am | 106 +++
rust/cargo_test/Cargo.toml | 23 +
rust/cargo_test/README.md | 3 +
rust/cargo_test/src/lib.rs | 31 +
rust/examples/concurrent-read-write.rs | 135 +++
rust/examples/connect-command.rs | 39 +
rust/examples/fetch-first-sector.rs | 38 +
rust/examples/get-size.rs | 29 +
rust/libnbd-sys/Cargo.toml | 32 +
rust/libnbd-sys/build.rs | 26 +
rust/libnbd-sys/src/.keep | 0
rust/run-tests.sh.in | 39 +
rust/src/async_handle.rs | 268 ++++++
rust/src/error.rs | 157 ++++
rust/src/handle.rs | 67 ++
rust/src/lib.rs | 36 +
rust/src/types.rs | 20 +
rust/src/utils.rs | 23 +
rust/tests/nbdkit_pattern/mod.rs | 28 +
rust/tests/test_100_handle.rs | 25 +
rust/tests/test_110_defaults.rs | 33 +
rust/tests/test_120_set_non_defaults.rs | 53 ++
rust/tests/test_130_private_data.rs | 28 +
rust/tests/test_140_explicit_close.rs | 31 +
rust/tests/test_200_connect_command.rs | 32 +
rust/tests/test_210_opt_abort.rs | 31 +
rust/tests/test_220_opt_list.rs | 86 ++
rust/tests/test_230_opt_info.rs | 120 +++
rust/tests/test_240_opt_list_meta.rs | 147 ++++
rust/tests/test_245_opt_list_meta_queries.rs | 93 ++
rust/tests/test_250_opt_set_meta.rs | 123 +++
rust/tests/test_255_opt_set_meta_queries.rs | 109 +++
rust/tests/test_300_get_size.rs | 35 +
rust/tests/test_400_pread.rs | 39 +
rust/tests/test_405_pread_structured.rs | 79 ++
rust/tests/test_410_pwrite.rs | 58 ++
rust/tests/test_460_block_status.rs | 92 ++
rust/tests/test_620_stats.rs | 75 ++
rust/tests/test_async_100_handle.rs | 25 +
rust/tests/test_async_200_connect_command.rs | 33 +
rust/tests/test_async_210_opt_abort.rs | 32 +
rust/tests/test_async_220_opt_list.rs | 81 ++
rust/tests/test_async_230_opt_info.rs | 122 +++
rust/tests/test_async_240_opt_list_meta.rs | 147 ++++
.../test_async_245_opt_list_meta_queries.rs | 91 ++
rust/tests/test_async_250_opt_set_meta.rs | 122 +++
.../test_async_255_opt_set_meta_queries.rs | 107 +++
rust/tests/test_async_400_pread.rs | 40 +
rust/tests/test_async_405_pread_structured.rs | 84 ++
rust/tests/test_async_410_pwrite.rs | 59 ++
rust/tests/test_async_460_block_status.rs | 92 ++
rust/tests/test_async_620_stats.rs | 76 ++
rust/tests/test_log/mod.rs | 86 ++
rustfmt.toml | 19 +
scripts/git.orderfile | 12 +
68 files changed, 4851 insertions(+)
create mode 100644 .ocamlformat
create mode 100644 generator/Rust.ml
create mode 100644 generator/Rust.mli
create mode 100644 generator/RustSys.ml
create mode 100644 generator/RustSys.mli
create mode 100644 rust/Cargo.toml
create mode 100644 rust/Makefile.am
create mode 100644 rust/cargo_test/Cargo.toml
create mode 100644 rust/cargo_test/README.md
create mode 100644 rust/cargo_test/src/lib.rs
create mode 100644 rust/examples/concurrent-read-write.rs
create mode 100644 rust/examples/connect-command.rs
create mode 100644 rust/examples/fetch-first-sector.rs
create mode 100644 rust/examples/get-size.rs
create mode 100644 rust/libnbd-sys/Cargo.toml
create mode 100644 rust/libnbd-sys/build.rs
create mode 100644 rust/libnbd-sys/src/.keep
create mode 100755 rust/run-tests.sh.in
create mode 100644 rust/src/async_handle.rs
create mode 100644 rust/src/error.rs
create mode 100644 rust/src/handle.rs
create mode 100644 rust/src/lib.rs
create mode 100644 rust/src/types.rs
create mode 100644 rust/src/utils.rs
create mode 100644 rust/tests/nbdkit_pattern/mod.rs
create mode 100644 rust/tests/test_100_handle.rs
create mode 100644 rust/tests/test_110_defaults.rs
create mode 100644 rust/tests/test_120_set_non_defaults.rs
create mode 100644 rust/tests/test_130_private_data.rs
create mode 100644 rust/tests/test_140_explicit_close.rs
create mode 100644 rust/tests/test_200_connect_command.rs
create mode 100644 rust/tests/test_210_opt_abort.rs
create mode 100644 rust/tests/test_220_opt_list.rs
create mode 100644 rust/tests/test_230_opt_info.rs
create mode 100644 rust/tests/test_240_opt_list_meta.rs
create mode 100644 rust/tests/test_245_opt_list_meta_queries.rs
create mode 100644 rust/tests/test_250_opt_set_meta.rs
create mode 100644 rust/tests/test_255_opt_set_meta_queries.rs
create mode 100644 rust/tests/test_300_get_size.rs
create mode 100644 rust/tests/test_400_pread.rs
create mode 100644 rust/tests/test_405_pread_structured.rs
create mode 100644 rust/tests/test_410_pwrite.rs
create mode 100644 rust/tests/test_460_block_status.rs
create mode 100644 rust/tests/test_620_stats.rs
create mode 100644 rust/tests/test_async_100_handle.rs
create mode 100644 rust/tests/test_async_200_connect_command.rs
create mode 100644 rust/tests/test_async_210_opt_abort.rs
create mode 100644 rust/tests/test_async_220_opt_list.rs
create mode 100644 rust/tests/test_async_230_opt_info.rs
create mode 100644 rust/tests/test_async_240_opt_list_meta.rs
create mode 100644 rust/tests/test_async_245_opt_list_meta_queries.rs
create mode 100644 rust/tests/test_async_250_opt_set_meta.rs
create mode 100644 rust/tests/test_async_255_opt_set_meta_queries.rs
create mode 100644 rust/tests/test_async_400_pread.rs
create mode 100644 rust/tests/test_async_405_pread_structured.rs
create mode 100644 rust/tests/test_async_410_pwrite.rs
create mode 100644 rust/tests/test_async_460_block_status.rs
create mode 100644 rust/tests/test_async_620_stats.rs
create mode 100644 rust/tests/test_log/mod.rs
create mode 100644 rustfmt.toml
--
2.41.0
1 year, 3 months