xmake-io / github-action-setup-xmake

Set up your GitHub Actions workflow with a specific version of xmake

Home Page:https://xmake.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

action 环境内的 xmake 不应该调用 ping

jingkaimori opened this issue · comments

Xmake 版本

2.8.1

操作系统版本和架构

Ubuntu 2204

描述问题

目前xmake用ping来比较多个下载源的速度,但是 GitHub Action托管在 Azure 环境下,调用 ping 返回的结果永远是超时。而且调用 ping 还会阻塞 Action 的执行。

actions/runner-images#1519

期待的结果

在较短时间内检查出不同下载源的速度,并选择最快的下载源

工程配置

xmake-io/xmake-repo#2477

附加信息和错误日志

https://github.com/xmake-io/xmake-repo/actions/runs/5926650342/job/16068472721?pr=2477

checking for ping ... /usr/bin/ping
pinging the host(github.com) ... 65535 ms
pinging the host(repo.or.cz) ... 65535 ms
pinging the host(luajit.org) ... 65535 ms

改成 curl -X head 咋样

commented

xmake 内部对 ping 设置了最大 1s 超时,并且是多个 host 并行执行的,即使不可达,4个 url host 同时 ping ,也就堵 1s 时间。。不会长时间卡住。。另外,还有本地缓存,不会重复 ping 。。所以没必要特别去优化它。。即使优化了,顶多也就省个 1-2s 的时间。。

pinging the host(github.com) ... 65535 ms

这里显示 65535 ms 不用管它,仅仅只是 1s 超时后,我写死的最大值而已,并不是实际堵住的时间