英文:
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: 没有那个文件或目录
❌ 失败
复现步骤:
- 创建并进入/kperf/src/knative.dev目录
- 克隆Kperf项目
- 进入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:
- Create and cd into /kperf/src/knative.dev directory
- Clone Kperf project
- cd into kperf project directory and run ./hack/build.sh
答案1
得分: 1
错误消息表示您的Go工具:
这表明您系统上安装的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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论