On Mon, Aug 14, 2023 at 01:43:37PM -0500, Eric Blake wrote: > > > +++ 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 > > > +} > > > > > > > I'm not sure what is the purpose of this test - requiring the Go version is > > good > > enough since the code will not compile with an older version. EVen if it > > would, > > it will not compile without unsafe.Slice so no special check is needed.
Turns out it does matter. On our CI system, Ubuntu 20.04 has Go 1.13.8 installed, and without this feature test, it compiled just fine (it wasn't until later versions of Go that go.mod's version request causes a compile failure if not satisfied). https://gitlab.com/nbdkit/libnbd/-/jobs/4870816575 But while investigating that, I also noticed that libvirt-ci just recently dropped all Debian 10 support in favor of Debian 12, so I'm working on updating ci/manifest.yml to match. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org _______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs