Skip to content

fix compatibility issues with go 1.21#3455

Merged
yuhan6665 merged 1 commit intoXTLS:mainfrom
mmmray:splithttp-go-1-21
Jun 18, 2024
Merged

fix compatibility issues with go 1.21#3455
yuhan6665 merged 1 commit intoXTLS:mainfrom
mmmray:splithttp-go-1-21

Conversation

@mmmray
Copy link
Contributor

@mmmray mmmray commented Jun 18, 2024

#3373 (comment)

I know 1.21 is not really supported, but the fix is very simple. it seems unnecessary to force the user to change this all the time.

perhaps there can be a minimal build for go 1.21 that does not get new transports? but then, enforced in CI. as chise suggested.

@test4uninstall
Copy link

"There's no need to insist on it. Most people who can use computers will install the tutorial, modify the code themselves, and compile it. The code in this discussion was not written by me; it was generated using ChatGPT.

If a compatible version can be compiled, the new transmission method can be included in the compatible version if it supports go1.21; otherwise, it should be disabled."

@Fangliding
Copy link
Member

I once had some similar suggestions to keep go1.20 to support Win7, but the result of discussion was feel free to use the new go version's features

@test4uninstall
Copy link

假如本项目再也不支持Windows7,可以使用VxKex项目来使其在Windows7中运行。
If this project no longer supports Windows 7, you can use the VxKex project to make it run on Windows 7.

@mmmray
Copy link
Contributor Author

mmmray commented Jun 18, 2024

personally, i did not feel the need to use go 1.22 features in splithttp, but that is mostly because I copypasted existing transport code and outdated stackoverflow answers

@yuhan6665 yuhan6665 merged commit c1a7602 into XTLS:main Jun 18, 2024
@yuhan6665
Copy link
Member

looks good

@RPRX
Copy link
Member

RPRX commented Jul 11, 2024

想确认一下,Go 1.21 编译的 Xray-core 的确能在 Win7 跑吗?可能会把下个版本的编译改为 Go 1.21,或者单独给 Win7 出 release

@mmmray mmmray deleted the splithttp-go-1-21 branch July 11, 2024 12:18
@mmmray
Copy link
Contributor Author

mmmray commented Jul 11, 2024

I think the discussion makes it already clear that xray does run on Windows 7 (or at least some parts of it), it's just a question of whether the project really wants to support it.

It's been discussed there already but I also think that separate builds for win7 are much safer. net/http has many bugfixes in 1.22.

@Fangliding
Copy link
Member

Fangliding commented Jul 11, 2024

想确认一下,Go 1.21 编译的 Xray-core 的确能在 Win7 跑吗?可能会把下个版本的编译改为 Go 1.21,或者单独给 Win7 出 release

1.21不行 必须降回1.20 见 https://github.com/XTLS/Xray-core/releases/tag/v1.8.4 大概有几个地方需要小改

@mmmray
Copy link
Contributor Author

mmmray commented Jul 11, 2024

the project could position itself like this:

  • win7 builds are provided, but bugs are not fixed. only ability to compile is ensured
  • there is no guarantee all features are available. particularly, if an external contributor wants to add a feature and gets stuck on go 1.21, he is allowed to disable the feature for win7 if it's easier
  • there is no officially supported mechanism for compiling on 1.21 or 1.20 for all OS, the support is for win7 specifically

@test5uninstall
Copy link

想确认一下,Go 1.21 编译的 Xray-core 的确能在 Win7 跑吗?可能会把下个版本的编译改为 Go 1.21,或者单独给 Win7 出 release

1.21不行 必须降回1.20 见 https://github.com/XTLS/Xray-core/releases/tag/v1.8.4 大概有几个地方需要小改

不需要降到那么低的版本,Go1.21.4可以编译并运行,到了Go1.21.5及以上版本则不行。

@test5uninstall
Copy link

想确认一下,Go 1.21 编译的 Xray-core 的确能在 Win7 跑吗?可能会把下个版本的编译改为 Go 1.21,或者单独给 Win7 出 release

是可以跑的,不过只能Go1.21.4及以下版本才可以跑,Go1.21.5及以上版本则不行。

@Fangliding
Copy link
Member

Fangliding commented Jul 11, 2024

image
晕厥

@test5uninstall
Copy link

maG8Esf5XF6Kml

@RPRX
Copy link
Member

RPRX commented Jul 12, 2024

@mmmray 有时间研究一下怎么给 CI 加个 Go 1.21.4 编译吗?Xray-win7-64.zip 和 Xray-win7-32.zip

@RPRX
Copy link
Member

RPRX commented Jul 12, 2024

积累了很多 commits,我先发个新版吧,下个版本再给 releases 加 Win7 专版,下个版本只积累 bug fixes,应该是 1.8 最后一版

@Fangliding
Copy link
Member

@mmmray 有时间研究一下怎么给 CI 加个 Go 1.21.4 编译吗?Xray-win7-64.zip 和 Xray-win7-32.zip

给所有用新版本特性的地方加个build flag绕过或者抛错误 感觉会很丑陋 singbox就维护了几个这样的1.20文件

@RPRX
Copy link
Member

RPRX commented Jul 12, 2024

给所有用新版本特性的地方加个build flag绕过或者抛错误 感觉会很丑陋 singbox就维护了几个这样的1.20文件

暂时还没非用不可的新特性

@mmmray
Copy link
Contributor Author

mmmray commented Jul 12, 2024

I now also agree with Fangliding, build flags are ugly. The code compiles fine on 1.21.4 without changes, so there is hope. I just don't know what it means for new feature development. I definitely want to avoid making the testsuite pass on older versions of Go (it is already unstable enough today), and I think bug reports for Win 7 should not be processed.

Do you have time to study how to add Go 1.21.4 compilation to CI? Xray-win7-64.zip and Xray-win7-32.zip

Can do it next week. I also am still unsure if this is worth doing at all, I don't see a strong motivation/justification, maybe I am missing some context.

@test5uninstall
Copy link

test5uninstall commented Jul 12, 2024

@mmmray 有时间研究一下怎么给 CI 加个 Go 1.21.4 编译吗?Xray-win7-64.zip 和 Xray-win7-32.zip

给所有用新版本特性的地方加个build flag绕过或者抛错误 感觉会很丑陋 singbox就维护了几个这样的1.20文件

能否也提供没有build flag的源代码,让用户尝试将编译错误信息丢给AI,让AI给出解决方案。

@Fangliding
Copy link
Member

@RPRX
Copy link
Member

RPRX commented Jul 12, 2024

@mmmray 仅提供编译,无其它支持

@mmmray mmmray mentioned this pull request Jul 12, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants