Skip to content

[epic] rv sync to install full bundles #461

@indirect

Description

@indirect

Today, we have rv clean-install, which is roughly equivalent to bundle install --frozen. The next major step for managing projects is rv sync, which works like bundle install.

The first pass at the sync mechanism looks something like:

  • Get a list of dependencies from the Gemfile via ruby -e 'YAML.dump(Bundler.definition.dependencies)'
  • Fetch the latest information about requested gems from the gem server /info/ files
  • Recursively build a list of every possible requested dependency by reading /info/ files
  • Feed the full list of requested dependencies and available packages into pubgrub to get a resolution
  • write out a new Gemfile.lock
  • Install the resolved gems just like clean-install does
  • use the existing Gemfile.lock as a basis for resolving the Gemfile

Once that is working, full functionality has a few additional steps:

  • Serialize the resolution as gem.lock (which is still a kdl file, but not a human-editable one)
  • If Gemfile.lock or gem.lock exist, use that as the basis for the new resolution to minimize churn
  • Once this is all working, automatically sync as a step during rv run
  • Best-effort translation of Gemfile into gem.kdl on demand when rv init is run
    • we could potentially try to parse the Gemfile ourselves looking for common patterns
    • we could also try to run Bundler to eval the Gemfile and then print out a data structure of the result
    • either way, it's impractical to run Ruby and Bundler to eval the entire Gemfile every time, so we need some translator
  • Read the list of requested dependencies from gem.kdl's section named dependencies

@deivid-rodriguez am I missing anything here that we should add to the first pass?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions