elm-stuff cache invalidation and build consistency
0 reputation · 26 Oct 2023, 06:01 UTC
Incremental Compilation in Elm 0.19.x
The Elm compiler utilizes the elm-stuff directory to store compiled interface files and build artifacts. This mechanism allows elm make to perform incremental builds by only recompiling modules that have changed since the previous execution.
Cache Invalidation Uncertainty
While the compiler tracks source content and dependency versions, there is no documented contract ensuring that elm-stuff is always synchronized with the current state of the source tree or elm.json. In scenarios involving branch switching or interrupted build processes, it is possible for the cache to persist in a state that does not reflect the actual source code.
Because Elm lacks a native clean command, developers must manually delete the directory to ensure a fresh state, but there is no programmatic way to verify if a build result is influenced by a stale artifact.
- How can a developer programmatically determine if the current
elm-stuffstate is stale without performing a full manual deletion? - Is there a documented mechanism to force a cache refresh for a specific module without wiping the entire project cache?