fw876 / helloworld

GNU General Public License v3.0
3.62k stars 2.64k forks source link

编译 Xray-core 1.8.0 失败,提示 note: module requires Go 1.20 #1134

Closed chika0801 closed 1 year ago

chika0801 commented 1 year ago

使用插件源码是 https://github.com/fw876/helloworld/commits/master

刚尝试编译 Xray-core 1.8.0 ,请问这个报错,如何解决?记得在1.7.5更新有发生过类似的然后有拉取代码处理了

1.7.5编译后看go的版本是 go 1.18.10。

https://github.com/chika0801/OpenWrt-R66s 我用lean源码编译 Xray-core go是 go 1.19.5。

报错提示在 https://github.com/chika0801/ImmortalWrt-RedmiAX6000/actions/runs/4384471881/jobs/7675987455#step:14:5214

在线编译是 https://github.com/chika0801/ImmortalWrt-RedmiAX6000

touch /workdir/openwrt/build_dir/target-aarch64_cortex-a53_musl/Xray-core-1.8.0/.built_check
CONFIG_GOLANG_MOD_CACHE_WORLD_READABLE="" GO_BUILD_CACHE_DIR="/workdir/openwrt/tmp/go-build" GO_MOD_CACHE_DIR="/workdir/openwrt/dl/go-mod-cache" GO_MOD_ARGS="-modcacherw" GO_PKG="github.com/xtls/xray-core" GO_INSTALL_EXTRA="" GO_INSTALL_ALL="" GO_SOURCE_ONLY="" GO_BUILD_PKG="github.com/xtls/xray-core/main" GO_EXCLUDES="" GO_GO_GENERATE="" GO_INSTALL_BIN_PATH="/usr/bin" BUILD_DIR="/workdir/openwrt/build_dir/target-aarch64_cortex-a53_musl/Xray-core-1.8.0" GO_BUILD_DIR="/workdir/openwrt/build_dir/target-aarch64_cortex-a53_musl/Xray-core-1.8.0/.go_work/build" GO_BUILD_BIN_DIR="/workdir/openwrt/build_dir/target-aarch64_cortex-a53_musl/Xray-core-1.8.0/.go_work/build/bin/linux_arm64" GO_BUILD_DEPENDS_PATH="/usr/share/gocode" GO_BUILD_DEPENDS_SRC="/workdir/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/share/gocode/src" GOOS="linux" GOARCH="arm64" GO386="" GOAMD64="" GOARM="" GOMIPS="" GOMIPS64="" GOPPC64="" CGO_ENABLED=1 CC="aarch64-openwrt-linux-musl-gcc" CXX="aarch64-openwrt-linux-musl-g++" CGO_CFLAGS="-Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -fmacro-prefix-map=/workdir/openwrt/build_dir/target-aarch64_cortex-a53_musl/Xray-core-1.8.0=Xray-core-1.8.0 -fstack-protector -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro" CGO_CPPFLAGS="-I/workdir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/usr/include -I/workdir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/include/fortify -I/workdir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/include" CGO_CXXFLAGS="-Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -fmacro-prefix-map=/workdir/openwrt/build_dir/target-aarch64_cortex-a53_musl/Xray-core-1.8.0=Xray-core-1.8.0 -fstack-protector -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro" CGO_LDFLAGS="-L/workdir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/lib -znow -zrelro" GOPATH="/workdir/openwrt/build_dir/target-aarch64_cortex-a53_musl/Xray-core-1.8.0/.go_work/build" GOCACHE="/workdir/openwrt/tmp/go-build" GOMODCACHE="/workdir/openwrt/dl/go-mod-cache" GOENV=off /usr/bin/env bash /workdir/openwrt/feeds/packages/lang/golang//golang-build.sh build -v -buildvcs=false -trimpath -ldflags "all=-buildid '1677567601' -linkmode external -extldflags '-L/workdir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/lib -Wl,-z,now -Wl,-z,relro'"        -ldflags "-s -w -X github.com/xtls/xray-core/core.build=OpenWrt -X github.com/xtls/xray-core/core.version=1.8.0 -buildid '1677567601' -linkmode external -extldflags '-L/workdir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/lib -Wl,-z,now -Wl,-z,relro'"  
Finding targets

Building targets
github.com/quic-go/quic-go/internal/qtls
# github.com/quic-go/quic-go/internal/qtls
../../../../../dl/go-mod-cache/github.com/quic-go/quic-go@v0.33.0/internal/qtls/go_oldversion.go:5:13: cannot use "The version of quic-go you're using can't be built using outdated Go versions. For more details, please see https://github.com/quic-go/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built using outdated Go...) as int value in variable declaration
note: module requires Go 1.19
github.com/xtls/reality
github.com/xtls/xray-core/transport/internet/headers/dns
# github.com/xtls/xray-core/transport/internet/headers/dns
../../transport/internet/headers/dns/dns.go:30:28: binary.BigEndian.AppendUint16 undefined (type binary.bigEndian has no field or method AppendUint16)
../../transport/internet/headers/dns/dns.go:31:28: binary.BigEndian.AppendUint16 undefined (type binary.bigEndian has no field or method AppendUint16)
../../transport/internet/headers/dns/dns.go:32:28: binary.BigEndian.AppendUint16 undefined (type binary.bigEndian has no field or method AppendUint16)
../../transport/internet/headers/dns/dns.go:33:28: binary.BigEndian.AppendUint16 undefined (type binary.bigEndian has no field or method AppendUint16)
../../transport/internet/headers/dns/dns.go:34:28: binary.BigEndian.AppendUint16 undefined (type binary.bigEndian has no field or method AppendUint16)
../../transport/internet/headers/dns/dns.go:35:28: binary.BigEndian.AppendUint16 undefined (type binary.bigEndian has no field or method AppendUint16)
../../transport/internet/headers/dns/dns.go:47:28: binary.BigEndian.AppendUint16 undefined (type binary.bigEndian has no field or method AppendUint16)
../../transport/internet/headers/dns/dns.go:48:28: binary.BigEndian.AppendUint16 undefined (type binary.bigEndian has no field or method AppendUint16)
note: module requires Go 1.20
# github.com/xtls/reality
../../../../../dl/go-mod-cache/github.com/xtls/reality@v0.0.0-20230309125256-0d0713b108c8/tls.go:249:62: time.Since(hs.c.ClientTime).Abs undefined (type time.Duration has no field or method Abs)
note: module requires Go 1.19

make[3]: *** [Makefile:52: /workdir/openwrt/build_dir/target-aarch64_cortex-a53_musl/Xray-core-1.8.0/.built] Error 2
make[3]: Leaving directory '/workdir/openwrt/feeds/packages/net/xray-core'
time: package/feeds/packages/xray-core/compile#1.43#0.38#1.12
    ERROR: package/feeds/packages/xray-core failed to build.
make[2]: *** [package/Makefile:116: package/feeds/packages/xray-core/compile] Error 1
make[2]: Leaving directory '/workdir/openwrt'
make[1]: *** [package/Makefile:110: /workdir/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/workdir/openwrt'
make: *** [/workdir/openwrt/include/toplevel.mk:230: world] Error 2
Error: Process completed with exit code 2.
chika0801 commented 1 year ago

已解决,

之前 readme 里有提到

    rm -rf feeds/packages/lang/golang/golang
    svn co https://github.com/openwrt/packages/branches/openwrt-22.03/lang/golang/golang feeds/packages/lang/golang/golang

现在删了,但在历史记录找到了,已经编译成功

chika0801 commented 1 year ago
2023-03-05 12:49:24: -----------end------------
2023-03-05 12:49:16: Main node:Xray 1.8.0 (Xray, Penetrates Everything.) OpenWrt (go1.19.6 linux/arm64) Started!
2023-03-05 12:49:15: ----------start------------
2023-03-05 12:49:15: boot!