XTLS / Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
https://t.me/projectXray
Mozilla Public License 2.0
25.48k stars 3.94k forks source link

最新源代码golang 1.19编译失败 #1755

Closed Gzxhwq closed 1 year ago

Gzxhwq commented 1 year ago

由于openwrt主线仍然停留在1.19,所以希望能修一下

https://github.com/XTLS/Xray-core/commit/79c0b0a0f2c82a67e353be41c2a85dcb9cbbfe59

../pkg/mod/github.com/xtls/reality@v0.0.0-20230308170557-1c3141866eb7/handshake_server_tls13.go:101:23: undefined: bytes.Clone

wyx2685 commented 1 year ago

@Gzxhwq 已经要求1.19.6以上,go可以官网自己下载升级

Gzxhwq commented 1 year ago

已经是1.19.6了

https://github.com/coolsnowwolf/packages/blob/master/lang/golang/golang/Makefile https://github.com/openwrt/packages/blob/master/lang/golang/golang/Makefile

yichya commented 1 year ago

bytes.Clone() 确实是 1.20 才带进来的 https://github.com/golang/go/issues/57126

// Clone returns a copy of b[:len(b)].
// The result may have additional unused capacity.
// Clone(nil) returns nil.
func Clone(b []byte) []byte {
    if b == nil {
        return nil
    }
    return append([]byte{}, b...)
}
BI7PRK commented 1 year ago

bytes.Clone() 确实是 1.20 才带进来的 golang/go#57126

// Clone returns a copy of b[:len(b)].
// The result may have additional unused capacity.
// Clone(nil) returns nil.
func Clone(b []byte) []byte {
  if b == nil {
      return nil
  }
  return append([]byte{}, b...)
}

大佬 ,我拿了你的代码来学习了。刚刚尝试编译确实是这个错误,

go: downloading github.com/xtls/utls v1.2.3
go: downloading github.com/xtls/reality v0.0.0-20230308170557-1c3141866eb7
# github.com/xtls/reality
../../../../dl/go-mod-cache/github.com/xtls/reality@v0.0.0-20230308170557-1c3141866eb7/handshake_server_tls13.go:101:23: undefined: bytes.Clone
make[2]: *** [Makefile:72: /tmp/tmp.j3UbI8QGKN/build_dir/target-aarch64_cortex-a53_musl/openwrt-xray/openwrt-xray-v1.7.5/.built] Error 2
make[2]: Leaving directory '/home/runner/work/openwrt-xray/openwrt-xray'
time: package/xray-core/compile#105.58#10.91#63.85
    ERROR: package/xray-core failed to build.
make[1]: *** [package/Makefile:116: package/xray-core/compile] Error 1
make[1]: Leaving directory '/tmp/tmp.j3UbI8QGKN'
make: *** [/tmp/tmp.j3UbI8QGKN/include/toplevel.mk:224: package/xray-core/compile] Error 2
Error: Process completed with exit code 2.
RPRX commented 1 year ago

感谢反馈,会修复,虽然客户端其实没用到这个库

To 群里:还有别的问题吗

Fangliding commented 1 year ago

@RPRX 能不能把reality scanner加到xray命令行里()

RPRX commented 1 year ago

@Fangliding 加到 Xray 里是比较方便,但它还处于开发阶段,目前解耦更好,你也不想给 v1.8.0 再加个 release-blocker 吧

yoohooyoo commented 1 year ago

感谢反馈,会修复,~虽然客户端其实没用到这个库~

To 群里:还有别的问题吗

没有啦没有啦,排排坐静等发版。(期待脸)

FranzKafkaYu commented 1 year ago

@Fangliding 加到 Xray 里是比较方便,但它还处于开发阶段,目前解耦更好,~你也不想给 v1.8.0 再加个 release-blocker 吧~

还请一并更新分享链接标准~

RPRX commented 1 year ago

计划是发版后依次更新 example、分享链接标准、release note、文章

RPRX commented 1 year ago

前两个比较快,后两个等吧

BI7PRK commented 1 year ago

我以为是昨天,3.8节,大佬会发v1.8

rurirei commented 1 year ago

it's aggressive to requires go 1.20.

RPRX commented 1 year ago

我以为是昨天,3.8节,大佬会发v1.8

v1.7.2 是 01.07,v1.7.5 是 02.08,所以 v1.8.0 是 03.09

RPRX commented 1 year ago

it's aggressive to requires go 1.20.

目前会保持对 Go 1.19 的兼容性,只是我本地只有 Go 1.20.1,所以没发现 Go 1.19 没 bytes.Clone()

rurirei commented 1 year ago

it's better to keep compatibiliable with go 1.18.

RPRX commented 1 year ago

it's better to keep compatibiliable with go 1.18.

没有必要,不考虑兼容 Golang 官方已不维护的版本

Edwin-Kevin commented 1 year ago

@RPRX 所以1.8.1是04.10,1.8.2是05.11(逃)

thisdk commented 1 year ago

GFW : 我们现在掌握了一条重要线索.已经能识别某富强软件的版本发布节奏了

Zander-1024 commented 1 year ago

GFW : 我们现在掌握了一条重要线索.已经能识别某富强软件的版本发布节奏了

笑死

RPRX commented 1 year ago

刚刚全是 Rate limit,还以为我号被 GitHub 的内鬼员工(GFW 线人)ban 了

RPRX commented 1 year ago

感谢反馈,https://github.com/XTLS/Xray-core/releases/tag/v1.8.0 应该可以用 Go 1.19 编译,请测试

RPRX commented 1 year ago

To 群里,在传输非 TLS 时,v1.8.0 与 v1.7.5 可能不兼容

RPRX commented 1 year ago

(指 XTLS Vision)

Extreme-Icer commented 1 year ago

@RPRX 已经复现了,暂时回退服务端到175,等ng新版

o0HalfLife0o commented 1 year ago

(指 XTLS Vision)

你这个大喘气,直接把一堆人吓得不敢更新了

BI7PRK commented 1 year ago

准备睡觉了才看到放出来,_瘾_诱爱折腾的人。😄😄😄

chika0801 commented 1 year ago

试了下 客户端 1.75 服务端 1.80 VLESS+VISION+TLS 是有 在传输非 TLS 时,v1.8.0 与 v1.7.5 可能不兼容

手机上一个手游,被代理,连不上服务器(走5G,开NG代理这手游,不通。走WIFI,openwrt里的ssrp+插件也不通)NG和ssrp+都是 VLESS+VISION+TLS xray 1.75

5g信号直连就通了

chika0801 commented 1 year ago

又复现不了了,再多用用看,等个ng和路由器插件也快升1.8.0了

RPRX commented 1 year ago

其实我更希望你们多测测 REALITY,因为代码又小改了一点

chika0801 commented 1 year ago

win11上用v2rayn,和服务端更新了1.8.0暂没发现异常

手机v2rayng是1.75连服务端1.8.0这样的组合也用不了好长时间了,现在这样用着,在手机上,目前没发现什么明显的异常

RPRX commented 1 year ago

为了防止大家误解,v1.8.0 和 v1.7.5 的 XTLS Vision 在代理非 TLS 时可能不兼容,是我们预期之内的,won't fix,请同步更新版本

chika0801 commented 1 year ago

it's aggressive to requires go 1.20.

目前会保持对 Go 1.19 的兼容性,~只是我本地只有 Go 1.20.1,所以没发现 Go 1.19 没 bytes.Clone()~

我在编译openwrt固件时,使用下面命令更新go版本。我发现 https://github.com/openwrt/packages/branches/openwrt-22.03/lang/golang/golang 链接里面的版本还是1.19.6。幸好没强行要求必需使用1.20版本,不然openwrt那边编译又要失败。

    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
RPRX commented 1 year ago

现在肯定会兼容 Go 1.19 的,一是 OpenWRT,二是 NG 那边用 Go 1.20 编译的包有点问题,包括 1.20.2,@yuhan6665 还在研究