OpenWrt编译错误之Go语言版本过高【未完待续】

本文最后更新于:2024年8月29日 晚上

OpenWrt编译错误之Go语言版本过高【未完待续】

​ OpenWrt在编译某些go源码的组件中经常会遇到Go语言版本过高的问题,具体报错情况如下所示,这里记录一下解决方案。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Building targets
github.com/lucas-clemente/quic-go/internal/qtls
# github.com/lucas-clemente/quic-go/internal/qtls
../../vendor/github.com/lucas-clemente/quic-go/internal/qtls/go120.go:6:13: cannot use "The version of quic-go you're using can't be built on Go 1.20 yet. For more details, please see https://github.com/lucas-clemente/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.20 yet. F...) as int value in variable declaration

make[3]: *** [Makefile:68: /home/debian/Complier/buildopenwrt/build_dir/target-mipsel_24kc_musl/cloudflared-2023.2.2/.built] Error 1
make[3]: Leaving directory '/home/debian/Complier/buildopenwrt/feeds/packages/net/cloudflared'
time: package/feeds/packages/cloudflared/compile#0.66#0.40#0.31
ERROR: package/feeds/packages/cloudflared failed to build.
make[2]: *** [package/Makefile:116: package/feeds/packages/cloudflared/compile] Error 1
make[2]: Leaving directory '/home/debian/Complier/buildopenwrt'
make[1]: *** [package/Makefile:110: /home/debian/Complier/buildopenwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/debian/Complier/buildopenwrt'
make: *** [/home/debian/Complier/buildopenwrt/include/toplevel.mk:231: world] Error 2

错误分析

​ 该错误主要适用于quic-go组件引起的,quci-go是一个用Go语言实现的QUIC协议库。QUIC是一种基于UDP的可靠传输协议,旨在提供更快的连接建立和改进的拥塞控制。但是quci-go并不支持Go 1.20版本,因此才会报错。


OpenWrt编译错误之Go语言版本过高【未完待续】
https://genioco.github.io/2024/08/19/Solution/OpenWrt编译错误之Go语言版本过高/
作者
BadWolf
发布于
2024年8月19日
许可协议