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

tools.vpm: add support for ssh and hg version installations #20125

Merged
merged 5 commits into from
Dec 10, 2023

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Dec 8, 2023

  • Adds support for ssh installs e.g. v install git@github.com:vlang/libsodium.git.
  • and for version installs (@<tag>) for modules using mercurial.

ssh is currently kind of supported. While at current master ssh modules CANNOT be installed via v install, v update CAN update such modules when adding an ssh module manually or changing the origin url of a module to an ssh address. But the update command has other issues. Adding (hopefully full) ssh support - before fixing the remaining known issues with the update command in a next step - will help keep the current functionality intact and make working with the ssh feature easier.

SSH CI tests are not added here, if git ssh is set up locally, it can be tested as follows:

# Assuming this is a clean install 
❯ v install git@github.com:vlang/vsl
...

# Checking the url it should be the installed ssh address
❯ git -C ~/.vmodules/vsl ls-remote --get-url
git@github.com:vlang/vsl
❯ git ls-remote --refs ~/.vmodules/vsl
2cdb2dc2968f1e84ce01635ba8d5aa5dd11ecbb8        refs/heads/main
2cdb2dc2968f1e84ce01635ba8d5aa5dd11ecbb8        refs/remotes/origin/HEAD
2cdb2dc2968f1e84ce01635ba8d5aa5dd11ecbb8        refs/remotes/origin/main
# Installing with a .git ending and a version should work as well
❯ v install git@github.com:vlang/vsl.git@v0.1.50
Scanning `git@github.com:vlang/vsl.git@v0.1.50`...
Module `vsl` is already installed at `~/.vmodules/vsl`.
Replace it with `vsl@v0.1.50`? [Y/n]: 
Installing `vsl`...
Installed `vsl`.

❯ git ls-remote --refs ~/.vmodules/vsl
2f2bcc961982668c8685e2d999eaeb6b50920fce        refs/tags/v0.1.50
❯ git -C ~/.vmodules/vsl ls-remote --get-url
git@github.com:vlang/vsl.git

@ttytm ttytm changed the title shallow clone to tmp path instead of fetching raw manifest tools.vpm: add support for ssh and hg version installations Dec 8, 2023
@ttytm ttytm force-pushed the tools/vpm/add-ssh-support branch 3 times, most recently from 5cd9185 to 7eb51f2 Compare December 10, 2023 20:21
@ttytm ttytm marked this pull request as ready for review December 10, 2023 20:51
- allows to add installations from ssh addresses in a next step.
- simplifies things.
- while beeing less performat for some repos this widens support.
  E.g.: if there are edge cases of custom urls that don't support fetching
  of raw files, this change makes sure the manifest can be checked for all
  idents that can be cloned during installation.
@spytheman spytheman merged commit 2ceb128 into vlang:master Dec 10, 2023
42 checks passed
@ttytm ttytm deleted the tools/vpm/add-ssh-support branch December 15, 2023 22:06
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

Successfully merging this pull request may close these issues.

2 participants