You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
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:
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.
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.
The text was updated successfully, but these errors were encountered:
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.
NETLIFY_CACHE_DIR
env variable no longer being visible to user code.ELM_HOME
on the user, completely reinstalling any Elm modules present. This particular example also has problems, as caching the whole localelm-stuff/
is not without risk according to the creator of Elm: Point to "how to make CI fast" link when cache is messed up elm/compiler#1845 (comment)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:
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.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.
The text was updated successfully, but these errors were encountered: