Skip to content

Instantly share code, notes, and snippets.

@mfts
Last active February 20, 2023 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mfts/e49d4113d3b9219bc71ab73fa2865958 to your computer and use it in GitHub Desktop.
Save mfts/e49d4113d3b9219bc71ab73fa2865958 to your computer and use it in GitHub Desktop.
RFC: Dependency Manager Install Location

Motivation

One of the core benefits of tea: it's relocatable. tea does not pollute your system environment, everything gets "installed" in a relocatable folder ~/.tea.

tea can also install languages like node and ruby and it's dependency managers, npm and gem, respectively. However, these language dependency managers install packages to global directories like ~/.npm and ~/.gem. Tools from these ecosystems expect to find packages in these locations.

In this RFC, we would love to hear feedback from the community.

Proposal

There are a couple of options that we are weighing:

  • dependency managers' default location, i.e. ~/.gem
  • general location, i.e. ~/.local/bin
  • inside tea's directory, i.e. ~/.tea/foo

1. Dependency manager's default location

Languages and their dependency managers have set default locations for their package installations. Tea should not change how or where gem installs Ruby gems. Tea packages ruby and gem and leaves the rest to them.

  • For instance, if we install Ruby with tea, it will be installed here: ~/.tea/ruby-lang.org/v3.2.1/bin
  • Ruby will install gems to ~/.gem

2. General location

Tea is a package manager that cares about developer experience and by following that mantra, a general location, which is already in the user's $PATH should be picked as a logical install location.

  • For instance, if we install Ruby with tea, it will be installed here: ~/.tea/ruby-lang.org/v3.2.1/bin.
  • Ruby will install gems to ~/.local/bin or /usr/local/bin or ~/.tea/bin.

3. A tea location

Tea is relocatable and stows packages in a "sandbox". If you want to remove a particular package from your tea installation, you simply remove the package folder: rm -r ~/.tea/foo.org

  • For instance, if we install Ruby with tea, it will be installed here: ~/.tea/ruby-lang.org/v3.2.1/bin
  • Ruby will install gems to ~/.tea/ruby-lang.org/v3.2.1/bin

The benefit: if I want to remove a particular version of Ruby, along with all installed gems, I simply remove ~/.tea/ruby-lang.org/v3.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment