<div dir="ltr"><div dir="ltr">On Tue, Aug 15, 2023 at 9:53 PM Eric Blake <<a href="mailto:eblake@redhat.com">eblake@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Aug 14, 2023 at 01:43:37PM -0500, Eric Blake wrote:<br>
> > > +++ b/golang/configure/test.go<br>
> > > @@ -25,8 +25,19 @@<br>
> > >  import (<br>
> > >         "fmt"<br>
> > >         "runtime"<br>
> > > +       "unsafe"<br>
> > >  )<br>
> > ><br>
> > > +func check_slice(arr *uint32, cnt int) []uint32 {<br>
> > > +       /* We require unsafe.Slice(), introduced in 1.17 */<br>
> > > +       ret := make([]uint32, cnt)<br>
> > > +       s := unsafe.Slice(arr, cnt)<br>
> > > +       for i, item := range s {<br>
> > > +               ret[i] = uint32(item)<br>
> > > +       }<br>
> > > +       return ret<br>
> > > +}<br>
> > ><br>
> > <br>
> > I'm not sure what is the purpose of this test - requiring the Go version is<br>
> > good<br>
> > enough since the code will not compile with an older version. EVen if it<br>
> > would,<br>
> > it will not compile without unsafe.Slice so no special check is needed.<br>
<br>
Turns out it does matter.  On our CI system, Ubuntu 20.04 has Go<br>
1.13.8 installed, and without this feature test, it compiled just fine<br>
(it wasn't until later versions of Go that go.mod's version request<br>
causes a compile failure if not satisfied).<br></blockquote><div><br></div><div>How does it compile when unsafe.Slice is undefined?</div><div><br></div><div>Quick test with unrelated test app:</div><div><br></div><div>$ go build; echo $?<br># cobra-test<br>./main.go:10:6: undefined: cmd.NoSuchMethod<br>1<br></div><div><br></div><div>Or you mean the compile test for configure works and we want to make</div><div>the configure test fail to compile?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<a href="https://gitlab.com/nbdkit/libnbd/-/jobs/4870816575" rel="noreferrer" target="_blank">https://gitlab.com/nbdkit/libnbd/-/jobs/4870816575</a><br>
<br>
But while investigating that, I also noticed that libvirt-ci just<br>
recently dropped all Debian 10 support in favor of Debian 12, so I'm<br>
working on updating ci/manifest.yml to match.<br></blockquote><div><br></div><div>Sounds like a good idea </div></div></div>