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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools.vpm: validate VCS during parsing #19943

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Nov 20, 2023

馃[deprecated] Generated by Copilot at 4143aa7

This pull request enhances the V package manager (VPM) to support different version control systems (VCS) for V modules, such as git and hg. It also adds the ability to install specific versions of git modules with flags. It refactors and reorganizes some code to improve readability and maintainability.

馃[deprecated] Generated by Copilot at 4143aa7

  • Change the vcs field of the Module and Settings structs from a string to a VCS type, which represents a version control system with its command and arguments (link, link, link, link, link, link)
  • Add a version field to the VCS struct, which specifies the flag to use for installing a specific version of a module (link, link, link)
  • Move the VCS struct and the install function of the Module struct from the vpm.v and install.v files to the common.v file, since they are used by both the install and update commands (link, link, link)
  • Add a local variable is_git_setting to check if the global settings.vcs is git, which is the default and most common VCS used for V modules (link)
  • Add comments to clarify the cases of external and VPM registered modules in the resolve_modules function (link, link)
  • Add a condition to check if the is_git_setting variable is true before calling the has_vmod function, which verifies the existence of a v.mod file in the module's repository (link)
  • Add a block of code to verify the VCS of the VPM registered module, and assign it to a local variable vcs in the resolve_modules function (link)
  • Add a block of code to check if there are any external modules in the modules array, and if so, verify that the global settings.vcs is executable in the resolve_modules function (link)
  • Remove the vcs argument from the install function of the Module struct, and use the vcs field of the struct instead (link, link, link, link)
  • Remove a block of code from the install_modules function, which checked if the global settings.vcs was executable, since this check was moved to the resolve_modules function (link)
  • Assign the is_installed field of the Module struct the value of a git command output, which checks if the module's repository has any remote references, only if the module uses git as its VCS (link)

@ttytm ttytm force-pushed the tools/vpm/validate-vcs-in-parse branch 2 times, most recently from 8681fbc to f427465 Compare November 20, 2023 07:22
@medvednikov medvednikov merged commit f8ed96a into vlang:master Nov 21, 2023
42 checks passed
@ttytm ttytm deleted the tools/vpm/validate-vcs-in-parse branch December 15, 2023 22:08
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.

None yet

3 participants