Kperf构建失败

huangapple go评论76阅读模式
英文:

Kperf build failing

问题

我尝试通过运行build.sh来构建kperf,但是我遇到了无法找到io/fs的错误。我对Go不太了解,希望能得到帮助。

ibrahim@home:~/kperf/src/knative.dev/kperf$ ./hack/build.sh
⚖️ License
🚚 Format
🔨 Compile
knative.dev/kperf/pkg/config导入
        github.com/spf13/viper导入
        无法找到提供io/fs包的模块io/fs
-mod=mod不支持(可以是'''readonly''vendor'/home/ibrahim/kperf/src/knative.dev/kperf/hack/build-funcs.sh: 第44行: go-bindata: 找不到命令
-mod=mod不支持(可以是'''readonly''vendor'🧪 Test
knative.dev/kperf/pkg/config导入
        github.com/spf13/viper导入
        无法找到提供io/fs包的模块io/fs
-mod=mod不支持(可以是'''readonly''vendor'/home/ibrahim/kperf/src/knative.dev/kperf/hack/build-funcs.sh: 第44行: go-bindata: 找不到命令
构建io/fs: 无法加载io/fs: 打开/home/ibrahim/kperf/src/knative.dev/kperf/vendor/io/fs: 没有那个文件或目录
❌ 失败

复现步骤:

  1. 创建并进入/kperf/src/knative.dev目录
  2. 克隆Kperf项目
  3. 进入kperf项目目录并运行./hack/build.sh
英文:

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

答案1

得分: 1

错误消息表示您的Go工具:

  • 不支持-mod=mod(模块支持是在Go1.11中作为实验性功能引入的)。
  • 没有io/fs包(该包是在Go1.16中添加的)。

这表明您系统上安装的Go工具版本太旧。

根据go.mod文件中的go指令,我认为您应该至少升级到Go1.18。

module knative.dev/kperf

go 1.18

最好安装最新的Go版本。请参考https://go.dev/doc/install获取安装说明。

英文:

The error message means that your Go tool

  • does not support -mod=mod (module support was introduced as an experimental feature in Go1.11).
  • does not have the package io/fs (which was added in Go1.16).

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.

huangapple
  • 本文由 发表于 2023年7月6日 22:31:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76629914.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定