xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.87k stars 775 forks source link

Fix platform compatibility for _os_find and _os_date functions #5655

Closed rennsax closed 4 days ago

rennsax commented 4 days ago

This PR should close #5654.

These changes ensure broader compatibility across different operating systems and utilities.

rennsax commented 4 days ago

@waruqi 感谢 review

_os_find 调用比较多,而且 macOS find 事实上也支持 -maxdepth 和 -mindepth 选项,我直接统一了。

_os_date 我看只用到了一次,所以采用了 SOURCE_DATE_EPOCH — reproducible-builds.org 上的解决方法。

目前我在自己的 macOS 和 GNU/Linux 上测试过。可能不太完善,期待后续测试。

附:现在 $() 中的命令如果返回状态值不为零,都不会使 configure 脚本异常退出。后面如果有计划改进构建系统,可以考虑这个点,增加构建系统的鲁棒性。

Issues-translate-bot commented 4 days ago

Bot detected the issue body's language is not English, translate it automatically.


@waruqi Thanks for review

_os_find is called a lot, and macOS find actually supports the -maxdepth and -mindepth options, so I unified them directly.

_os_date I saw was only used once, using the solution on SOURCE_DATE_EPOCH — reproducible-builds.org.

So far I've tested it on my own macOS and GNU/Linux. It may not be perfect, and I look forward to subsequent testing.

Attachment: Now if the return status value of the command in $() is not zero, the configure script will not exit abnormally. If you plan to improve the build system later, you can consider this point to increase the robustness of the build system.

waruqi commented 4 days ago

thanks