Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Cache default ELM_HOME location #700

Open
wkaluza opened this issue Dec 5, 2021 · 1 comment
Open

Cache default ELM_HOME location #700

wkaluza opened this issue Dec 5, 2021 · 1 comment

Comments

@wkaluza
Copy link

wkaluza commented Dec 5, 2021

Netlify provides an Elm compiler installation, but does not cache the Elm modules which are downloaded during deploys. This leads to unnecessary repeated downloads which could be cached.

There have been several attempts by members of the Elm community to enable caching in order to improve build performance. The solutions tend to be brittle and rely on build script implementation details like certain environment variables being set and available to user code.

This has clearly been bugging people, and there are multiple non-solutions littering the Internet already. Elm is perhaps not a major player in the frontend world, but if the compiler is available on Netlify, perhaps caching Elm downloads by default would also be in order? If this is deemed a problem worth solving, I see two solutions:

  1. Set the ELM_HOME env variable in the Netlify build scripts to point to $NETLIFY_CACHE_DIR/.elm. Downloads will be saved there directly and will persist between deploys.
  2. Leave ELM_HOME unset and cache the default $HOME/.elm location using existing infrastructure.

I have a changeset which uses method 2, as that seems to be in line with current practice. Tested and confirmed to work locally using the test container provided. If maintainers approve, I am happy to submit a pull request.

@wkaluza
Copy link
Author

wkaluza commented Dec 20, 2021

[ping] Would there be any interest in this? Shall I just submit the PR?

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant