You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, V's updates — including v up and VPM package downloads — are only distributed via GitHub. However, in regions where GitHub is difficult to access (e.g., China), this often leads to frequent failures or extremely slow speeds when installing, updating, or fetching dependencies. Has the team ever considered implementing mirror support — such as allowing users to configure custom download sources, auto-selecting the fastest mirror, or specifying a mirror via a command-line flag?
1. Make the update URL configurable
Similar to Linux package manager mirror lists. For example, Arch Linux's /etc/pacman.d/mirrorlist:
## China
Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.cqu.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.aliyun.com/archlinux/$repo/os/$arch
V could have a similar config file or environment variable to let users specify a custom base URL.
2. Auto-select the fastest available mirror
I recently implemented something similar in v_llama_cpp to automatically pick a faster download source. The core logic looks like this:
modulev_llama_cppimportnet.httpimporttimefncheck_speed(url string, timeout_ms time.Duration, ch chan string) {
http.fetch(http.FetchConfig{
url: url
method: .head
read_timeout: timeout_ms * time.second
}) or {
return
}
ch <- url
}
fnselect_fastest_url(urls []string, timeout_ms int) !string {
if urls.len==0 {
returnerror('[Error] ./v_llama_cpp/ez_connect.v select_fastest_url(): not found url.')
}
ch:= chan string{cap: urls.len}
for url in urls {
gocheck_speed(url, timeout_ms * time.second, ch)
}
select {
winner:=<-ch {
return winner
}
timeout_ms * time.second {
returnerror('[Error] ./v_llama_cpp/ez_connect.v select_fastest_url(): timeout, not found url.')
}
}
returnerror('[Error] ./v_llama_cpp/ez_connect.v select_fastest_url(): unexpected end of select.')
}
If v up could do something similar — probe a list of known mirrors (GitHub, Gitee, AtomGit, etc.) and pick the fastest one — that would be really helpful.
This gives users a quick way to switch mirrors when the default one is slow or unreachable.
Platforms like GitHub, Gitee, AtomGit, etc., could all be used for real-time syncing if the official repo sets up mirrors there. Technically, none of these ideas seem too hard to implement, and they wouldn't affect the default GitHub workflow.
To be honest, we do care about the team's attitude on this. If there is a clear intention in this direction, we might be able to help with some related work. If not, we can just stop focusing on the mirroring issue for now.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, V's updates — including v up and VPM package downloads — are only distributed via GitHub. However, in regions where GitHub is difficult to access (e.g., China), this often leads to frequent failures or extremely slow speeds when installing, updating, or fetching dependencies. Has the team ever considered implementing mirror support — such as allowing users to configure custom download sources, auto-selecting the fastest mirror, or specifying a mirror via a command-line flag?
1. Make the update URL configurable
Similar to Linux package manager mirror lists. For example, Arch Linux's
/etc/pacman.d/mirrorlist:V could have a similar config file or environment variable to let users specify a custom base URL.
2. Auto-select the fastest available mirror
I recently implemented something similar in v_llama_cpp to automatically pick a faster download source. The core logic looks like this:
If
v upcould do something similar — probe a list of known mirrors (GitHub, Gitee, AtomGit, etc.) and pick the fastest one — that would be really helpful.3. Specify a mirror via command-line flag
Like pip's
-iflag in Python:V could support something like:
This gives users a quick way to switch mirrors when the default one is slow or unreachable.
Platforms like GitHub, Gitee, AtomGit, etc., could all be used for real-time syncing if the official repo sets up mirrors there. Technically, none of these ideas seem too hard to implement, and they wouldn't affect the default GitHub workflow.
To be honest, we do care about the team's attitude on this. If there is a clear intention in this direction, we might be able to help with some related work. If not, we can just stop focusing on the mirroring issue for now.
Beta Was this translation helpful? Give feedback.
All reactions