Update gomod and vendor

This commit is contained in:
Ettore Di Giacinto
2021-01-19 18:29:09 +01:00
parent dbd37afced
commit 7b25a54653
930 changed files with 183699 additions and 4609 deletions

View File

@@ -0,0 +1,8 @@
// +build !386
package binfmt_misc
// This file is generated by running make inside the binfmt_misc package.
// Do not edit manually.
const Binary386 = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xec\xd8\x31\x6e\xc2\x30\x14\x06\xe0\xdf\x8d\xdb\x26\x6a\x07\x1f\x20\xaa\x3a\x74\xe8\x64\xb5\x52\xae\x00\x2c\x88\x8d\x03\x80\x14\xc1\x94\x44\x89\x91\x60\x22\x47\x60\xe0\x20\x8c\x8c\x5c\x80\x13\x70\x19\xf4\xe2\x67\x91\x81\x25\xfb\xfb\xa4\x5f\x16\xcf\xe6\x29\xeb\x7b\xfb\xd1\x74\xac\x94\x42\xf0\x82\x08\xdd\xaf\x83\x8e\x33\x00\x7f\xc6\xd7\x33\x7c\x23\xc2\x2f\x74\xb8\x27\xad\x8e\x29\x27\x00\x14\x4d\x35\x03\x7f\x6f\x7c\x0f\x4a\x02\x80\xf2\xca\x75\x7a\x77\xa4\xb4\x3a\xa6\xa4\x00\x52\xfe\x7f\xc8\x27\xbf\x9f\xcc\xe6\xd4\xef\x42\xb5\xc7\x57\x0a\x21\x84\x10\x42\x08\x21\x84\x10\x62\x88\x33\x0d\xd5\xff\xb7\x6b\x0b\xdb\xac\x1b\x57\xbb\xc5\x12\xb6\x28\x5d\x6e\x57\xc5\xc6\x56\x75\x59\xe5\xb5\xdb\xc1\xba\x7c\xeb\x86\xf4\xfd\x00\xf0\xde\xed\x13\x78\xce\xe7\x19\x3f\xd0\x7c\x7e\xf1\x5c\xff\xc6\x3b\x07\x18\xbf\x2b\x08\x54\xef\x8c\x7a\xf5\xc4\x00\x3f\x4f\xde\xdd\x03\x00\x00\xff\xff\x8d\xf7\xd2\x72\xd0\x10\x00\x00"

View File

@@ -0,0 +1,7 @@
// +build !386
package binfmt_misc
func i386Supported() error {
return check(Binary386)
}

View File

@@ -0,0 +1,7 @@
// +build 386
package binfmt_misc
func i386Supported() error {
return nil
}

View File

@@ -0,0 +1,56 @@
FROM debian:buster-slim AS base
RUN apt-get update && apt-get --no-install-recommends install -y \
binutils-arm-linux-gnueabihf \
binutils-aarch64-linux-gnu \
binutils-x86-64-linux-gnu \
binutils-i686-linux-gnu \
binutils-riscv64-linux-gnu \
binutils-s390x-linux-gnu \
binutils-powerpc64le-linux-gnu
WORKDIR /src
FROM base AS exit-amd64
COPY fixtures/exit.amd64.s .
RUN x86_64-linux-gnu-as -o exit.o exit.amd64.s && x86_64-linux-gnu-ld -o exit -s exit.o
FROM base AS exit-386
COPY fixtures/exit.386.s .
RUN i686-linux-gnu-as -o exit.o exit.386.s && i686-linux-gnu-ld -o exit -s exit.o
FROM base AS exit-arm64
COPY fixtures/exit.arm64.s .
RUN aarch64-linux-gnu-as -o exit.o exit.arm64.s && aarch64-linux-gnu-ld -o exit -s exit.o
FROM base AS exit-arm
COPY fixtures/exit.arm.s .
RUN arm-linux-gnueabihf-as -o exit.o exit.arm.s && arm-linux-gnueabihf-ld -o exit -s exit.o
FROM base AS exit-riscv64
COPY fixtures/exit.riscv64.s .
RUN riscv64-linux-gnu-as -o exit.o exit.riscv64.s && riscv64-linux-gnu-ld -o exit -s exit.o
FROM base AS exit-s390x
COPY fixtures/exit.s390x.s .
RUN s390x-linux-gnu-as -o exit.o exit.s390x.s && s390x-linux-gnu-ld -o exit -s exit.o
FROM base AS exit-ppc64le
COPY fixtures/exit.ppc64le.s .
RUN powerpc64le-linux-gnu-as -o exit.o exit.ppc64le.s && powerpc64le-linux-gnu-ld -o exit -s exit.o
FROM golang:1.13-alpine AS generate
WORKDIR /src
COPY --from=exit-amd64 /src/exit amd64
COPY --from=exit-386 /src/exit 386
COPY --from=exit-arm64 /src/exit arm64
COPY --from=exit-arm /src/exit arm
COPY --from=exit-riscv64 /src/exit riscv64
COPY --from=exit-s390x /src/exit s390x
COPY --from=exit-ppc64le /src/exit ppc64le
COPY generate.go .
RUN go run generate.go amd64 386 arm64 arm riscv64 s390x ppc64le && ls -l
FROM scratch
COPY --from=generate /src/*_binary.go /

View File

@@ -0,0 +1,4 @@
generate:
buildctl build --frontend dockerfile.v0 --local context=. --local dockerfile=. --output type=local,dest=.
.PHONY: generate

View File

@@ -0,0 +1,8 @@
// +build !amd64
package binfmt_misc
// This file is generated by running make inside the binfmt_misc package.
// Do not edit manually.
const Binaryamd64 = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xaa\x77\xf5\x71\x63\x62\x64\x64\x80\x01\x26\x06\x3b\x06\x30\x4f\xc0\x01\xcc\x77\x80\x8a\x1b\x08\xc0\x95\x30\x38\x30\x58\x30\x30\x33\x38\x30\xb0\x30\x30\x83\xd5\xb2\x30\x20\x03\x07\x14\x9a\x03\x6a\x34\x8c\x66\x80\x9a\x03\xe2\xb2\x22\xf1\x61\xf6\xc1\x68\x1e\xa8\x30\x8c\x86\xa9\x63\x81\xe2\x17\x50\xe1\x17\x50\x7b\x60\xb4\x02\x54\x1c\x46\x73\x30\x20\xf4\x09\x40\xed\x74\xf7\x0b\x05\xd9\x7f\x80\x05\xea\x8e\x51\x30\x0a\x46\xc1\x28\x18\x05\xa3\x60\x14\x8c\x82\x51\x30\x0a\x46\xc1\x28\x18\x05\xa3\x60\xb8\x03\x8f\xe3\x07\x6c\x40\x94\xe1\x7f\x7e\x56\x06\xbd\xe2\x8c\xe2\x92\xa2\x92\xc4\x24\x06\xbd\xbc\xfc\x92\x54\xbd\xf4\xbc\x52\xbd\x82\xa2\xfc\x82\xd4\xa2\x92\x4a\x06\xbd\x92\xd4\x8a\x12\x8a\xed\xe3\x66\x60\x60\x60\x07\x8f\x33\xa0\xf7\xdf\x51\xfb\xed\x0c\x68\xfd\x77\x18\x90\x83\xf6\xd9\xd9\x18\xd0\xc7\x0d\xd0\xc6\x0b\x18\x10\xe3\x0c\xe8\x7c\x66\x2c\xee\xe2\x81\xea\x57\x21\xa0\x1f\x10\x00\x00\xff\xff\x8a\x1b\xd7\x73\x30\x11\x00\x00"

View File

@@ -0,0 +1,7 @@
// +build !amd64
package binfmt_misc
func amd64Supported() error {
return check(Binaryamd64)
}

View File

@@ -0,0 +1,7 @@
// +build amd64
package binfmt_misc
func amd64Supported() error {
return nil
}

View File

@@ -0,0 +1,8 @@
// +build !arm64
package binfmt_misc
// This file is generated by running make inside the binfmt_misc package.
// Do not edit manually.
const Binaryarm64 = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xaa\x77\xf5\x71\x63\x62\x64\x64\x80\x01\x26\x86\xed\x0c\x20\x5e\x05\x83\x03\x98\xef\x00\x15\x9f\xc1\x80\x00\x0e\x0c\x16\x0c\x8c\x0c\x0e\x0c\xcc\x0c\x4c\x60\xb5\xac\x0c\x0c\x28\xb2\xc8\x74\x0b\x94\xd7\x02\x97\x87\xd9\xd5\x70\x69\x05\x77\xc3\x25\x46\x06\x86\x2b\x0c\x7a\xc5\x19\xc5\x25\x45\x25\x89\x49\x0c\x7a\x25\xa9\x15\x25\x0c\x54\x00\xdc\x50\x9b\xd8\xa0\x7c\x98\x7f\x2a\xa0\x7c\x1e\x34\xf5\x2c\x68\x7c\x90\x5e\x66\x2c\xe6\xc2\xfc\x21\x88\x45\x3d\x32\x00\x04\x00\x00\xff\xff\xe7\x30\x54\x02\x58\x01\x00\x00"

View File

@@ -0,0 +1,7 @@
// +build !arm64
package binfmt_misc
func arm64Supported() error {
return check(Binaryarm64)
}

View File

@@ -0,0 +1,7 @@
// +build arm64
package binfmt_misc
func arm64Supported() error {
return nil
}

View File

@@ -0,0 +1,8 @@
// +build !arm
package binfmt_misc
// This file is generated by running make inside the binfmt_misc package.
// Do not edit manually.
const Binaryarm = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x8c\x8e\x31\x0e\x82\x40\x14\x44\xdf\x17\x50\x13\x6d\xf4\x04\xda\x51\x6d\xc5\x05\x28\xb4\xd2\xc6\x70\x00\x97\x84\x44\x3a\x02\xdf\xc4\xce\x4b\x78\x00\xee\xc6\x01\xbc\x82\x01\x17\xdd\xc2\xc2\x49\x26\x93\x7d\x3b\xc9\x9f\xfb\xee\xb0\x17\x11\x46\x4d\x88\xe9\x5f\x19\x42\x02\x3c\xde\x30\x4a\xd8\x20\xc4\x84\x04\x7c\xdb\x32\xf8\x0c\x83\xa3\x0f\x6b\x3b\xa9\xda\x0e\x78\xa6\x2b\xc0\x16\x36\x2f\x91\x19\x30\x17\x4c\x73\x69\xb4\x56\x9b\x63\xb4\xb8\x29\x26\x3d\x1d\x8d\x55\xad\xcb\xfc\xaa\x45\xc3\xdf\x5a\xb8\x6b\x53\xb7\x37\x03\x96\xde\x7f\xe8\xb2\x9f\x10\x40\x35\xf2\x7e\xeb\xda\xeb\x89\x97\x81\xc7\x6b\x60\xfb\xa3\xf7\x0a\x00\x00\xff\xff\x73\x8f\xca\xf1\x34\x01\x00\x00"

View File

@@ -0,0 +1,7 @@
// +build !arm
package binfmt_misc
func armSupported() error {
return check(Binaryarm)
}

View File

@@ -0,0 +1,7 @@
// +build arm
package binfmt_misc
func armSupported() error {
return nil
}

View File

@@ -0,0 +1,42 @@
package binfmt_misc
import (
"bytes"
"compress/gzip"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
)
func check(bin string) error {
tmpdir, err := ioutil.TempDir("", "qemu-check")
if err != nil {
return err
}
defer os.RemoveAll(tmpdir)
pp := filepath.Join(tmpdir, "check")
r, err := gzip.NewReader(bytes.NewReader([]byte(bin)))
if err != nil {
return err
}
defer r.Close()
f, err := os.OpenFile(pp, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0700)
if err != nil {
return err
}
if _, err := io.Copy(f, r); err != nil {
f.Close()
return err
}
f.Close()
cmd := exec.Command("/check")
withChroot(cmd, tmpdir)
err = cmd.Run()
return err
}

View File

@@ -0,0 +1,14 @@
// +build !windows
package binfmt_misc
import (
"os/exec"
"syscall"
)
func withChroot(cmd *exec.Cmd, dir string) {
cmd.SysProcAttr = &syscall.SysProcAttr{
Chroot: dir,
}
}

View File

@@ -0,0 +1,10 @@
// +build windows
package binfmt_misc
import (
"os/exec"
)
func withChroot(cmd *exec.Cmd, dir string) {
}

View File

@@ -0,0 +1,134 @@
package binfmt_misc
import (
"strings"
"sync"
"github.com/containerd/containerd/platforms"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"
)
var mu sync.Mutex
var arr []string
func SupportedPlatforms(noCache bool) []string {
mu.Lock()
defer mu.Unlock()
if !noCache && arr != nil {
return arr
}
def := defaultPlatform()
arr = append([]string{}, def)
if p := "linux/amd64"; def != p && amd64Supported() == nil {
arr = append(arr, p)
}
if p := "linux/arm64"; def != p && arm64Supported() == nil {
arr = append(arr, p)
}
if p := "linux/riscv64"; def != p && riscv64Supported() == nil {
arr = append(arr, p)
}
if p := "linux/ppc64le"; def != p && ppc64leSupported() == nil {
arr = append(arr, p)
}
if p := "linux/s390x"; def != p && s390xSupported() == nil {
arr = append(arr, p)
}
if p := "linux/386"; def != p && i386Supported() == nil {
arr = append(arr, p)
}
if !strings.HasPrefix(def, "linux/arm/") && armSupported() == nil {
arr = append(arr, "linux/arm/v7", "linux/arm/v6")
} else if def == "linux/arm/v7" {
arr = append(arr, "linux/arm/v6")
}
return arr
}
func Check(pp specs.Platform) bool {
p := platforms.Format(pp)
if p == "linux/amd64" && amd64Supported() == nil {
return true
}
if p == "linux/arm64" && arm64Supported() == nil {
return true
}
if p == "linux/riscv64" && riscv64Supported() == nil {
return true
}
if p == "linux/ppc64le" && ppc64leSupported() == nil {
return true
}
if p == "linux/s390x" && s390xSupported() == nil {
return true
}
if p == "linux/386" && i386Supported() == nil {
return true
}
if !strings.HasPrefix(p, "linux/arm/") && armSupported() == nil {
return true
}
return false
}
//WarnIfUnsupported validates the platforms and show warning message if there is,
//the end user could fix the issue based on those warning, and thus no need to drop
//the platform from the candidates.
func WarnIfUnsupported(pfs []string) {
def := defaultPlatform()
for _, p := range pfs {
if p != def {
if p == "linux/amd64" {
if err := amd64Supported(); err != nil {
printPlatfromWarning(p, err)
}
}
if p == "linux/arm64" {
if err := arm64Supported(); err != nil {
printPlatfromWarning(p, err)
}
}
if p == "linux/riscv64" {
if err := riscv64Supported(); err != nil {
printPlatfromWarning(p, err)
}
}
if p == "linux/ppc64le" {
if err := ppc64leSupported(); err != nil {
printPlatfromWarning(p, err)
}
}
if p == "linux/s390x" {
if err := s390xSupported(); err != nil {
printPlatfromWarning(p, err)
}
}
if p == "linux/386" {
if err := i386Supported(); err != nil {
printPlatfromWarning(p, err)
}
}
if strings.HasPrefix(p, "linux/arm/v6") || strings.HasPrefix(p, "linux/arm/v7") {
if err := armSupported(); err != nil {
printPlatfromWarning(p, err)
}
}
}
}
}
func defaultPlatform() string {
return platforms.Format(platforms.Normalize(platforms.DefaultSpec()))
}
func printPlatfromWarning(p string, err error) {
if strings.Contains(err.Error(), "exec format error") {
logrus.Warnf("platform %s cannot pass the validation, kernel support for miscellaneous binary may have not enabled.", p)
} else if strings.Contains(err.Error(), "no such file or directory") {
logrus.Warnf("platforms %s cannot pass the validation, '-F' flag might have not set for 'binfmt_misc'.", p)
} else {
logrus.Warnf("platforms %s cannot pass the validation: %s", p, err.Error())
}
}

View File

@@ -0,0 +1,8 @@
// +build !ppc64le
package binfmt_misc
// This file is generated by running make inside the binfmt_misc package.
// Do not edit manually.
const Binaryppc64le = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xaa\x77\xf5\x71\x63\x62\x64\x64\x80\x01\x26\x06\x51\x06\x10\xaf\x82\x81\x41\x00\xc4\x77\x80\x8a\x2f\x80\xcb\x83\xc4\x2c\x18\x18\x19\x1c\x18\x58\x18\x98\xc1\x6a\x59\x19\x50\x80\x00\x32\xdd\x02\xe5\xb4\xc0\xa5\x19\x61\xa4\x05\x03\x43\x82\x05\x13\x03\x83\x0b\x83\x5e\x71\x46\x71\x49\x51\x49\x62\x12\x83\x5e\x49\x6a\x45\x09\x83\x5e\x6a\x46\x7c\x5a\x51\x62\x6e\x2a\x03\xc5\x80\x1b\x6a\x23\x1b\x94\x0f\xf3\x57\x05\x94\xcf\x83\xa6\x9e\x03\x8d\x2f\x08\xd5\xcf\x84\xf0\x87\x00\xaa\x7f\x50\x01\x0b\x1a\x1f\xa4\x97\x19\x8b\x3a\x98\x7e\x69\x2c\xea\x91\x01\x20\x00\x00\xff\xff\xce\xf7\x15\x75\xa0\x01\x00\x00"

View File

@@ -0,0 +1,7 @@
// +build !ppc64le
package binfmt_misc
func ppc64leSupported() error {
return check(Binaryppc64le)
}

View File

@@ -0,0 +1,7 @@
// +build ppc64le
package binfmt_misc
func ppc64leSupported() error {
return nil
}

View File

@@ -0,0 +1,8 @@
// +build !riscv64
package binfmt_misc
// This file is generated by running make inside the binfmt_misc package.
// Do not edit manually.
const Binaryriscv64 = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xaa\x77\xf5\x71\x63\x62\x64\x64\x80\x01\x26\x86\xcf\x0c\x20\x5e\x05\x03\x44\xcc\x01\x2a\x3e\x03\x4a\xb3\x80\xc5\x2c\x18\x18\x19\x1c\x18\x98\x19\x98\xc0\xaa\x58\x19\x90\x01\x23\x0a\xdd\x02\xe5\xc1\x68\x06\x01\x08\x25\xcc\xca\xc0\x30\x99\xe3\x02\x6b\x31\x88\xa3\x57\x9c\x51\x5c\x52\x54\x92\x98\xc4\xa0\x57\x92\x5a\x51\xc2\x40\x05\xc0\x0d\x75\x01\x1b\x94\x0f\xf3\x4f\x05\x94\xcf\x83\xa6\x9e\x05\x8d\x0f\x52\xcd\x8c\xc5\x5c\x98\x3f\x04\xb1\xa8\x47\x06\x80\x00\x00\x00\xff\xff\x39\x41\xdf\xa1\x58\x01\x00\x00"

View File

@@ -0,0 +1,7 @@
// +build !riscv64
package binfmt_misc
func riscv64Supported() error {
return check(Binaryriscv64)
}

View File

@@ -0,0 +1,7 @@
// +build riscv64
package binfmt_misc
func riscv64Supported() error {
return nil
}

View File

@@ -0,0 +1,8 @@
// +build !s390x
package binfmt_misc
// This file is generated by running make inside the binfmt_misc package.
// Do not edit manually.
const Binarys390x = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xaa\x77\xf5\x71\x63\x62\x62\x64\x80\x03\x26\x06\x31\x06\x06\x06\xb0\x00\x23\x03\x43\x05\x54\xd4\x01\x4a\xcf\x80\xf2\x2c\x18\x18\x19\x1c\x18\x98\x19\x98\xa0\x6a\x59\x19\x90\x00\x23\x1a\xcd\xc0\xc0\xd0\x80\x4a\x0b\x30\x2c\xd7\x64\x60\xe0\x62\x64\x67\x67\xd0\x2b\xce\x28\x2e\x29\x2a\x49\x4c\x62\xd0\x2b\x49\xad\x28\x61\xa0\x1e\xe0\x46\x72\x02\x1b\x9a\x7f\x60\x34\x07\x9a\x1e\x16\x34\x6f\x30\xe3\x30\x1b\xe6\x1f\x41\x34\x71\xb8\x97\x01\x01\x00\x00\xff\xff\x0c\x76\x9a\xe1\x58\x01\x00\x00"

View File

@@ -0,0 +1,7 @@
// +build !s390x
package binfmt_misc
func s390xSupported() error {
return check(Binarys390x)
}

View File

@@ -0,0 +1,7 @@
// +build s390x
package binfmt_misc
func s390xSupported() error {
return nil
}