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

Support overriding the "Spin data dir" via env var #2563

Closed
lann opened this issue Jun 14, 2024 · 0 comments · Fixed by #2568
Closed

Support overriding the "Spin data dir" via env var #2563

lann opened this issue Jun 14, 2024 · 0 comments · Fixed by #2568
Labels
area/CLI CLI enhancement New feature or request good first issue Good for newcomers

Comments

@lann
Copy link
Collaborator

lann commented Jun 14, 2024

The Spin "data dir" (e.g. ~/.local/share) is used as the root for plugin and template state. We have a request (part of #2555) to make this customizable to aid integration with other development tooling.

The data dir is constructed here:

pub fn default_data_dir() -> Result<PathBuf> {

As suggested in the linked discussion, we could add support for an environment variable to override this algorithm. Bike-shedding on the name of that variable, I suggest SPIN_DATA_DIR.

In addition to adding this support, a bit of related clean-up would be nice:

  • Replace TEST_PLUGINS_DIRECTORY with this new env var
  • Maybe rename default_data_dir to...spin_data_dir (?); there isn't anything really "default" about it, especially with the removal of TEST_PLUGINS_DIRECTORY

Separately, should we do the same for "cache" (used by badger, OCI) and "config" (OCI registry auth) dirs?

cc @jandubois, @itowlson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CLI CLI enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant