Allow people to publish packages from other host like Gitlab or Codeberg
It's the same thing Rust does with crates.io which is one of the main factors that got my not want to involve with the language among other things. Now you may say that most people are using Github so there is no reason to support any other site but I have to say some things about that:
- This is not accurate. Well yes Github has the vast majority but we're seeing more and more projects going away from Github (especially big ones) or even using Github only as a mirror and not as I primary source. I am an example that not everyone likes Github
- In any case, this is ideologically wrong. You shouldn't force people to use something that they don't like
- This is a BAD image for the tool, showing non-professional work
Of course the choice about supporting other sites or not is up to you but I just wanted to show my existence and say that people that don't use and like Github for their personal projects exists. At this point, vpm is not an option for me, I hope you care for all the users of your language
Is there any work in progress here? Please provide a link. What's the status for it?
Thank you.
@xliiv I doubt that there has been any progress as the repo hasn't been updated since April 9th. It seems that like a lot of other developers, V's main developer doesn't care about the "minorities". Noted!
The past couple of years have shown that people are more and more interested in decentralization, with the Fediverse gaining millions of users that are very active in the tech scene. People are using their own git repos for their projects, usually using Gitlab or Forgejo.
I feel like having the VPM rely 100% on GitHub is too restrictive, at least Rust's crates.io has a requirement on GitHub for login but the code can be hosted somewhere else.
Since v install accepts a repo URL for any git or mercurial repo, the real issue here is that the VPM database is really used only for package discovery, and not being able to add non-GitHub repos means they won't be found via v search or the website, which is very disadvantageous for developers using other git servers.
Given that the stars integration hasn't been completed yet, the only real metric we have on VPM is the number of downloads, which should rely on the calls from v install and don't depend on the git source. So it feels like it should be an easy fix to at least allow sources from other servers than GitHub.
I'm 100% for having something like v install http://mycustomgitserver.com/repo.git and for having non github repos in vpm.
Just needs to be implemented.
That has been working for quite a while...
$ v help install
Installs each PACKAGE.
Usage:
v install [PACKAGE...]
If no PACKAGEs, the packages listed in the `v.mod` file are installed instead.
Options:
--vpm [Default] Install from vpm
--git Install from git repository url
--hg Install from mercurial repository url
--help, -h Prints the help menu
--once Only install the package if it was not previously installed
-v Print more details about the performed operation.
-server-url When doing network operations, use this vpm server.
Can be given multiple times.
$
v install --git http://mycustomgitserver.com/repo.git should work, but VPM doesn't allow publishing new packages without a GitHub address. This is due to a couple of things:
- in src/templates/edit.html, there is a regex that checks the entered URL starts with
https://github.com/, so the frontend doesn't allow other servers. - in src/usecase/package/packages.v, the
allowed_vcslist only contains github. It is used incheck_vcs, which also verifies that a user (other than medvednikov, odd that it uses the hardcoded username instead of an admin user check...) has the repo it tries to add.
The first part is easy to fix, the second is a bit more difficult: if we allow multiple sources, but keep having GitHub only as a login source, someone could add repos from a different source as long as they have the same username. I can't think of a good way to go around it, other than adding the possibility to log in with other IDPs, to verify that the source is the same as the logged in user... Or adding some manual confirmation for non-GitHub repos, but that would add an extra chore for the VPM maintainers.
You're right, I forgot about --git
v help install
Installs each PACKAGE.
Usage:
v install [PACKAGE...]
If no PACKAGEs, the packages listed in the `v.mod` file are installed instead.
Options:
--vpm [Default] Install from vpm
--git Install from git repository url
--hg Install from mercurial repository url
--help, -h Prints the help menu
--once Only install the package if it was not previously installed
-v Print more details about the performed operation.
-server-url When doing network operations, use this vpm server.
Can be given multiple times.