purescript / spago

🍝 PureScript package manager and build tool
BSD 3-Clause "New" or "Revised" License
793 stars 132 forks source link

Specify location of local cache #471

Closed joneshf closed 4 years ago

joneshf commented 5 years ago

In a similar way that the global cache can be altered by the person using spago:

https://github.com/spacchetti/spago/blob/5e4e134d3734eef4750bb6e9d224c3f1f47fa6fc/src/Spago/GlobalCache.hs#L140-L148

It would be nice if the local cache could be altered by the person using spago: https://github.com/spacchetti/spago/blob/5e4e134d3734eef4750bb6e9d224c3f1f47fa6fc/src/Spago/FetchPackage.hs#L174-L176

Either an environment variable or a flag would work for me. Would you be willing to accept a PR for this change?

f-f commented 5 years ago

@joneshf yeah this sounds good. However I wonder what's the underlying use-case? If that's for "monorepo sharing" I'd like to avoid adding another knob and instead have Spago figure this out. We already guess the "monorepo root" since #422 in order to share the output folder, so this would not be a big deal to implement

joneshf commented 5 years ago

Surprisingly, this issue isn't about monorepos :). Just looking to move that directory.

What are you thinking for naming? I've no preference.

f-f commented 5 years ago

@joneshf I'd say we could use an environment variable, starting with SPAGO_. Other than this I have no particular preference 🙂 So maybe something like SPAGO_LOCAL_CACHE?

f-f commented 4 years ago

It looks like there hasn't been much activity in the last months here and I'm trying to tidy up the backlog, so I'll close this for now. This is still something that we could have, so feel free to reopen it if needs be