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 installs from git version tags #19813

Closed
wants to merge 14 commits into from

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Nov 9, 2023

The change updates and extends VPM to install module versions based on git tags.

E.g. when installing modules

# VPM modules
v install publisher.module@v0.4.0
# From URLs
v install https://github.com/publisher/repository@v1.0.0

And when specifying dependencies in a v.mod file

Module {
	// ...
	dependencies: ['publisher.module@v0.6.0', 'https://github.com/publisher/repository@v1.0.0']
}

In its current state, the VPM module lacked the foundation for such feature. The PR therefore makes some fundamental updates that also come with additional fixes and performance improvements. The recently added tests and updates can certainly make it easier to wave through a big change like this, but this PR is still a chunk thrown at you as a reviewer.

I suggest it this way because going small steps on the current code would be extremely time-consuming for me as a programmer - to keep things working at every step while trying to make fundamental changes -, it would lead to a flood of PRs and would - bottom line - probably also take up more of your time. So please bare with me.

A short overview of what comes with the changes in this PR.

  • parse_query step - used to evaluate the requested modules at the beginning and use []Module arrays that store all data that is needed instead of working with []string arrays for the whole process. This allows to remove some highly coupled parts of code and to reduce redundancy where the same module data was requested from different functions at different stages.
  • general cleanups
  • fixes vpm can confuse the source of already installed modules, not allowing to install an external module when a vpm version of a module is installed.
  • better detects if a module is already installed. This allows to update it in case it is installed and fix unwanted removals.
  • extends tests

I still carry a long list of things how vpm can be further improved to achieve a high-quality and tailored product. But none that would require an extensive change like this one, and I would like to continue working on them separately after proposed changes have been resolved.

On further changes that are not as extensive in terms of code changes for the VPM module but also fundamental: I think we should require a v.mod file for vpm installations. Just as a Cargo.toml is required for rust cargo and a go.mod for go modules. At current master it's possible to fetch any git repo with v install <url>.

@ttytm ttytm changed the title wip: version install; add parse_query() []Module; decouple tools.vpm: add installs from git version tags Nov 9, 2023
@ttytm ttytm force-pushed the vpm/version-install branch 3 times, most recently from 2a8f095 to 87aba71 Compare November 9, 2023 02:32
@ttytm ttytm mentioned this pull request Nov 9, 2023
@ttytm ttytm closed this Nov 9, 2023
@ttytm ttytm deleted the vpm/version-install branch November 13, 2023 14:45
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.

1 participant