xiaorouji / openwrt-passwall

7.21k stars 2.65k forks source link

最新v2ray-core-5.0.3编译失败(提示golang问题) #1874

Closed wazzx closed 2 years ago

wazzx commented 2 years ago

环境:openwrt-sdk-21.02.2-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64 默认golang的Makefile

include $(TOPDIR)/rules.mk

GO_VERSION_MAJOR_MINOR:=1.17
GO_VERSION_PATCH:=8

PKG_NAME:=golang
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
PKG_RELEASE:=1

GO_SOURCE_URLS:=https://dl.google.com/go/ \
               https://mirrors.ustc.edu.cn/golang/ \
               https://mirrors.nju.edu.cn/golang/

PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
PKG_HASH:=2effcd898140da79a061f3784ca4f8d8b13d811fb2abe9dad2404442dabbdf7a

编译提示错误:

Finding targets
Building targets
github.com/marten-seemann/qtls-go1-18
# github.com/marten-seemann/qtls-go1-18
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/cipher_suites.go:141:43: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/cipher_suites.go:399:45: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/cipher_suites.go:404:46: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/cipher_suites.go:412:45: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/common.go:1496:41: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/conn.go:177:10: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/conn.go:183:13: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/conn.go:211:62: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/conn.go:973:14: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/conn.go:1056:33: undefined: any
../../../../../dl/go-mod-cache/github.com/marten-seemann/qtls-go1-18@v0.1.1/conn.go:973:14: too many errors
note: module requires Go 1.18

Makefile:108: recipe for target '/home/XXX/openwrt-sdk-21.02.2-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/v2ray-core-5.0.3/.built' failed
make[2]: *** [/home/XXX/openwrt-sdk-21.02.2-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/v2ray-core-5.0.3/.built] Error 2
make[2]: Leaving directory '/home/XXX/openwrt-sdk-21.02.2-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64/feeds/small/v2ray-core'
time: package/feeds/small/v2ray-core/compile#6.68#21.73#38.75
   ERROR: package/feeds/small/v2ray-core failed to build.
package/Makefile:114: recipe for target 'package/feeds/small/v2ray-core/compile' failed
make[1]: *** [package/feeds/small/v2ray-core/compile] Error 1
make[1]: Leaving directory '/home/XXX/openwrt-sdk-21.02.2-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64'
/home/XXX/openwrt-sdk-21.02.2-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64/include/toplevel.mk:221: recipe for target 'package/luci-app-passwall/compile' failed
make: *** [package/luci-app-passwall/compile] Error 2

处理方法修改golang到1.18(我不知道哪种是对的,因为1.18没有后缀,不像1.17.8一样)

include $(TOPDIR)/rules.mk

GO_VERSION_MAJOR_MINOR:=1.18
GO_VERSION_PATCH:=0

PKG_NAME:=golang
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
PKG_RELEASE:=1

GO_SOURCE_URLS:=https://dl.google.com/go/ \
               https://mirrors.ustc.edu.cn/golang/ \
               https://mirrors.nju.edu.cn/golang/

PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
PKG_HASH:=38f423db4cc834883f2b52344282fa7a39fbb93650dc62a11fdf0be6409bdad6

include $(TOPDIR)/rules.mk

GO_VERSION_MAJOR_MINOR:=1.18

PKG_NAME:=golang
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
PKG_RELEASE:=1

GO_SOURCE_URLS:=https://dl.google.com/go/ \
               https://mirrors.ustc.edu.cn/golang/ \
               https://mirrors.nju.edu.cn/golang/

PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
PKG_HASH:=38f423db4cc834883f2b52344282fa7a39fbb93650dc62a11fdf0be6409bdad6

但是都是失败了,不过我这边只是修改了Makefile一个文件。

github-actions[bot] commented 2 years ago

@wazzx: hello! :wave:

This issue is being automatically closed because it does not follow the issue template.

WYC-2020 commented 2 years ago

hash都没改肯定不行了,这个你去官方op看下别人怎么修改的不就知道了

wazzx commented 2 years ago

hash都没改肯定不行了,这个你去官方op看下别人怎么修改的不就知道了

谢谢大佬,但是我这边应该是修改了的啊!

include $(TOPDIR)/rules.mk

GO_VERSION_MAJOR_MINOR:=1.18
GO_VERSION_PATCH:=0

PKG_NAME:=golang
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
PKG_RELEASE:=1

GO_SOURCE_URLS:=https://dl.google.com/go/ \
               https://mirrors.ustc.edu.cn/golang/ \
               https://mirrors.nju.edu.cn/golang/

PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
PKG_HASH:=38f423db4cc834883f2b52344282fa7a39fbb93650dc62a11fdf0be6409bdad6

1.18的HASH:=38f423db4cc834883f2b52344282fa7a39fbb93650dc62a11fdf0be6409bdad6 还有我这边在Openwrt官网没有看到,关键词可以给一个吗!

wazzx commented 2 years ago

hash都没改肯定不行了,这个你去官方op看下别人怎么修改的不就知道了

大佬刚刚看到你在另外一个issue的回复了,格式我看了issue也大概知道怎么修改了,我想问一个问题如何把官方升级的golang: Update to 1.18, update patchopenwrt/packages@478666b 打到Openwrt的SDK里面了 像这样的一样的

pushd feeds/packages/lang
rm -rf golang && svn co https://github.com/openwrt/packages/branches/openwrt-21.02/lang/golang
popd
wazzx commented 2 years ago

hash都没改肯定不行了,这个你去官方op看下别人怎么修改的不就知道了 我大概知道了:我去试一下把!

pushd feeds/packages/lang
rm -rf golang && svn co https://github.com/openwrt/packages/branches/master/lang/golang
popd
wazzx commented 2 years ago

master

更新官方master分支的指令如下,然后出现下面报错,求路过的大佬指导。

XXX@XXXX:~/openwrt-sdk-21.02.2-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64/feeds/packages/lang$ rm -rf golang && svn co https://github.com/openwrt/packages/branches/master/lang/golang

svn: E235000: In file '/build/subversion-Lv3Qkk/subversion-1.9.7/subversion/libsvn_wc/wc_db.c' line 1651: assertion failed (SVN_IS_VALID_REVNUM(changed_rev))
Aborted (core dumped)
WYC-2020 commented 2 years ago

建议你还是别折腾这个1.18了,这个我没时间去折腾升级,我怕很多其他依赖这个go的都编译不过,这个如果你用的L的源码 那就吧那个patch 去掉 还是用1.17的吧,这个我在另外一个issue里面说过,如果你用官方的op的话 他本身就已经升级了,所以应该不会出现问题,如果你是用的L的升级了go 那你留意下其他依赖这个的 然后都统一升级就行了,反正现在很多go的项目都没使用1.18 很多都还没适配,要折腾只能自己搞了 @wazzx

wazzx commented 2 years ago

建议你还是别折腾这个1.18了,这个我没时间去折腾升级,我怕很多其他依赖这个go的都编译不过,这个如果你用的L的源码 那就吧那个patch 去掉 还是用1.17的吧,这个我在另外一个issue里面说过,如果你用官方的op的话 他本身就已经升级了,所以应该不会出现问题,如果你是用的L的升级了go 那你留意下其他依赖这个的 然后都统一升级就行了,反正现在很多go的项目都没使用1.18 很多都还没适配,要折腾只能自己搞了 @wazzx

官方的21.02和22.03还是1.17.8,但是master分支上面是1.18.但是我这边不知道怎么打补丁上去。所以打上去报错了。

WYC-2020 commented 2 years ago

用我这个patch 通杀,https://github.com/WYC-2020/openwrt-passwall/commit/b04f610298ab51c49fe01f024f89d507d52d7cda 亲测,这个如果后面更新了这个patch就可以去掉了,暂时可以用这个 @wazzx @MoetaYuko @smallprogram

WYC-2020 commented 2 years ago

自动兼容1.17 1.18