Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对于 release 版本,xray version 中显示的 build 始终为 Custom #2879

Closed
KanakoMikami opened this issue Dec 30, 2023 · 3 comments
Closed

Comments

@KanakoMikami
Copy link

稍微进行了一下考古:在古老的 v2ray 里,有一个 release 脚本负责把 core.go 中的 build 变量改成当前日期,进而在 version 命令中显示,而 Custom 只是一个占位用的默认值。自 v2ray 被社区接管以来,那个 release 脚本被废弃,build 就被固定为了 Custom。后来的 GitHub CI 是从 Azure Pipelines 迁移过来的,没有对这个 build 做处理。

而 Xray 这里有些费解,release.yml 中只在常规运行 CI 时将 build 替换为 commit ID,在发布 release 时不做处理,导致使用 release 版本时,xray version 中显示的 build 始终为 Custom

建议把这里的 Custom 改成某种有意义的东西,不管是最初设计中的当前日期,还是 commit ID,或是什么别的东西。这样如果有自己编译的版本也容易区分。另外这里应该通过 env 传入一个值比较好,原来的方法算是个历史遗留。

@chika0801
Copy link
Contributor

chika0801 commented Dec 30, 2023

等个大佬pr,发现了(遇到)自己编译时始终为 Custom

@yin1999
Copy link
Contributor

yin1999 commented Dec 31, 2023

目前由于 golang/go#50603 还未被解决,可用的方法是在编译时手动增加一个标志:-ldflags "-X github.com/xtls/xray-core/core.build=${sha/tag}"

@yuhan6665
Copy link
Member

感谢提issue
fixed in 187

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

No branches or pull requests

4 participants