gobuildknative

Kperf build failing


I've tried to Build kperf by running build.sh, but I get The following error with unable to find io/fs. I'm a huge go noob, any help appreciated.

ibrahim@home:~/kperf/src/knative.dev/kperf$ ./hack/build.sh
⚖️ License
🧹 Format
🚧 Compile
knative.dev/kperf/pkg/config imports
        github.com/spf13/viper imports
        io/fs: cannot find module providing package io/fs
-mod=mod not supported (can be '', 'readonly', or 'vendor')
/home/ibrahim/kperf/src/knative.dev/kperf/hack/build-funcs.sh: line 44: go-bindata: command not found
-mod=mod not supported (can be '', 'readonly', or 'vendor')
🧪 Test
knative.dev/kperf/pkg/config imports
        github.com/spf13/viper imports
        io/fs: cannot find module providing package io/fs
-mod=mod not supported (can be '', 'readonly', or 'vendor')
/home/ibrahim/kperf/src/knative.dev/kperf/hack/build-funcs.sh: line 44: go-bindata: command not found
build io/fs: cannot load io/fs: open /home/ibrahim/kperf/src/knative.dev/kperf/vendor/io/fs: no such file or directory
🔥 Failure

Steps to reproduce:

  1. Create and cd into /kperf/src/knative.dev directory
  2. Clone Kperf project
  3. cd into kperf project directory and run ./hack/build.sh

Solution

  • The error message means that your Go tool

    That indicates the Go tool installed on your system is too old.

    According to the go directive in the go.mod file, I think you should upgrade to Go1.18 at least.

    module knative.dev/kperf
    
    go 1.18
    

    It's better to install the latest Go. See https://go.dev/doc/install for the installation instructions.